From 4649876956ab944d2a9ea8fc98c75dc8a9f5ef08 Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 25 Jun 2022 00:36:16 +0200 Subject: Update dependencies (#1851) --- .../github.com/SevereCloud/vksdk/v2/.golangci.yml | 3 + vendor/github.com/SevereCloud/vksdk/v2/doc.go | 2 +- .../SevereCloud/vksdk/v2/object/groups.go | 10 +- .../SevereCloud/vksdk/v2/object/video.go | 2 +- vendor/github.com/d5/tengo/v2/compiler.go | 7 +- vendor/github.com/d5/tengo/v2/parser/parser.go | 18 +- vendor/github.com/d5/tengo/v2/parser/scanner.go | 113 +- vendor/github.com/gomarkdown/markdown/.gitpod.yml | 9 + .../github.com/gomarkdown/markdown/parser/block.go | 6 + vendor/github.com/klauspost/compress/.gitignore | 7 + vendor/github.com/klauspost/compress/README.md | 40 + .../github.com/klauspost/compress/huff0/autogen.go | 5 - .../klauspost/compress/huff0/bitreader.go | 10 - .../klauspost/compress/huff0/bitwriter.go | 115 - .../klauspost/compress/huff0/bytereader.go | 10 - .../klauspost/compress/huff0/compress.go | 1 + .../klauspost/compress/huff0/decompress.go | 113 +- .../klauspost/compress/huff0/decompress_8b_amd64.s | 488 --- .../compress/huff0/decompress_8b_amd64.s.in | 197 - .../klauspost/compress/huff0/decompress_amd64.go | 181 +- .../klauspost/compress/huff0/decompress_amd64.s | 1179 ++++-- .../klauspost/compress/huff0/decompress_amd64.s.in | 195 - .../klauspost/compress/huff0/decompress_generic.go | 102 + .../klauspost/compress/internal/cpuinfo/cpuinfo.go | 34 + .../compress/internal/cpuinfo/cpuinfo_amd64.go | 11 + .../compress/internal/cpuinfo/cpuinfo_amd64.s | 36 + vendor/github.com/klauspost/compress/s2/README.md | 30 +- vendor/github.com/klauspost/compress/s2/decode.go | 289 +- vendor/github.com/klauspost/compress/s2/encode.go | 6 - .../klauspost/compress/s2/encode_best.go | 28 +- .../github.com/klauspost/compress/s2/encode_go.go | 23 +- .../klauspost/compress/s2/encodeblock_amd64.go | 2 + .../klauspost/compress/s2/encodeblock_amd64.s | 2052 +++++++--- vendor/github.com/klauspost/compress/s2/index.go | 10 + .../github.com/klauspost/compress/zstd/README.md | 58 +- .../klauspost/compress/zstd/bitreader.go | 7 - .../klauspost/compress/zstd/bitwriter.go | 76 - .../github.com/klauspost/compress/zstd/blockdec.go | 73 +- .../github.com/klauspost/compress/zstd/bytebuf.go | 4 - .../klauspost/compress/zstd/bytereader.go | 6 - .../github.com/klauspost/compress/zstd/decoder.go | 121 +- .../klauspost/compress/zstd/decoder_options.go | 13 +- .../klauspost/compress/zstd/enc_better.go | 8 +- .../klauspost/compress/zstd/enc_dfast.go | 10 +- .../github.com/klauspost/compress/zstd/encoder.go | 2 +- .../github.com/klauspost/compress/zstd/framedec.go | 70 +- .../klauspost/compress/zstd/fse_decoder.go | 65 +- .../klauspost/compress/zstd/fse_encoder.go | 23 - vendor/github.com/klauspost/compress/zstd/fuzz.go | 11 - .../klauspost/compress/zstd/fuzz_none.go | 11 - vendor/github.com/klauspost/compress/zstd/hash.go | 6 - .../github.com/klauspost/compress/zstd/seqdec.go | 260 +- .../klauspost/compress/zstd/seqdec_amd64.go | 362 ++ .../klauspost/compress/zstd/seqdec_amd64.s | 3689 ++++++++++++++++++ .../klauspost/compress/zstd/seqdec_generic.go | 237 ++ vendor/github.com/klauspost/compress/zstd/zip.go | 57 +- vendor/github.com/klauspost/compress/zstd/zstd.go | 11 - vendor/github.com/slack-go/slack/README.md | 8 +- vendor/github.com/slack-go/slack/block_input.go | 3 +- vendor/github.com/slack-go/slack/bookmarks.go | 159 + .../slack-go/slack/internal/misc/misc.go | 28 - vendor/github.com/slack-go/slack/misc.go | 4 +- vendor/github.com/slack-go/slack/remotefiles.go | 316 ++ .../github.com/slack-go/slack/status_code_error.go | 28 + vendor/github.com/slack-go/slack/views.go | 37 +- vendor/github.com/slack-go/slack/webhooks.go | 8 +- .../slack-go/slack/websocket_managed_conn.go | 7 +- .../github.com/slack-go/slack/websocket_subteam.go | 4 +- .../assert/assertion_compare_can_convert.go | 2 +- vendor/github.com/stretchr/testify/suite/suite.go | 10 + vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.go | 3992 +++++++++++--------- vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.raw | Bin 61356 -> 62723 bytes vendor/go.mau.fi/whatsmeow/binary/proto/def.proto | 158 +- vendor/go.mau.fi/whatsmeow/message.go | 18 +- vendor/go.mau.fi/whatsmeow/presence.go | 2 +- vendor/go.mau.fi/whatsmeow/receipt.go | 34 +- vendor/go.mau.fi/whatsmeow/store/clientpayload.go | 6 +- .../whatsmeow/store/sqlstore/container.go | 3 +- vendor/go.mau.fi/whatsmeow/store/sqlstore/store.go | 27 +- .../go.mau.fi/whatsmeow/store/sqlstore/upgrade.go | 2 +- vendor/go.mau.fi/whatsmeow/store/store.go | 2 +- .../go.mau.fi/whatsmeow/types/events/appstate.go | 8 + vendor/go.mau.fi/whatsmeow/types/message.go | 1 + vendor/go.mau.fi/whatsmeow/user.go | 18 +- vendor/gopkg.in/yaml.v3/parserc.go | 11 +- vendor/modules.txt | 26 +- 86 files changed, 10788 insertions(+), 4648 deletions(-) create mode 100644 vendor/github.com/gomarkdown/markdown/.gitpod.yml delete mode 100644 vendor/github.com/klauspost/compress/huff0/autogen.go delete mode 100644 vendor/github.com/klauspost/compress/huff0/decompress_8b_amd64.s delete mode 100644 vendor/github.com/klauspost/compress/huff0/decompress_8b_amd64.s.in delete mode 100644 vendor/github.com/klauspost/compress/huff0/decompress_amd64.s.in create mode 100644 vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go create mode 100644 vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go create mode 100644 vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.s delete mode 100644 vendor/github.com/klauspost/compress/zstd/fuzz.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/fuzz_none.go create mode 100644 vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go create mode 100644 vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s create mode 100644 vendor/github.com/klauspost/compress/zstd/seqdec_generic.go create mode 100644 vendor/github.com/slack-go/slack/bookmarks.go delete mode 100644 vendor/github.com/slack-go/slack/internal/misc/misc.go create mode 100644 vendor/github.com/slack-go/slack/remotefiles.go create mode 100644 vendor/github.com/slack-go/slack/status_code_error.go (limited to 'vendor') diff --git a/vendor/github.com/SevereCloud/vksdk/v2/.golangci.yml b/vendor/github.com/SevereCloud/vksdk/v2/.golangci.yml index ff1db59c..66712f60 100644 --- a/vendor/github.com/SevereCloud/vksdk/v2/.golangci.yml +++ b/vendor/github.com/SevereCloud/vksdk/v2/.golangci.yml @@ -57,6 +57,8 @@ linters: - grouper - decorder - containedctx + # - execinquery # FIXME: panic in 1.46.0 + - nosprintfhostport # - wrapcheck # TODO: v3 Fix # - testpackage # TODO: Fix testpackage @@ -87,6 +89,7 @@ linters: # - varnamelen # - errchkjson # - maintidx +# - nonamedreturns # depricated # - maligned diff --git a/vendor/github.com/SevereCloud/vksdk/v2/doc.go b/vendor/github.com/SevereCloud/vksdk/v2/doc.go index 3e3c12a1..aa532f9c 100644 --- a/vendor/github.com/SevereCloud/vksdk/v2/doc.go +++ b/vendor/github.com/SevereCloud/vksdk/v2/doc.go @@ -7,6 +7,6 @@ package vksdk // Module constants. const ( - Version = "2.14.0" + Version = "2.14.1" API = "5.131" ) diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/groups.go b/vendor/github.com/SevereCloud/vksdk/v2/object/groups.go index 6cabae01..8f1636b4 100644 --- a/vendor/github.com/SevereCloud/vksdk/v2/object/groups.go +++ b/vendor/github.com/SevereCloud/vksdk/v2/object/groups.go @@ -210,7 +210,7 @@ type GroupsGroup struct { MainSection int `json:"main_section,omitempty"` OnlineStatus GroupsOnlineStatus `json:"online_status,omitempty"` // Status of replies in community messages AgeLimits int `json:"age_limits,omitempty"` // Information whether age limit - BanInfo GroupsGroupBanInfo `json:"ban_info,omitempty"` // User ban info + BanInfo *GroupsGroupBanInfo `json:"ban_info,omitempty"` // User ban info Addresses GroupsAddressesInfo `json:"addresses,omitempty"` // Info about addresses in Groups LiveCovers GroupsLiveCovers `json:"live_covers,omitempty"` CropPhoto UsersCropPhoto `json:"crop_photo,omitempty"` @@ -963,10 +963,10 @@ type GroupsOnlineStatus struct { // GroupsOwnerXtrBanInfo struct. type GroupsOwnerXtrBanInfo struct { - BanInfo GroupsBanInfo `json:"ban_info"` - Group GroupsGroup `json:"group"` - Profile UsersUser `json:"profile"` - Type string `json:"type"` + BanInfo *GroupsBanInfo `json:"ban_info"` + Group GroupsGroup `json:"group"` + Profile UsersUser `json:"profile"` + Type string `json:"type"` } // GroupsSubjectItem struct. diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/video.go b/vendor/github.com/SevereCloud/vksdk/v2/object/video.go index d86143a9..6774fa00 100644 --- a/vendor/github.com/SevereCloud/vksdk/v2/object/video.go +++ b/vendor/github.com/SevereCloud/vksdk/v2/object/video.go @@ -31,7 +31,7 @@ type VideoVideo struct { CanLike BaseBoolInt `json:"can_like"` // Information whether current user can download the video. - CanDownload BaseBoolInt `json:"can_download"` + CanDownload int `json:"can_download"` // Information whether current user can repost this video. CanRepost BaseBoolInt `json:"can_repost"` diff --git a/vendor/github.com/d5/tengo/v2/compiler.go b/vendor/github.com/d5/tengo/v2/compiler.go index e4e04303..6591603c 100644 --- a/vendor/github.com/d5/tengo/v2/compiler.go +++ b/vendor/github.com/d5/tengo/v2/compiler.go @@ -1220,14 +1220,14 @@ func (c *Compiler) optimizeFunc(node parser.Node) { iterateInstructions(c.scopes[c.scopeIndex].Instructions, func(pos int, opcode parser.Opcode, operands []int) bool { switch { + case dsts[pos]: + dstIdx++ + deadCode = false case opcode == parser.OpReturn: if deadCode { return true } deadCode = true - case dsts[pos]: - dstIdx++ - deadCode = false case deadCode: return true } @@ -1242,6 +1242,7 @@ func (c *Compiler) optimizeFunc(node parser.Node) { var appendReturn bool endPos := len(c.scopes[c.scopeIndex].Instructions) newEndPost := len(newInsts) + iterateInstructions(newInsts, func(pos int, opcode parser.Opcode, operands []int) bool { switch opcode { diff --git a/vendor/github.com/d5/tengo/v2/parser/parser.go b/vendor/github.com/d5/tengo/v2/parser/parser.go index fd20423b..eaa9dc93 100644 --- a/vendor/github.com/d5/tengo/v2/parser/parser.go +++ b/vendor/github.com/d5/tengo/v2/parser/parser.go @@ -375,7 +375,12 @@ func (p *Parser) parseOperand() Expr { case token.Ident: return p.parseIdent() case token.Int: - v, _ := strconv.ParseInt(p.tokenLit, 10, 64) + v, err := strconv.ParseInt(p.tokenLit, 0, 64) + if err == strconv.ErrRange { + p.error(p.pos, "number out of range") + } else if err != nil { + p.error(p.pos, "invalid integer") + } x := &IntLit{ Value: v, ValuePos: p.pos, @@ -383,8 +388,14 @@ func (p *Parser) parseOperand() Expr { } p.next() return x + case token.Float: - v, _ := strconv.ParseFloat(p.tokenLit, 64) + v, err := strconv.ParseFloat(p.tokenLit, 64) + if err == strconv.ErrRange { + p.error(p.pos, "number out of range") + } else if err != nil { + p.error(p.pos, "invalid float") + } x := &FloatLit{ Value: v, ValuePos: p.pos, @@ -447,10 +458,11 @@ func (p *Parser) parseOperand() Expr { return p.parseErrorExpr() case token.Immutable: // immutable expression return p.parseImmutableExpr() + default: + p.errorExpected(p.pos, "operand") } pos := p.pos - p.errorExpected(pos, "operand") p.advance(stmtStart) return &BadExpr{From: pos, To: p.pos} } diff --git a/vendor/github.com/d5/tengo/v2/parser/scanner.go b/vendor/github.com/d5/tengo/v2/parser/scanner.go index f1d820a4..5f797706 100644 --- a/vendor/github.com/d5/tengo/v2/parser/scanner.go +++ b/vendor/github.com/d5/tengo/v2/parser/scanner.go @@ -93,9 +93,9 @@ func (s *Scanner) Scan() ( token.Export, token.True, token.False, token.Undefined: insertSemi = true } - case '0' <= ch && ch <= '9': + case ('0' <= ch && ch <= '9') || (ch == '.' && '0' <= s.peek() && s.peek() <= '9'): insertSemi = true - tok, literal = s.scanNumber(false) + tok, literal = s.scanNumber() default: s.next() // always make progress @@ -125,16 +125,11 @@ func (s *Scanner) Scan() ( case ':': tok = s.switch2(token.Colon, token.Define) case '.': - if '0' <= s.ch && s.ch <= '9' { - insertSemi = true - tok, literal = s.scanNumber(true) - } else { - tok = token.Period - if s.ch == '.' && s.peek() == '.' { - s.next() - s.next() // consume last '.' - tok = token.Ellipsis - } + tok = token.Period + if s.ch == '.' && s.peek() == '.' { + s.next() + s.next() // consume last '.' + tok = token.Ellipsis } case ',': tok = token.Comma @@ -379,86 +374,58 @@ func (s *Scanner) scanIdentifier() string { return string(s.src[offs:s.offset]) } -func (s *Scanner) scanMantissa(base int) { - for digitVal(s.ch) < base { +func (s *Scanner) scanDigits(base int) { + for s.ch == '_' || digitVal(s.ch) < base { s.next() } } -func (s *Scanner) scanNumber( - seenDecimalPoint bool, -) (tok token.Token, lit string) { - // digitVal(s.ch) < 10 +func (s *Scanner) scanNumber() (token.Token, string) { offs := s.offset - tok = token.Int - - defer func() { - lit = string(s.src[offs:s.offset]) - }() - - if seenDecimalPoint { - offs-- - tok = token.Float - s.scanMantissa(10) - goto exponent - } + tok := token.Int + base := 10 - if s.ch == '0' { - // int or float - offs := s.offset + // Determine base + switch { + case s.ch == '0' && lower(s.peek()) == 'b': + base = 2 + s.next() + s.next() + case s.ch == '0' && lower(s.peek()) == 'o': + base = 8 + s.next() + s.next() + case s.ch == '0' && lower(s.peek()) == 'x': + base = 16 + s.next() s.next() - if s.ch == 'x' || s.ch == 'X' { - // hexadecimal int - s.next() - s.scanMantissa(16) - if s.offset-offs <= 2 { - // only scanned "0x" or "0X" - s.error(offs, "illegal hexadecimal number") - } - } else { - // octal int or float - seenDecimalDigit := false - s.scanMantissa(8) - if s.ch == '8' || s.ch == '9' { - // illegal octal int or float - seenDecimalDigit = true - s.scanMantissa(10) - } - if s.ch == '.' || s.ch == 'e' || s.ch == 'E' || s.ch == 'i' { - goto fraction - } - // octal int - if seenDecimalDigit { - s.error(offs, "illegal octal number") - } - } - return } - // decimal int or float - s.scanMantissa(10) + // Scan whole number + s.scanDigits(base) -fraction: - if s.ch == '.' { + // Scan fractional part + if s.ch == '.' && (base == 10 || base == 16) { tok = token.Float s.next() - s.scanMantissa(10) + s.scanDigits(base) } -exponent: - if s.ch == 'e' || s.ch == 'E' { + // Scan exponent + if s.ch == 'e' || s.ch == 'E' || s.ch == 'p' || s.ch == 'P' { tok = token.Float s.next() if s.ch == '-' || s.ch == '+' { s.next() } - if digitVal(s.ch) < 10 { - s.scanMantissa(10) - } else { - s.error(offs, "illegal floating-point exponent") + offs := s.offset + s.scanDigits(10) + if offs == s.offset { + s.error(offs, "exponent has no digits") } } - return + + return tok, string(s.src[offs:s.offset]) } func (s *Scanner) scanEscape(quote rune) bool { @@ -687,3 +654,7 @@ func digitVal(ch rune) int { } return 16 // larger than any legal digit val } + +func lower(c byte) byte { + return c | ('x' - 'X') +} diff --git a/vendor/github.com/gomarkdown/markdown/.gitpod.yml b/vendor/github.com/gomarkdown/markdown/.gitpod.yml new file mode 100644 index 00000000..dde1f1d9 --- /dev/null +++ b/vendor/github.com/gomarkdown/markdown/.gitpod.yml @@ -0,0 +1,9 @@ +# This configuration file was automatically generated by Gitpod. +# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file) +# and commit this file to your remote git repository to share the goodness with others. + +tasks: + - init: go get && go build ./... && go test ./... + command: go run + + diff --git a/vendor/github.com/gomarkdown/markdown/parser/block.go b/vendor/github.com/gomarkdown/markdown/parser/block.go index eeebec73..7c2401f1 100644 --- a/vendor/github.com/gomarkdown/markdown/parser/block.go +++ b/vendor/github.com/gomarkdown/markdown/parser/block.go @@ -1675,6 +1675,12 @@ func (p *Parser) paragraph(data []byte) int { return i } + // if there's a block quote, paragraph is over + if p.quotePrefix(current) > 0 { + p.renderParagraph(data[:i]) + return i + } + // if there's a fenced code block, paragraph is over if p.extensions&FencedCode != 0 { if p.fencedCodeBlock(current, false) > 0 { diff --git a/vendor/github.com/klauspost/compress/.gitignore b/vendor/github.com/klauspost/compress/.gitignore index b35f8449..d31b3781 100644 --- a/vendor/github.com/klauspost/compress/.gitignore +++ b/vendor/github.com/klauspost/compress/.gitignore @@ -23,3 +23,10 @@ _testmain.go *.test *.prof /s2/cmd/_s2sx/sfx-exe + +# Linux perf files +perf.data +perf.data.old + +# gdb history +.gdb_history diff --git a/vendor/github.com/klauspost/compress/README.md b/vendor/github.com/klauspost/compress/README.md index 0e2dc116..5c3c2a25 100644 --- a/vendor/github.com/klauspost/compress/README.md +++ b/vendor/github.com/klauspost/compress/README.md @@ -17,6 +17,41 @@ This package provides various compression algorithms. # changelog +* May 25, 2022 (v1.15.5) + * s2: Add concurrent stream decompression https://github.com/klauspost/compress/pull/602 + * s2: Fix final emit oob read crash on amd64 https://github.com/klauspost/compress/pull/601 + * huff0: asm implementation of Decompress1X by @WojciechMula https://github.com/klauspost/compress/pull/596 + * zstd: Use 1 less goroutine for stream decoding https://github.com/klauspost/compress/pull/588 + * zstd: Copy literal in 16 byte blocks when possible https://github.com/klauspost/compress/pull/592 + * zstd: Speed up when WithDecoderLowmem(false) https://github.com/klauspost/compress/pull/599 + * zstd: faster next state update in BMI2 version of decode by @WojciechMula in https://github.com/klauspost/compress/pull/593 + * huff0: Do not check max size when reading table. https://github.com/klauspost/compress/pull/586 + * flate: Inplace hashing for level 7-9 by @klauspost in https://github.com/klauspost/compress/pull/590 + + +* May 11, 2022 (v1.15.4) + * huff0: decompress directly into output by @WojciechMula in [#577](https://github.com/klauspost/compress/pull/577) + * inflate: Keep dict on stack [#581](https://github.com/klauspost/compress/pull/581) + * zstd: Faster decoding memcopy in asm [#583](https://github.com/klauspost/compress/pull/583) + * zstd: Fix ignored crc [#580](https://github.com/klauspost/compress/pull/580) + +* May 5, 2022 (v1.15.3) + * zstd: Allow to ignore checksum checking by @WojciechMula [#572](https://github.com/klauspost/compress/pull/572) + * s2: Fix incorrect seek for io.SeekEnd in [#575](https://github.com/klauspost/compress/pull/575) + +* Apr 26, 2022 (v1.15.2) + * zstd: Add x86-64 assembly for decompression on streams and blocks. Contributed by [@WojciechMula](https://github.com/WojciechMula). Typically 2x faster. [#528](https://github.com/klauspost/compress/pull/528) [#531](https://github.com/klauspost/compress/pull/531) [#545](https://github.com/klauspost/compress/pull/545) [#537](https://github.com/klauspost/compress/pull/537) + * zstd: Add options to ZipDecompressor and fixes [#539](https://github.com/klauspost/compress/pull/539) + * s2: Use sorted search for index [#555](https://github.com/klauspost/compress/pull/555) + * Minimum version is Go 1.16, added CI test on 1.18. + +* Mar 11, 2022 (v1.15.1) + * huff0: Add x86 assembly of Decode4X by @WojciechMula in [#512](https://github.com/klauspost/compress/pull/512) + * zstd: Reuse zip decoders in [#514](https://github.com/klauspost/compress/pull/514) + * zstd: Detect extra block data and report as corrupted in [#520](https://github.com/klauspost/compress/pull/520) + * zstd: Handle zero sized frame content size stricter in [#521](https://github.com/klauspost/compress/pull/521) + * zstd: Add stricter block size checks in [#523](https://github.com/klauspost/compress/pull/523) + * Mar 3, 2022 (v1.15.0) * zstd: Refactor decoder by @klauspost in [#498](https://github.com/klauspost/compress/pull/498) * zstd: Add stream encoding without goroutines by @klauspost in [#505](https://github.com/klauspost/compress/pull/505) @@ -60,6 +95,9 @@ While the release has been extensively tested, it is recommended to testing when * zstd: add arm64 xxhash assembly in [#464](https://github.com/klauspost/compress/pull/464) * Add garbled for binaries for s2 in [#445](https://github.com/klauspost/compress/pull/445) +
+ See changes to v1.13.x + * Aug 30, 2021 (v1.13.5) * gz/zlib/flate: Alias stdlib errors [#425](https://github.com/klauspost/compress/pull/425) * s2: Add block support to commandline tools [#413](https://github.com/klauspost/compress/pull/413) @@ -88,6 +126,8 @@ While the release has been extensively tested, it is recommended to testing when * Added [gzhttp](https://github.com/klauspost/compress/tree/master/gzhttp#gzip-handler) which allows wrapping HTTP servers and clients with GZIP compressors. * zstd: Detect short invalid signatures [#382](https://github.com/klauspost/compress/pull/382) * zstd: Spawn decoder goroutine only if needed. [#380](https://github.com/klauspost/compress/pull/380) +
+
See changes to v1.12.x diff --git a/vendor/github.com/klauspost/compress/huff0/autogen.go b/vendor/github.com/klauspost/compress/huff0/autogen.go deleted file mode 100644 index ff2c69d6..00000000 --- a/vendor/github.com/klauspost/compress/huff0/autogen.go +++ /dev/null @@ -1,5 +0,0 @@ -package huff0 - -//go:generate go run generate.go -//go:generate asmfmt -w decompress_amd64.s -//go:generate asmfmt -w decompress_8b_amd64.s diff --git a/vendor/github.com/klauspost/compress/huff0/bitreader.go b/vendor/github.com/klauspost/compress/huff0/bitreader.go index 451160ed..504a7be9 100644 --- a/vendor/github.com/klauspost/compress/huff0/bitreader.go +++ b/vendor/github.com/klauspost/compress/huff0/bitreader.go @@ -165,11 +165,6 @@ func (b *bitReaderShifted) peekBitsFast(n uint8) uint16 { return uint16(b.value >> ((64 - n) & 63)) } -// peekTopBits(n) is equvialent to peekBitFast(64 - n) -func (b *bitReaderShifted) peekTopBits(n uint8) uint16 { - return uint16(b.value >> n) -} - func (b *bitReaderShifted) advance(n uint8) { b.bitsRead += n b.value <<= n & 63 @@ -220,11 +215,6 @@ func (b *bitReaderShifted) fill() { } } -// finished returns true if all bits have been read from the bit stream. -func (b *bitReaderShifted) finished() bool { - return b.off == 0 && b.bitsRead >= 64 -} - func (b *bitReaderShifted) remaining() uint { return b.off*8 + uint(64-b.bitsRead) } diff --git a/vendor/github.com/klauspost/compress/huff0/bitwriter.go b/vendor/github.com/klauspost/compress/huff0/bitwriter.go index 6bce4e87..ec71f7a3 100644 --- a/vendor/github.com/klauspost/compress/huff0/bitwriter.go +++ b/vendor/github.com/klauspost/compress/huff0/bitwriter.go @@ -5,8 +5,6 @@ package huff0 -import "fmt" - // bitWriter will write bits. // First bit will be LSB of the first byte of output. type bitWriter struct { @@ -23,14 +21,6 @@ var bitMask16 = [32]uint16{ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF} /* up to 16 bits */ -// addBits16NC will add up to 16 bits. -// It will not check if there is space for them, -// so the caller must ensure that it has flushed recently. -func (b *bitWriter) addBits16NC(value uint16, bits uint8) { - b.bitContainer |= uint64(value&bitMask16[bits&31]) << (b.nBits & 63) - b.nBits += bits -} - // addBits16Clean will add up to 16 bits. value may not contain more set bits than indicated. // It will not check if there is space for them, so the caller must ensure that it has flushed recently. func (b *bitWriter) addBits16Clean(value uint16, bits uint8) { @@ -70,104 +60,6 @@ func (b *bitWriter) encTwoSymbols(ct cTable, av, bv byte) { b.nBits += encA.nBits + encB.nBits } -// addBits16ZeroNC will add up to 16 bits. -// It will not check if there is space for them, -// so the caller must ensure that it has flushed recently. -// This is fastest if bits can be zero. -func (b *bitWriter) addBits16ZeroNC(value uint16, bits uint8) { - if bits == 0 { - return - } - value <<= (16 - bits) & 15 - value >>= (16 - bits) & 15 - b.bitContainer |= uint64(value) << (b.nBits & 63) - b.nBits += bits -} - -// flush will flush all pending full bytes. -// There will be at least 56 bits available for writing when this has been called. -// Using flush32 is faster, but leaves less space for writing. -func (b *bitWriter) flush() { - v := b.nBits >> 3 - switch v { - case 0: - return - case 1: - b.out = append(b.out, - byte(b.bitContainer), - ) - b.bitContainer >>= 1 << 3 - case 2: - b.out = append(b.out, - byte(b.bitContainer), - byte(b.bitContainer>>8), - ) - b.bitContainer >>= 2 << 3 - case 3: - b.out = append(b.out, - byte(b.bitContainer), - byte(b.bitContainer>>8), - byte(b.bitContainer>>16), - ) - b.bitContainer >>= 3 << 3 - case 4: - b.out = append(b.out, - byte(b.bitContainer), - byte(b.bitContainer>>8), - byte(b.bitContainer>>16), - byte(b.bitContainer>>24), - ) - b.bitContainer >>= 4 << 3 - case 5: - b.out = append(b.out, - byte(b.bitContainer), - byte(b.bitContainer>>8), - byte(b.bitContainer>>16), - byte(b.bitContainer>>24), - byte(b.bitContainer>>32), - ) - b.bitContainer >>= 5 << 3 - case 6: - b.out = append(b.out, - byte(b.bitContainer), - byte(b.bitContainer>>8), - byte(b.bitContainer>>16), - byte(b.bitContainer>>24), - byte(b.bitContainer>>32), - byte(b.bitContainer>>40), - ) - b.bitContainer >>= 6 << 3 - case 7: - b.out = append(b.out, - byte(b.bitContainer), - byte(b.bitContainer>>8), - byte(b.bitContainer>>16), - byte(b.bitContainer>>24), - byte(b.bitContainer>>32), - byte(b.bitContainer>>40), - byte(b.bitContainer>>48), - ) - b.bitContainer >>= 7 << 3 - case 8: - b.out = append(b.out, - byte(b.bitContainer), - byte(b.bitContainer>>8), - byte(b.bitContainer>>16), - byte(b.bitContainer>>24), - byte(b.bitContainer>>32), - byte(b.bitContainer>>40), - byte(b.bitContainer>>48), - byte(b.bitContainer>>56), - ) - b.bitContainer = 0 - b.nBits = 0 - return - default: - panic(fmt.Errorf("bits (%d) > 64", b.nBits)) - } - b.nBits &= 7 -} - // flush32 will flush out, so there are at least 32 bits available for writing. func (b *bitWriter) flush32() { if b.nBits < 32 { @@ -201,10 +93,3 @@ func (b *bitWriter) close() error { b.flushAlign() return nil } - -// reset and continue writing by appending to out. -func (b *bitWriter) reset(out []byte) { - b.bitContainer = 0 - b.nBits = 0 - b.out = out -} diff --git a/vendor/github.com/klauspost/compress/huff0/bytereader.go b/vendor/github.com/klauspost/compress/huff0/bytereader.go index 50bcdf6e..4dcab8d2 100644 --- a/vendor/github.com/klauspost/compress/huff0/bytereader.go +++ b/vendor/github.com/klauspost/compress/huff0/bytereader.go @@ -20,11 +20,6 @@ func (b *byteReader) init(in []byte) { b.off = 0 } -// advance the stream b n bytes. -func (b *byteReader) advance(n uint) { - b.off += int(n) -} - // Int32 returns a little endian int32 starting at current offset. func (b byteReader) Int32() int32 { v3 := int32(b.b[b.off+3]) @@ -43,11 +38,6 @@ func (b byteReader) Uint32() uint32 { return (v3 << 24) | (v2 << 16) | (v1 << 8) | v0 } -// unread returns the unread portion of the input. -func (b byteReader) unread() []byte { - return b.b[b.off:] -} - // remain will return the number of bytes remaining. func (b byteReader) remain() int { return len(b.b) - b.off diff --git a/vendor/github.com/klauspost/compress/huff0/compress.go b/vendor/github.com/klauspost/compress/huff0/compress.go index bc95ac62..4d14542f 100644 --- a/vendor/github.com/klauspost/compress/huff0/compress.go +++ b/vendor/github.com/klauspost/compress/huff0/compress.go @@ -404,6 +404,7 @@ func (s *Scratch) canUseTable(c cTable) bool { return true } +//lint:ignore U1000 used for debugging func (s *Scratch) validateTable(c cTable) bool { if len(c) < int(s.symbolLen) { return false diff --git a/vendor/github.com/klauspost/compress/huff0/decompress.go b/vendor/github.com/klauspost/compress/huff0/decompress.go index 04f65299..c0c48bd7 100644 --- a/vendor/github.com/klauspost/compress/huff0/decompress.go +++ b/vendor/github.com/klauspost/compress/huff0/decompress.go @@ -11,7 +11,6 @@ import ( type dTable struct { single []dEntrySingle - double []dEntryDouble } // single-symbols decoding @@ -19,13 +18,6 @@ type dEntrySingle struct { entry uint16 } -// double-symbols decoding -type dEntryDouble struct { - seq [4]byte - nBits uint8 - len uint8 -} - // Uses special code for all tables that are < 8 bits. const use8BitTables = true @@ -35,7 +27,7 @@ const use8BitTables = true // If no Scratch is provided a new one is allocated. // The returned Scratch can be used for encoding or decoding input using this table. func ReadTable(in []byte, s *Scratch) (s2 *Scratch, remain []byte, err error) { - s, err = s.prepare(in) + s, err = s.prepare(nil) if err != nil { return s, nil, err } @@ -236,108 +228,6 @@ func (d *Decoder) buffer() *[4][256]byte { return &[4][256]byte{} } -// Decompress1X will decompress a 1X encoded stream. -// The cap of the output buffer will be the maximum decompressed size. -// The length of the supplied input must match the end of a block exactly. -func (d *Decoder) Decompress1X(dst, src []byte) ([]byte, error) { - if len(d.dt.single) == 0 { - return nil, errors.New("no table loaded") - } - if use8BitTables && d.actualTableLog <= 8 { - return d.decompress1X8Bit(dst, src) - } - var br bitReaderShifted - err := br.init(src) - if err != nil { - return dst, err - } - maxDecodedSize := cap(dst) - dst = dst[:0] - - // Avoid bounds check by always having full sized table. - const tlSize = 1 << tableLogMax - const tlMask = tlSize - 1 - dt := d.dt.single[:tlSize] - - // Use temp table to avoid bound checks/append penalty. - bufs := d.buffer() - buf := &bufs[0] - var off uint8 - - for br.off >= 8 { - br.fillFast() - v := dt[br.peekBitsFast(d.actualTableLog)&tlMask] - br.advance(uint8(v.entry)) - buf[off+0] = uint8(v.entry >> 8) - - v = dt[br.peekBitsFast(d.actualTableLog)&tlMask] - br.advance(uint8(v.entry)) - buf[off+1] = uint8(v.entry >> 8) - - // Refill - br.fillFast() - - v = dt[br.peekBitsFast(d.actualTableLog)&tlMask] - br.advance(uint8(v.entry)) - buf[off+2] = uint8(v.entry >> 8) - - v = dt[br.peekBitsFast(d.actualTableLog)&tlMask] - br.advance(uint8(v.entry)) - buf[off+3] = uint8(v.entry >> 8) - - off += 4 - if off == 0 { - if len(dst)+256 > maxDecodedSize { - br.close() - d.bufs.Put(bufs) - return nil, ErrMaxDecodedSizeExceeded - } - dst = append(dst, buf[:]...) - } - } - - if len(dst)+int(off) > maxDecodedSize { - d.bufs.Put(bufs) - br.close() - return nil, ErrMaxDecodedSizeExceeded - } - dst = append(dst, buf[:off]...) - - // br < 8, so uint8 is fine - bitsLeft := uint8(br.off)*8 + 64 - br.bitsRead - for bitsLeft > 0 { - br.fill() - if false && br.bitsRead >= 32 { - if br.off >= 4 { - v := br.in[br.off-4:] - v = v[:4] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - br.value = (br.value << 32) | uint64(low) - br.bitsRead -= 32 - br.off -= 4 - } else { - for br.off > 0 { - br.value = (br.value << 8) | uint64(br.in[br.off-1]) - br.bitsRead -= 8 - br.off-- - } - } - } - if len(dst) >= maxDecodedSize { - d.bufs.Put(bufs) - br.close() - return nil, ErrMaxDecodedSizeExceeded - } - v := d.dt.single[br.peekBitsFast(d.actualTableLog)&tlMask] - nBits := uint8(v.entry) - br.advance(nBits) - bitsLeft -= nBits - dst = append(dst, uint8(v.entry>>8)) - } - d.bufs.Put(bufs) - return dst, br.close() -} - // decompress1X8Bit will decompress a 1X encoded stream with tablelog <= 8. // The cap of the output buffer will be the maximum decompressed size. // The length of the supplied input must match the end of a block exactly. @@ -995,7 +885,6 @@ func (d *Decoder) decompress4X8bitExactly(dst, src []byte) ([]byte, error) { const shift = 56 const tlSize = 1 << 8 - const tlMask = tlSize - 1 single := d.dt.single[:tlSize] // Use temp table to avoid bound checks/append penalty. diff --git a/vendor/github.com/klauspost/compress/huff0/decompress_8b_amd64.s b/vendor/github.com/klauspost/compress/huff0/decompress_8b_amd64.s deleted file mode 100644 index 0d6cb1a9..00000000 --- a/vendor/github.com/klauspost/compress/huff0/decompress_8b_amd64.s +++ /dev/null @@ -1,488 +0,0 @@ -// +build !appengine -// +build gc -// +build !noasm - -#include "textflag.h" -#include "funcdata.h" -#include "go_asm.h" - -#define bufoff 256 // see decompress.go, we're using [4][256]byte table - -// func decompress4x_main_loop_x86(pbr0, pbr1, pbr2, pbr3 *bitReaderShifted, -// peekBits uint8, buf *byte, tbl *dEntrySingle) (int, bool) -TEXT ·decompress4x_8b_loop_x86(SB), NOSPLIT, $8 -#define off R8 -#define buffer DI -#define table SI - -#define br_bits_read R9 -#define br_value R10 -#define br_offset R11 -#define peek_bits R12 -#define exhausted DX - -#define br0 R13 -#define br1 R14 -#define br2 R15 -#define br3 BP - - MOVQ BP, 0(SP) - - XORQ exhausted, exhausted // exhausted = false - XORQ off, off // off = 0 - - MOVBQZX peekBits+32(FP), peek_bits - MOVQ buf+40(FP), buffer - MOVQ tbl+48(FP), table - - MOVQ pbr0+0(FP), br0 - MOVQ pbr1+8(FP), br1 - MOVQ pbr2+16(FP), br2 - MOVQ pbr3+24(FP), br3 - -main_loop: - - // const stream = 0 - // br0.fillFast() - MOVBQZX bitReaderShifted_bitsRead(br0), br_bits_read - MOVQ bitReaderShifted_value(br0), br_value - MOVQ bitReaderShifted_off(br0), br_offset - - // if b.bitsRead >= 32 { - CMPQ br_bits_read, $32 - JB skip_fill0 - - SUBQ $32, br_bits_read // b.bitsRead -= 32 - SUBQ $4, br_offset // b.off -= 4 - - // v := b.in[b.off-4 : b.off] - // v = v[:4] - // low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - MOVQ bitReaderShifted_in(br0), AX - MOVL 0(br_offset)(AX*1), AX // AX = uint32(b.in[b.off:b.off+4]) - - // b.value |= uint64(low) << (b.bitsRead & 63) - MOVQ br_bits_read, CX - SHLQ CL, AX - ORQ AX, br_value - - // exhausted = exhausted || (br0.off < 4) - CMPQ br_offset, $4 - SETLT DL - ORB DL, DH - - // } -skip_fill0: - - // val0 := br0.peekTopBits(peekBits) - MOVQ br_value, AX - MOVQ peek_bits, CX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - - // v0 := table[val0&mask] - MOVW 0(table)(AX*2), AX // AX - v0 - - // br0.advance(uint8(v0.entry)) - MOVB AH, BL // BL = uint8(v0.entry >> 8) - MOVBQZX AL, CX - SHLQ CL, br_value // value <<= n - ADDQ CX, br_bits_read // bits_read += n - - // val1 := br0.peekTopBits(peekBits) - MOVQ peek_bits, CX - MOVQ br_value, AX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - - // v1 := table[val1&mask] - MOVW 0(table)(AX*2), AX // AX - v1 - - // br0.advance(uint8(v1.entry)) - MOVB AH, BH // BH = uint8(v1.entry >> 8) - MOVBQZX AL, CX - SHLQ CX, br_value // value <<= n - ADDQ CX, br_bits_read // bits_read += n - - // these two writes get coalesced - // buf[stream][off] = uint8(v0.entry >> 8) - // buf[stream][off+1] = uint8(v1.entry >> 8) - MOVW BX, 0(buffer)(off*1) - - // SECOND PART: - // val2 := br0.peekTopBits(peekBits) - MOVQ br_value, AX - MOVQ peek_bits, CX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - - // v2 := table[val0&mask] - MOVW 0(table)(AX*2), AX // AX - v0 - - // br0.advance(uint8(v0.entry)) - MOVB AH, BL // BL = uint8(v0.entry >> 8) - MOVBQZX AL, CX - SHLQ CL, br_value // value <<= n - ADDQ CX, br_bits_read // bits_read += n - - // val3 := br0.peekTopBits(peekBits) - MOVQ peek_bits, CX - MOVQ br_value, AX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - - // v3 := table[val1&mask] - MOVW 0(table)(AX*2), AX // AX - v1 - - // br0.advance(uint8(v1.entry)) - MOVB AH, BH // BH = uint8(v1.entry >> 8) - MOVBQZX AL, CX - SHLQ CX, br_value // value <<= n - ADDQ CX, br_bits_read // bits_read += n - - // these two writes get coalesced - // buf[stream][off+2] = uint8(v2.entry >> 8) - // buf[stream][off+3] = uint8(v3.entry >> 8) - MOVW BX, 0+2(buffer)(off*1) - - // update the bitrader reader structure - MOVB br_bits_read, bitReaderShifted_bitsRead(br0) - MOVQ br_value, bitReaderShifted_value(br0) - MOVQ br_offset, bitReaderShifted_off(br0) - - // const stream = 1 - // br1.fillFast() - MOVBQZX bitReaderShifted_bitsRead(br1), br_bits_read - MOVQ bitReaderShifted_value(br1), br_value - MOVQ bitReaderShifted_off(br1), br_offset - - // if b.bitsRead >= 32 { - CMPQ br_bits_read, $32 - JB skip_fill1 - - SUBQ $32, br_bits_read // b.bitsRead -= 32 - SUBQ $4, br_offset // b.off -= 4 - - // v := b.in[b.off-4 : b.off] - // v = v[:4] - // low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - MOVQ bitReaderShifted_in(br1), AX - MOVL 0(br_offset)(AX*1), AX // AX = uint32(b.in[b.off:b.off+4]) - - // b.value |= uint64(low) << (b.bitsRead & 63) - MOVQ br_bits_read, CX - SHLQ CL, AX - ORQ AX, br_value - - // exhausted = exhausted || (br1.off < 4) - CMPQ br_offset, $4 - SETLT DL - ORB DL, DH - - // } -skip_fill1: - - // val0 := br1.peekTopBits(peekBits) - MOVQ br_value, AX - MOVQ peek_bits, CX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - - // v0 := table[val0&mask] - MOVW 0(table)(AX*2), AX // AX - v0 - - // br1.advance(uint8(v0.entry)) - MOVB AH, BL // BL = uint8(v0.entry >> 8) - MOVBQZX AL, CX - SHLQ CL, br_value // value <<= n - ADDQ CX, br_bits_read // bits_read += n - - // val1 := br1.peekTopBits(peekBits) - MOVQ peek_bits, CX - MOVQ br_value, AX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - - // v1 := table[val1&mask] - MOVW 0(table)(AX*2), AX // AX - v1 - - // br1.advance(uint8(v1.entry)) - MOVB AH, BH // BH = uint8(v1.entry >> 8) - MOVBQZX AL, CX - SHLQ CX, br_value // value <<= n - ADDQ CX, br_bits_read // bits_read += n - - // these two writes get coalesced - // buf[stream][off] = uint8(v0.entry >> 8) - // buf[stream][off+1] = uint8(v1.entry >> 8) - MOVW BX, 256(buffer)(off*1) - - // SECOND PART: - // val2 := br1.peekTopBits(peekBits) - MOVQ br_value, AX - MOVQ peek_bits, CX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - - // v2 := table[val0&mask] - MOVW 0(table)(AX*2), AX // AX - v0 - - // br1.advance(uint8(v0.entry)) - MOVB AH, BL // BL = uint8(v0.entry >> 8) - MOVBQZX AL, CX - SHLQ CL, br_value // value <<= n - ADDQ CX, br_bits_read // bits_read += n - - // val3 := br1.peekTopBits(peekBits) - MOVQ peek_bits, CX - MOVQ br_value, AX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - - // v3 := table[val1&mask] - MOVW 0(table)(AX*2), AX // AX - v1 - - // br1.advance(uint8(v1.entry)) - MOVB AH, BH // BH = uint8(v1.entry >> 8) - MOVBQZX AL, CX - SHLQ CX, br_value // value <<= n - ADDQ CX, br_bits_read // bits_read += n - - // these two writes get coalesced - // buf[stream][off+2] = uint8(v2.entry >> 8) - // buf[stream][off+3] = uint8(v3.entry >> 8) - MOVW BX, 256+2(buffer)(off*1) - - // update the bitrader reader structure - MOVB br_bits_read, bitReaderShifted_bitsRead(br1) - MOVQ br_value, bitReaderShifted_value(br1) - MOVQ br_offset, bitReaderShifted_off(br1) - - // const stream = 2 - // br2.fillFast() - MOVBQZX bitReaderShifted_bitsRead(br2), br_bits_read - MOVQ bitReaderShifted_value(br2), br_value - MOVQ bitReaderShifted_off(br2), br_offset - - // if b.bitsRead >= 32 { - CMPQ br_bits_read, $32 - JB skip_fill2 - - SUBQ $32, br_bits_read // b.bitsRead -= 32 - SUBQ $4, br_offset // b.off -= 4 - - // v := b.in[b.off-4 : b.off] - // v = v[:4] - // low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - MOVQ bitReaderShifted_in(br2), AX - MOVL 0(br_offset)(AX*1), AX // AX = uint32(b.in[b.off:b.off+4]) - - // b.value |= uint64(low) << (b.bitsRead & 63) - MOVQ br_bits_read, CX - SHLQ CL, AX - ORQ AX, br_value - - // exhausted = exhausted || (br2.off < 4) - CMPQ br_offset, $4 - SETLT DL - ORB DL, DH - - // } -skip_fill2: - - // val0 := br2.peekTopBits(peekBits) - MOVQ br_value, AX - MOVQ peek_bits, CX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - - // v0 := table[val0&mask] - MOVW 0(table)(AX*2), AX // AX - v0 - - // br2.advance(uint8(v0.entry)) - MOVB AH, BL // BL = uint8(v0.entry >> 8) - MOVBQZX AL, CX - SHLQ CL, br_value // value <<= n - ADDQ CX, br_bits_read // bits_read += n - - // val1 := br2.peekTopBits(peekBits) - MOVQ peek_bits, CX - MOVQ br_value, AX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - - // v1 := table[val1&mask] - MOVW 0(table)(AX*2), AX // AX - v1 - - // br2.advance(uint8(v1.entry)) - MOVB AH, BH // BH = uint8(v1.entry >> 8) - MOVBQZX AL, CX - SHLQ CX, br_value // value <<= n - ADDQ CX, br_bits_read // bits_read += n - - // these two writes get coalesced - // buf[stream][off] = uint8(v0.entry >> 8) - // buf[stream][off+1] = uint8(v1.entry >> 8) - MOVW BX, 512(buffer)(off*1) - - // SECOND PART: - // val2 := br2.peekTopBits(peekBits) - MOVQ br_value, AX - MOVQ peek_bits, CX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - - // v2 := table[val0&mask] - MOVW 0(table)(AX*2), AX // AX - v0 - - // br2.advance(uint8(v0.entry)) - MOVB AH, BL // BL = uint8(v0.entry >> 8) - MOVBQZX AL, CX - SHLQ CL, br_value // value <<= n - ADDQ CX, br_bits_read // bits_read += n - - // val3 := br2.peekTopBits(peekBits) - MOVQ peek_bits, CX - MOVQ br_value, AX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - - // v3 := table[val1&mask] - MOVW 0(table)(AX*2), AX // AX - v1 - - // br2.advance(uint8(v1.entry)) - MOVB AH, BH // BH = uint8(v1.entry >> 8) - MOVBQZX AL, CX - SHLQ CX, br_value // value <<= n - ADDQ CX, br_bits_read // bits_read += n - - // these two writes get coalesced - // buf[stream][off+2] = uint8(v2.entry >> 8) - // buf[stream][off+3] = uint8(v3.entry >> 8) - MOVW BX, 512+2(buffer)(off*1) - - // update the bitrader reader structure - MOVB br_bits_read, bitReaderShifted_bitsRead(br2) - MOVQ br_value, bitReaderShifted_value(br2) - MOVQ br_offset, bitReaderShifted_off(br2) - - // const stream = 3 - // br3.fillFast() - MOVBQZX bitReaderShifted_bitsRead(br3), br_bits_read - MOVQ bitReaderShifted_value(br3), br_value - MOVQ bitReaderShifted_off(br3), br_offset - - // if b.bitsRead >= 32 { - CMPQ br_bits_read, $32 - JB skip_fill3 - - SUBQ $32, br_bits_read // b.bitsRead -= 32 - SUBQ $4, br_offset // b.off -= 4 - - // v := b.in[b.off-4 : b.off] - // v = v[:4] - // low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - MOVQ bitReaderShifted_in(br3), AX - MOVL 0(br_offset)(AX*1), AX // AX = uint32(b.in[b.off:b.off+4]) - - // b.value |= uint64(low) << (b.bitsRead & 63) - MOVQ br_bits_read, CX - SHLQ CL, AX - ORQ AX, br_value - - // exhausted = exhausted || (br3.off < 4) - CMPQ br_offset, $4 - SETLT DL - ORB DL, DH - - // } -skip_fill3: - - // val0 := br3.peekTopBits(peekBits) - MOVQ br_value, AX - MOVQ peek_bits, CX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - - // v0 := table[val0&mask] - MOVW 0(table)(AX*2), AX // AX - v0 - - // br3.advance(uint8(v0.entry)) - MOVB AH, BL // BL = uint8(v0.entry >> 8) - MOVBQZX AL, CX - SHLQ CL, br_value // value <<= n - ADDQ CX, br_bits_read // bits_read += n - - // val1 := br3.peekTopBits(peekBits) - MOVQ peek_bits, CX - MOVQ br_value, AX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - - // v1 := table[val1&mask] - MOVW 0(table)(AX*2), AX // AX - v1 - - // br3.advance(uint8(v1.entry)) - MOVB AH, BH // BH = uint8(v1.entry >> 8) - MOVBQZX AL, CX - SHLQ CX, br_value // value <<= n - ADDQ CX, br_bits_read // bits_read += n - - // these two writes get coalesced - // buf[stream][off] = uint8(v0.entry >> 8) - // buf[stream][off+1] = uint8(v1.entry >> 8) - MOVW BX, 768(buffer)(off*1) - - // SECOND PART: - // val2 := br3.peekTopBits(peekBits) - MOVQ br_value, AX - MOVQ peek_bits, CX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - - // v2 := table[val0&mask] - MOVW 0(table)(AX*2), AX // AX - v0 - - // br3.advance(uint8(v0.entry)) - MOVB AH, BL // BL = uint8(v0.entry >> 8) - MOVBQZX AL, CX - SHLQ CL, br_value // value <<= n - ADDQ CX, br_bits_read // bits_read += n - - // val3 := br3.peekTopBits(peekBits) - MOVQ peek_bits, CX - MOVQ br_value, AX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - - // v3 := table[val1&mask] - MOVW 0(table)(AX*2), AX // AX - v1 - - // br3.advance(uint8(v1.entry)) - MOVB AH, BH // BH = uint8(v1.entry >> 8) - MOVBQZX AL, CX - SHLQ CX, br_value // value <<= n - ADDQ CX, br_bits_read // bits_read += n - - // these two writes get coalesced - // buf[stream][off+2] = uint8(v2.entry >> 8) - // buf[stream][off+3] = uint8(v3.entry >> 8) - MOVW BX, 768+2(buffer)(off*1) - - // update the bitrader reader structure - MOVB br_bits_read, bitReaderShifted_bitsRead(br3) - MOVQ br_value, bitReaderShifted_value(br3) - MOVQ br_offset, bitReaderShifted_off(br3) - - ADDQ $4, off // off += 2 - - TESTB DH, DH // any br[i].ofs < 4? - JNZ end - - CMPQ off, $bufoff - JL main_loop - -end: - MOVQ 0(SP), BP - - MOVB off, ret+56(FP) - RET - -#undef off -#undef buffer -#undef table - -#undef br_bits_read -#undef br_value -#undef br_offset -#undef peek_bits -#undef exhausted - -#undef br0 -#undef br1 -#undef br2 -#undef br3 diff --git a/vendor/github.com/klauspost/compress/huff0/decompress_8b_amd64.s.in b/vendor/github.com/klauspost/compress/huff0/decompress_8b_amd64.s.in deleted file mode 100644 index 6d477a2c..00000000 --- a/vendor/github.com/klauspost/compress/huff0/decompress_8b_amd64.s.in +++ /dev/null @@ -1,197 +0,0 @@ -// +build !appengine -// +build gc -// +build !noasm - -#include "textflag.h" -#include "funcdata.h" -#include "go_asm.h" - - -#define bufoff 256 // see decompress.go, we're using [4][256]byte table - -//func decompress4x_main_loop_x86(pbr0, pbr1, pbr2, pbr3 *bitReaderShifted, -// peekBits uint8, buf *byte, tbl *dEntrySingle) (int, bool) -TEXT ·decompress4x_8b_loop_x86(SB), NOSPLIT, $8 -#define off R8 -#define buffer DI -#define table SI - -#define br_bits_read R9 -#define br_value R10 -#define br_offset R11 -#define peek_bits R12 -#define exhausted DX - -#define br0 R13 -#define br1 R14 -#define br2 R15 -#define br3 BP - - MOVQ BP, 0(SP) - - XORQ exhausted, exhausted // exhausted = false - XORQ off, off // off = 0 - - MOVBQZX peekBits+32(FP), peek_bits - MOVQ buf+40(FP), buffer - MOVQ tbl+48(FP), table - - MOVQ pbr0+0(FP), br0 - MOVQ pbr1+8(FP), br1 - MOVQ pbr2+16(FP), br2 - MOVQ pbr3+24(FP), br3 - -main_loop: -{{ define "decode_2_values_x86" }} - // const stream = {{ var "id" }} - // br{{ var "id"}}.fillFast() - MOVBQZX bitReaderShifted_bitsRead(br{{ var "id" }}), br_bits_read - MOVQ bitReaderShifted_value(br{{ var "id" }}), br_value - MOVQ bitReaderShifted_off(br{{ var "id" }}), br_offset - - // if b.bitsRead >= 32 { - CMPQ br_bits_read, $32 - JB skip_fill{{ var "id" }} - - SUBQ $32, br_bits_read // b.bitsRead -= 32 - SUBQ $4, br_offset // b.off -= 4 - - // v := b.in[b.off-4 : b.off] - // v = v[:4] - // low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - MOVQ bitReaderShifted_in(br{{ var "id" }}), AX - MOVL 0(br_offset)(AX*1), AX // AX = uint32(b.in[b.off:b.off+4]) - - // b.value |= uint64(low) << (b.bitsRead & 63) - MOVQ br_bits_read, CX - SHLQ CL, AX - ORQ AX, br_value - - // exhausted = exhausted || (br{{ var "id"}}.off < 4) - CMPQ br_offset, $4 - SETLT DL - ORB DL, DH - // } -skip_fill{{ var "id" }}: - - // val0 := br{{ var "id"}}.peekTopBits(peekBits) - MOVQ br_value, AX - MOVQ peek_bits, CX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - - // v0 := table[val0&mask] - MOVW 0(table)(AX*2), AX // AX - v0 - - // br{{ var "id"}}.advance(uint8(v0.entry)) - MOVB AH, BL // BL = uint8(v0.entry >> 8) - MOVBQZX AL, CX - SHLQ CL, br_value // value <<= n - ADDQ CX, br_bits_read // bits_read += n - - // val1 := br{{ var "id"}}.peekTopBits(peekBits) - MOVQ peek_bits, CX - MOVQ br_value, AX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - - // v1 := table[val1&mask] - MOVW 0(table)(AX*2), AX // AX - v1 - - // br{{ var "id"}}.advance(uint8(v1.entry)) - MOVB AH, BH // BH = uint8(v1.entry >> 8) - MOVBQZX AL, CX - SHLQ CX, br_value // value <<= n - ADDQ CX, br_bits_read // bits_read += n - - - // these two writes get coalesced - // buf[stream][off] = uint8(v0.entry >> 8) - // buf[stream][off+1] = uint8(v1.entry >> 8) - MOVW BX, {{ var "bufofs" }}(buffer)(off*1) - - // SECOND PART: - // val2 := br{{ var "id"}}.peekTopBits(peekBits) - MOVQ br_value, AX - MOVQ peek_bits, CX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - - // v2 := table[val0&mask] - MOVW 0(table)(AX*2), AX // AX - v0 - - // br{{ var "id"}}.advance(uint8(v0.entry)) - MOVB AH, BL // BL = uint8(v0.entry >> 8) - MOVBQZX AL, CX - SHLQ CL, br_value // value <<= n - ADDQ CX, br_bits_read // bits_read += n - - // val3 := br{{ var "id"}}.peekTopBits(peekBits) - MOVQ peek_bits, CX - MOVQ br_value, AX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - - // v3 := table[val1&mask] - MOVW 0(table)(AX*2), AX // AX - v1 - - // br{{ var "id"}}.advance(uint8(v1.entry)) - MOVB AH, BH // BH = uint8(v1.entry >> 8) - MOVBQZX AL, CX - SHLQ CX, br_value // value <<= n - ADDQ CX, br_bits_read // bits_read += n - - - // these two writes get coalesced - // buf[stream][off+2] = uint8(v2.entry >> 8) - // buf[stream][off+3] = uint8(v3.entry >> 8) - MOVW BX, {{ var "bufofs" }}+2(buffer)(off*1) - - // update the bitrader reader structure - MOVB br_bits_read, bitReaderShifted_bitsRead(br{{ var "id" }}) - MOVQ br_value, bitReaderShifted_value(br{{ var "id" }}) - MOVQ br_offset, bitReaderShifted_off(br{{ var "id" }}) -{{ end }} - - {{ set "id" "0" }} - {{ set "ofs" "0" }} - {{ set "bufofs" "0" }} {{/* id * bufoff */}} - {{ template "decode_2_values_x86" . }} - - {{ set "id" "1" }} - {{ set "ofs" "8" }} - {{ set "bufofs" "256" }} - {{ template "decode_2_values_x86" . }} - - {{ set "id" "2" }} - {{ set "ofs" "16" }} - {{ set "bufofs" "512" }} - {{ template "decode_2_values_x86" . }} - - {{ set "id" "3" }} - {{ set "ofs" "24" }} - {{ set "bufofs" "768" }} - {{ template "decode_2_values_x86" . }} - - ADDQ $4, off // off += 2 - - TESTB DH, DH // any br[i].ofs < 4? - JNZ end - - CMPQ off, $bufoff - JL main_loop -end: - MOVQ 0(SP), BP - - MOVB off, ret+56(FP) - RET -#undef off -#undef buffer -#undef table - -#undef br_bits_read -#undef br_value -#undef br_offset -#undef peek_bits -#undef exhausted - -#undef br0 -#undef br1 -#undef br2 -#undef br3 diff --git a/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go index d47f6644..671e630a 100644 --- a/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go +++ b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go @@ -2,30 +2,43 @@ // +build amd64,!appengine,!noasm,gc // This file contains the specialisation of Decoder.Decompress4X -// that uses an asm implementation of its main loop. +// and Decoder.Decompress1X that use an asm implementation of thir main loops. package huff0 import ( "errors" "fmt" + + "github.com/klauspost/compress/internal/cpuinfo" ) // decompress4x_main_loop_x86 is an x86 assembler implementation // of Decompress4X when tablelog > 8. -// go:noescape -func decompress4x_main_loop_x86(pbr0, pbr1, pbr2, pbr3 *bitReaderShifted, - peekBits uint8, buf *byte, tbl *dEntrySingle) uint8 +//go:noescape +func decompress4x_main_loop_amd64(ctx *decompress4xContext) // decompress4x_8b_loop_x86 is an x86 assembler implementation // of Decompress4X when tablelog <= 8 which decodes 4 entries // per loop. -// go:noescape -func decompress4x_8b_loop_x86(pbr0, pbr1, pbr2, pbr3 *bitReaderShifted, - peekBits uint8, buf *byte, tbl *dEntrySingle) uint8 +//go:noescape +func decompress4x_8b_main_loop_amd64(ctx *decompress4xContext) // fallback8BitSize is the size where using Go version is faster. const fallback8BitSize = 800 +type decompress4xContext struct { + pbr0 *bitReaderShifted + pbr1 *bitReaderShifted + pbr2 *bitReaderShifted + pbr3 *bitReaderShifted + peekBits uint8 + out *byte + dstEvery int + tbl *dEntrySingle + decoded int + limit *byte +} + // Decompress4X will decompress a 4X encoded stream. // The length of the supplied input must match the end of a block exactly. // The *capacity* of the dst slice must match the destination size of @@ -42,6 +55,7 @@ func (d *Decoder) Decompress4X(dst, src []byte) ([]byte, error) { if cap(dst) < fallback8BitSize && use8BitTables { return d.decompress4X8bit(dst, src) } + var br [4]bitReaderShifted // Decode "jump table" start := 6 @@ -71,70 +85,28 @@ func (d *Decoder) Decompress4X(dst, src []byte) ([]byte, error) { const tlMask = tlSize - 1 single := d.dt.single[:tlSize] - // Use temp table to avoid bound checks/append penalty. - buf := d.buffer() - var off uint8 var decoded int - const debug = false - - // see: bitReaderShifted.peekBitsFast() - peekBits := uint8((64 - d.actualTableLog) & 63) - - // Decode 2 values from each decoder/loop. - const bufoff = 256 - for { - if br[0].off < 4 || br[1].off < 4 || br[2].off < 4 || br[3].off < 4 { - break + if len(out) > 4*4 && !(br[0].off < 4 || br[1].off < 4 || br[2].off < 4 || br[3].off < 4) { + ctx := decompress4xContext{ + pbr0: &br[0], + pbr1: &br[1], + pbr2: &br[2], + pbr3: &br[3], + peekBits: uint8((64 - d.actualTableLog) & 63), // see: bitReaderShifted.peekBitsFast() + out: &out[0], + dstEvery: dstEvery, + tbl: &single[0], + limit: &out[dstEvery-4], // Always stop decoding when first buffer gets here to avoid writing OOB on last. } - if use8BitTables { - off = decompress4x_8b_loop_x86(&br[0], &br[1], &br[2], &br[3], peekBits, &buf[0][0], &single[0]) + decompress4x_8b_main_loop_amd64(&ctx) } else { - off = decompress4x_main_loop_x86(&br[0], &br[1], &br[2], &br[3], peekBits, &buf[0][0], &single[0]) - } - if debug { - fmt.Print("DEBUG: ") - fmt.Printf("off=%d,", off) - for i := 0; i < 4; i++ { - fmt.Printf(" br[%d]={bitsRead=%d, value=%x, off=%d}", - i, br[i].bitsRead, br[i].value, br[i].off) - } - fmt.Println("") - } - - if off != 0 { - break + decompress4x_main_loop_amd64(&ctx) } - if bufoff > dstEvery { - d.bufs.Put(buf) - return nil, errors.New("corruption detected: stream overrun 1") - } - copy(out, buf[0][:]) - copy(out[dstEvery:], buf[1][:]) - copy(out[dstEvery*2:], buf[2][:]) - copy(out[dstEvery*3:], buf[3][:]) - out = out[bufoff:] - decoded += bufoff * 4 - // There must at least be 3 buffers left. - if len(out) < dstEvery*3 { - d.bufs.Put(buf) - return nil, errors.New("corruption detected: stream overrun 2") - } - } - if off > 0 { - ioff := int(off) - if len(out) < dstEvery*3+ioff { - d.bufs.Put(buf) - return nil, errors.New("corruption detected: stream overrun 3") - } - copy(out, buf[0][:off]) - copy(out[dstEvery:], buf[1][:off]) - copy(out[dstEvery*2:], buf[2][:off]) - copy(out[dstEvery*3:], buf[3][:off]) - decoded += int(off) * 4 - out = out[off:] + decoded = ctx.decoded + out = out[decoded/4:] } // Decode remaining. @@ -150,7 +122,6 @@ func (d *Decoder) Decompress4X(dst, src []byte) ([]byte, error) { for bitsLeft > 0 { br.fill() if offset >= endsAt { - d.bufs.Put(buf) return nil, errors.New("corruption detected: stream overrun 4") } @@ -164,7 +135,6 @@ func (d *Decoder) Decompress4X(dst, src []byte) ([]byte, error) { offset++ } if offset != endsAt { - d.bufs.Put(buf) return nil, fmt.Errorf("corruption detected: short output block %d, end %d != %d", i, offset, endsAt) } decoded += offset - dstEvery*i @@ -173,9 +143,86 @@ func (d *Decoder) Decompress4X(dst, src []byte) ([]byte, error) { return nil, err } } - d.bufs.Put(buf) if dstSize != decoded { return nil, errors.New("corruption detected: short output block") } return dst, nil } + +// decompress4x_main_loop_x86 is an x86 assembler implementation +// of Decompress1X when tablelog > 8. +//go:noescape +func decompress1x_main_loop_amd64(ctx *decompress1xContext) + +// decompress4x_main_loop_x86 is an x86 with BMI2 assembler implementation +// of Decompress1X when tablelog > 8. +//go:noescape +func decompress1x_main_loop_bmi2(ctx *decompress1xContext) + +type decompress1xContext struct { + pbr *bitReaderShifted + peekBits uint8 + out *byte + outCap int + tbl *dEntrySingle + decoded int +} + +// Error reported by asm implementations +const error_max_decoded_size_exeeded = -1 + +// Decompress1X will decompress a 1X encoded stream. +// The cap of the output buffer will be the maximum decompressed size. +// The length of the supplied input must match the end of a block exactly. +func (d *Decoder) Decompress1X(dst, src []byte) ([]byte, error) { + if len(d.dt.single) == 0 { + return nil, errors.New("no table loaded") + } + var br bitReaderShifted + err := br.init(src) + if err != nil { + return dst, err + } + maxDecodedSize := cap(dst) + dst = dst[:maxDecodedSize] + + const tlSize = 1 << tableLogMax + const tlMask = tlSize - 1 + + if maxDecodedSize >= 4 { + ctx := decompress1xContext{ + pbr: &br, + out: &dst[0], + outCap: maxDecodedSize, + peekBits: uint8((64 - d.actualTableLog) & 63), // see: bitReaderShifted.peekBitsFast() + tbl: &d.dt.single[0], + } + + if cpuinfo.HasBMI2() { + decompress1x_main_loop_bmi2(&ctx) + } else { + decompress1x_main_loop_amd64(&ctx) + } + if ctx.decoded == error_max_decoded_size_exeeded { + return nil, ErrMaxDecodedSizeExceeded + } + + dst = dst[:ctx.decoded] + } + + // br < 8, so uint8 is fine + bitsLeft := uint8(br.off)*8 + 64 - br.bitsRead + for bitsLeft > 0 { + br.fill() + if len(dst) >= maxDecodedSize { + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + v := d.dt.single[br.peekBitsFast(d.actualTableLog)&tlMask] + nBits := uint8(v.entry) + br.advance(nBits) + bitsLeft -= nBits + dst = append(dst, uint8(v.entry>>8)) + } + return dst, br.close() +} diff --git a/vendor/github.com/klauspost/compress/huff0/decompress_amd64.s b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.s index 2edad3ea..6c65c6e2 100644 --- a/vendor/github.com/klauspost/compress/huff0/decompress_amd64.s +++ b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.s @@ -1,506 +1,865 @@ -// +build !appengine -// +build gc -// +build !noasm - -#include "textflag.h" -#include "funcdata.h" -#include "go_asm.h" - -#ifdef GOAMD64_v4 -#ifndef GOAMD64_v3 -#define GOAMD64_v3 -#endif -#endif - -#define bufoff 256 // see decompress.go, we're using [4][256]byte table - -// func decompress4x_main_loop_x86(pbr0, pbr1, pbr2, pbr3 *bitReaderShifted, -// peekBits uint8, buf *byte, tbl *dEntrySingle) (int, bool) -TEXT ·decompress4x_main_loop_x86(SB), NOSPLIT, $8 -#define off R8 -#define buffer DI -#define table SI - -#define br_bits_read R9 -#define br_value R10 -#define br_offset R11 -#define peek_bits R12 -#define exhausted DX - -#define br0 R13 -#define br1 R14 -#define br2 R15 -#define br3 BP - - MOVQ BP, 0(SP) - - XORQ exhausted, exhausted // exhausted = false - XORQ off, off // off = 0 - - MOVBQZX peekBits+32(FP), peek_bits - MOVQ buf+40(FP), buffer - MOVQ tbl+48(FP), table - - MOVQ pbr0+0(FP), br0 - MOVQ pbr1+8(FP), br1 - MOVQ pbr2+16(FP), br2 - MOVQ pbr3+24(FP), br3 - +// Code generated by command: go run gen.go -out ../decompress_amd64.s -pkg=huff0. DO NOT EDIT. + +//go:build amd64 && !appengine && !noasm && gc +// +build amd64,!appengine,!noasm,gc + +// func decompress4x_main_loop_amd64(ctx *decompress4xContext) +TEXT ·decompress4x_main_loop_amd64(SB), $8-8 + XORQ DX, DX + + // Preload values + MOVQ ctx+0(FP), AX + MOVBQZX 32(AX), SI + MOVQ 40(AX), DI + MOVQ DI, BX + MOVQ 72(AX), CX + MOVQ CX, (SP) + MOVQ 48(AX), R8 + MOVQ 56(AX), R9 + MOVQ (AX), R10 + MOVQ 8(AX), R11 + MOVQ 16(AX), R12 + MOVQ 24(AX), R13 + + // Main loop main_loop: - - // const stream = 0 - // br0.fillFast() - MOVBQZX bitReaderShifted_bitsRead(br0), br_bits_read - MOVQ bitReaderShifted_value(br0), br_value - MOVQ bitReaderShifted_off(br0), br_offset - - // We must have at least 2 * max tablelog left - CMPQ br_bits_read, $64-22 - JBE skip_fill0 - - SUBQ $32, br_bits_read // b.bitsRead -= 32 - SUBQ $4, br_offset // b.off -= 4 - - // v := b.in[b.off-4 : b.off] - // v = v[:4] - // low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - MOVQ bitReaderShifted_in(br0), AX + MOVQ BX, DI + CMPQ DI, (SP) + SETGE DL + + // br0.fillFast32() + MOVQ 32(R10), R14 + MOVBQZX 40(R10), R15 + CMPQ R15, $0x20 + JBE skip_fill0 + MOVQ 24(R10), AX + SUBQ $0x20, R15 + SUBQ $0x04, AX + MOVQ (R10), BP // b.value |= uint64(low) << (b.bitsRead & 63) -#ifdef GOAMD64_v3 - SHLXQ br_bits_read, 0(br_offset)(AX*1), AX // AX = uint32(b.in[b.off:b.off+4]) << (b.bitsRead & 63) - -#else - MOVL 0(br_offset)(AX*1), AX // AX = uint32(b.in[b.off:b.off+4]) - MOVQ br_bits_read, CX - SHLQ CL, AX - -#endif - - ORQ AX, br_value + MOVL (AX)(BP*1), BP + MOVQ R15, CX + SHLQ CL, BP + MOVQ AX, 24(R10) + ORQ BP, R14 // exhausted = exhausted || (br0.off < 4) - CMPQ br_offset, $4 - SETLT DL - ORB DL, DH + CMPQ AX, $0x04 + SETLT AL + ORB AL, DL - // } skip_fill0: - // val0 := br0.peekTopBits(peekBits) -#ifdef GOAMD64_v3 - SHRXQ peek_bits, br_value, AX // AX = (value >> peek_bits) & mask - -#else - MOVQ br_value, AX - MOVQ peek_bits, CX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - -#endif + MOVQ R14, BP + MOVQ SI, CX + SHRQ CL, BP // v0 := table[val0&mask] - MOVW 0(table)(AX*2), AX // AX - v0 - - // br0.advance(uint8(v0.entry)) - MOVB AH, BL // BL = uint8(v0.entry >> 8) - -#ifdef GOAMD64_v3 - MOVBQZX AL, CX - SHLXQ AX, br_value, br_value // value <<= n - -#else - MOVBQZX AL, CX - SHLQ CL, br_value // value <<= n + MOVW (R9)(BP*2), CX -#endif + // br0.advance(uint8(v0.entry) + MOVB CH, AL + SHLQ CL, R14 + ADDB CL, R15 - ADDQ CX, br_bits_read // bits_read += n - -#ifdef GOAMD64_v3 - SHRXQ peek_bits, br_value, AX // AX = (value >> peek_bits) & mask - -#else // val1 := br0.peekTopBits(peekBits) - MOVQ peek_bits, CX - MOVQ br_value, AX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - -#endif + MOVQ SI, CX + MOVQ R14, BP + SHRQ CL, BP // v1 := table[val1&mask] - MOVW 0(table)(AX*2), AX // AX - v1 + MOVW (R9)(BP*2), CX // br0.advance(uint8(v1.entry)) - MOVB AH, BH // BH = uint8(v1.entry >> 8) - -#ifdef GOAMD64_v3 - MOVBQZX AL, CX - SHLXQ AX, br_value, br_value // value <<= n - -#else - MOVBQZX AL, CX - SHLQ CL, br_value // value <<= n - -#endif - - ADDQ CX, br_bits_read // bits_read += n + MOVB CH, AH + SHLQ CL, R14 + ADDB CL, R15 // these two writes get coalesced - // buf[stream][off] = uint8(v0.entry >> 8) - // buf[stream][off+1] = uint8(v1.entry >> 8) - MOVW BX, 0(buffer)(off*1) + // out[id * dstEvery + 0] = uint8(v0.entry >> 8) + // out[id * dstEvery + 1] = uint8(v1.entry >> 8) + MOVW AX, (DI) // update the bitrader reader structure - MOVB br_bits_read, bitReaderShifted_bitsRead(br0) - MOVQ br_value, bitReaderShifted_value(br0) - MOVQ br_offset, bitReaderShifted_off(br0) - - // const stream = 1 - // br1.fillFast() - MOVBQZX bitReaderShifted_bitsRead(br1), br_bits_read - MOVQ bitReaderShifted_value(br1), br_value - MOVQ bitReaderShifted_off(br1), br_offset - - // We must have at least 2 * max tablelog left - CMPQ br_bits_read, $64-22 - JBE skip_fill1 - - SUBQ $32, br_bits_read // b.bitsRead -= 32 - SUBQ $4, br_offset // b.off -= 4 - - // v := b.in[b.off-4 : b.off] - // v = v[:4] - // low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - MOVQ bitReaderShifted_in(br1), AX + MOVQ R14, 32(R10) + MOVB R15, 40(R10) + ADDQ R8, DI + + // br1.fillFast32() + MOVQ 32(R11), R14 + MOVBQZX 40(R11), R15 + CMPQ R15, $0x20 + JBE skip_fill1 + MOVQ 24(R11), AX + SUBQ $0x20, R15 + SUBQ $0x04, AX + MOVQ (R11), BP // b.value |= uint64(low) << (b.bitsRead & 63) -#ifdef GOAMD64_v3 - SHLXQ br_bits_read, 0(br_offset)(AX*1), AX // AX = uint32(b.in[b.off:b.off+4]) << (b.bitsRead & 63) - -#else - MOVL 0(br_offset)(AX*1), AX // AX = uint32(b.in[b.off:b.off+4]) - MOVQ br_bits_read, CX - SHLQ CL, AX - -#endif - - ORQ AX, br_value + MOVL (AX)(BP*1), BP + MOVQ R15, CX + SHLQ CL, BP + MOVQ AX, 24(R11) + ORQ BP, R14 // exhausted = exhausted || (br1.off < 4) - CMPQ br_offset, $4 - SETLT DL - ORB DL, DH + CMPQ AX, $0x04 + SETLT AL + ORB AL, DL - // } skip_fill1: - // val0 := br1.peekTopBits(peekBits) -#ifdef GOAMD64_v3 - SHRXQ peek_bits, br_value, AX // AX = (value >> peek_bits) & mask - -#else - MOVQ br_value, AX - MOVQ peek_bits, CX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - -#endif + MOVQ R14, BP + MOVQ SI, CX + SHRQ CL, BP // v0 := table[val0&mask] - MOVW 0(table)(AX*2), AX // AX - v0 - - // br1.advance(uint8(v0.entry)) - MOVB AH, BL // BL = uint8(v0.entry >> 8) - -#ifdef GOAMD64_v3 - MOVBQZX AL, CX - SHLXQ AX, br_value, br_value // value <<= n - -#else - MOVBQZX AL, CX - SHLQ CL, br_value // value <<= n + MOVW (R9)(BP*2), CX -#endif + // br1.advance(uint8(v0.entry) + MOVB CH, AL + SHLQ CL, R14 + ADDB CL, R15 - ADDQ CX, br_bits_read // bits_read += n - -#ifdef GOAMD64_v3 - SHRXQ peek_bits, br_value, AX // AX = (value >> peek_bits) & mask - -#else // val1 := br1.peekTopBits(peekBits) - MOVQ peek_bits, CX - MOVQ br_value, AX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - -#endif + MOVQ SI, CX + MOVQ R14, BP + SHRQ CL, BP // v1 := table[val1&mask] - MOVW 0(table)(AX*2), AX // AX - v1 + MOVW (R9)(BP*2), CX // br1.advance(uint8(v1.entry)) - MOVB AH, BH // BH = uint8(v1.entry >> 8) - -#ifdef GOAMD64_v3 - MOVBQZX AL, CX - SHLXQ AX, br_value, br_value // value <<= n - -#else - MOVBQZX AL, CX - SHLQ CL, br_value // value <<= n - -#endif - - ADDQ CX, br_bits_read // bits_read += n + MOVB CH, AH + SHLQ CL, R14 + ADDB CL, R15 // these two writes get coalesced - // buf[stream][off] = uint8(v0.entry >> 8) - // buf[stream][off+1] = uint8(v1.entry >> 8) - MOVW BX, 256(buffer)(off*1) + // out[id * dstEvery + 0] = uint8(v0.entry >> 8) + // out[id * dstEvery + 1] = uint8(v1.entry >> 8) + MOVW AX, (DI) // update the bitrader reader structure - MOVB br_bits_read, bitReaderShifted_bitsRead(br1) - MOVQ br_value, bitReaderShifted_value(br1) - MOVQ br_offset, bitReaderShifted_off(br1) - - // const stream = 2 - // br2.fillFast() - MOVBQZX bitReaderShifted_bitsRead(br2), br_bits_read - MOVQ bitReaderShifted_value(br2), br_value - MOVQ bitReaderShifted_off(br2), br_offset - - // We must have at least 2 * max tablelog left - CMPQ br_bits_read, $64-22 - JBE skip_fill2 - - SUBQ $32, br_bits_read // b.bitsRead -= 32 - SUBQ $4, br_offset // b.off -= 4 - - // v := b.in[b.off-4 : b.off] - // v = v[:4] - // low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - MOVQ bitReaderShifted_in(br2), AX + MOVQ R14, 32(R11) + MOVB R15, 40(R11) + ADDQ R8, DI + + // br2.fillFast32() + MOVQ 32(R12), R14 + MOVBQZX 40(R12), R15 + CMPQ R15, $0x20 + JBE skip_fill2 + MOVQ 24(R12), AX + SUBQ $0x20, R15 + SUBQ $0x04, AX + MOVQ (R12), BP // b.value |= uint64(low) << (b.bitsRead & 63) -#ifdef GOAMD64_v3 - SHLXQ br_bits_read, 0(br_offset)(AX*1), AX // AX = uint32(b.in[b.off:b.off+4]) << (b.bitsRead & 63) - -#else - MOVL 0(br_offset)(AX*1), AX // AX = uint32(b.in[b.off:b.off+4]) - MOVQ br_bits_read, CX - SHLQ CL, AX - -#endif - - ORQ AX, br_value + MOVL (AX)(BP*1), BP + MOVQ R15, CX + SHLQ CL, BP + MOVQ AX, 24(R12) + ORQ BP, R14 // exhausted = exhausted || (br2.off < 4) - CMPQ br_offset, $4 - SETLT DL - ORB DL, DH + CMPQ AX, $0x04 + SETLT AL + ORB AL, DL - // } skip_fill2: - // val0 := br2.peekTopBits(peekBits) -#ifdef GOAMD64_v3 - SHRXQ peek_bits, br_value, AX // AX = (value >> peek_bits) & mask - -#else - MOVQ br_value, AX - MOVQ peek_bits, CX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - -#endif + MOVQ R14, BP + MOVQ SI, CX + SHRQ CL, BP // v0 := table[val0&mask] - MOVW 0(table)(AX*2), AX // AX - v0 - - // br2.advance(uint8(v0.entry)) - MOVB AH, BL // BL = uint8(v0.entry >> 8) - -#ifdef GOAMD64_v3 - MOVBQZX AL, CX - SHLXQ AX, br_value, br_value // value <<= n - -#else - MOVBQZX AL, CX - SHLQ CL, br_value // value <<= n + MOVW (R9)(BP*2), CX -#endif + // br2.advance(uint8(v0.entry) + MOVB CH, AL + SHLQ CL, R14 + ADDB CL, R15 - ADDQ CX, br_bits_read // bits_read += n - -#ifdef GOAMD64_v3 - SHRXQ peek_bits, br_value, AX // AX = (value >> peek_bits) & mask - -#else // val1 := br2.peekTopBits(peekBits) - MOVQ peek_bits, CX - MOVQ br_value, AX - SHRQ CL, AX // AX = (value >> peek_bits) & mask - -#endif + MOVQ SI, CX + MOVQ R14, BP + SHRQ CL, BP // v1 := table[val1&mask] - MOVW 0(table)(AX*2), AX // AX - v1 + MOVW (R9)(BP*2), CX // br2.advance(uint8(v1.entry)) - MOVB AH, BH // BH = uint8(v1.entry >> 8) - -#ifdef GOAMD64_v3 - MOVBQZX AL, CX - SHLXQ AX, br_value, br_value // value <<= n - -#else - MOVBQZX AL, CX - SHLQ CL, br_value // value <<= n - -#endif - - ADDQ CX, br_bits_read // bits_read += n + MOVB CH, AH + SHLQ CL, R14 + ADDB CL, R15 // these two writes get coalesced - // buf[stream][off] = uint8(v0.entry >> 8) - // buf[stream][off+1] = uint8(v1.entry >> 8) - MOVW BX, 512(buffer)(off*1) + // out[id * dstEvery + 0] = uint8(v0.entry >> 8) + // out[id * dstEvery + 1] = uint8(v1.entry >> 8) + MOVW AX, (DI) // update the bitrader reader structure - MOVB br_bits_read, bitReaderShifted_bitsRead(br2) - MOVQ br_value, bitReaderShifted_value(br2) - MOVQ br_offset, bitReaderShifted_off(br2) - - // const stream = 3 - // br3.fillFast() - MOVBQZX bitReaderShifted_bitsRead(br3), br_bits_read - MOVQ bitReaderShifted_value(br3), br_value - MOVQ bitReaderShifted_off(br3), br_offset - - // We must have at least 2 * max tablelog left - CMPQ br_bits_read, $64-22 - JBE skip_fill3 - - SUBQ $32, br_bits_read // b.bitsRead -= 32 - SUBQ $4, br_offset // b.off -= 4 - - // v := b.in[b.off-4 : b.off] - // v = v[:4] - // low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - MOVQ bitReaderShifted_in(br3), AX + MOVQ R14, 32(R12) + MOVB R15, 40(R12) + ADDQ R8, DI + + // br3.fillFast32() + MOVQ 32(R13), R14 + MOVBQZX 40(R13), R15 + CMPQ R15, $0x20 + JBE skip_fill3 + MOVQ 24(R13), AX + SUBQ $0x20, R15 + SUBQ $0x04, AX + MOVQ (R13), BP // b.value |= uint64(low) << (b.bitsRead & 63) -#ifdef GOAMD64_v3 - SHLXQ br_bits_read, 0(br_offset)(AX*1), AX // AX = uint32(b.in[b.off:b.off+4]) << (b.bitsRead & 63) - -#else - MOVL 0(br_offset)(AX*1), AX // AX = uint32(b.in[b.off:b.off+4]) - MOVQ br_bits_read, CX - SHLQ CL, AX - -#endif - - ORQ AX, br_value + MOVL (AX)(BP*1), BP + MOVQ R15, CX + SHLQ CL, BP + MOVQ AX, 24(R13) + ORQ BP, R14 // exhausted = exhausted || (br3.off < 4) - CMPQ br_offset, $4 - SETLT DL - ORB DL, DH + CMPQ AX, $0x04 + SETLT AL + ORB AL, DL - // } skip_fill3: - // val0 := br3.peekTopBits(peekBits) -#ifdef GOAMD64_v3 - SHRXQ peek_bits, br_value, AX // AX = (value >> peek_bits) & mask + MOVQ R14, BP + MOVQ SI, CX + SHRQ CL, BP -#else - MOVQ br_value, AX - MOVQ peek_bits, CX - SHRQ CL, AX // AX = (value >> peek_bits) & mask + // v0 := table[val0&mask] + MOVW (R9)(BP*2), CX -#endif + // br3.advance(uint8(v0.entry) + MOVB CH, AL + SHLQ CL, R14 + ADDB CL, R15 - // v0 := table[val0&mask] - MOVW 0(table)(AX*2), AX // AX - v0 + // val1 := br3.peekTopBits(peekBits) + MOVQ SI, CX + MOVQ R14, BP + SHRQ CL, BP - // br3.advance(uint8(v0.entry)) - MOVB AH, BL // BL = uint8(v0.entry >> 8) + // v1 := table[val1&mask] + MOVW (R9)(BP*2), CX -#ifdef GOAMD64_v3 - MOVBQZX AL, CX - SHLXQ AX, br_value, br_value // value <<= n + // br3.advance(uint8(v1.entry)) + MOVB CH, AH + SHLQ CL, R14 + ADDB CL, R15 -#else - MOVBQZX AL, CX - SHLQ CL, br_value // value <<= n + // these two writes get coalesced + // out[id * dstEvery + 0] = uint8(v0.entry >> 8) + // out[id * dstEvery + 1] = uint8(v1.entry >> 8) + MOVW AX, (DI) -#endif + // update the bitrader reader structure + MOVQ R14, 32(R13) + MOVB R15, 40(R13) + ADDQ $0x02, BX + TESTB DL, DL + JZ main_loop + MOVQ ctx+0(FP), AX + MOVQ 40(AX), CX + MOVQ BX, DX + SUBQ CX, DX + SHLQ $0x02, DX + MOVQ DX, 64(AX) + RET - ADDQ CX, br_bits_read // bits_read += n +// func decompress4x_8b_main_loop_amd64(ctx *decompress4xContext) +TEXT ·decompress4x_8b_main_loop_amd64(SB), $16-8 + XORQ DX, DX + + // Preload values + MOVQ ctx+0(FP), CX + MOVBQZX 32(CX), BX + MOVQ 40(CX), SI + MOVQ SI, (SP) + MOVQ 72(CX), DX + MOVQ DX, 8(SP) + MOVQ 48(CX), DI + MOVQ 56(CX), R8 + MOVQ (CX), R9 + MOVQ 8(CX), R10 + MOVQ 16(CX), R11 + MOVQ 24(CX), R12 + + // Main loop +main_loop: + MOVQ (SP), SI + CMPQ SI, 8(SP) + SETGE DL + + // br1000.fillFast32() + MOVQ 32(R9), R13 + MOVBQZX 40(R9), R14 + CMPQ R14, $0x20 + JBE skip_fill1000 + MOVQ 24(R9), R15 + SUBQ $0x20, R14 + SUBQ $0x04, R15 + MOVQ (R9), BP -#ifdef GOAMD64_v3 - SHRXQ peek_bits, br_value, AX // AX = (value >> peek_bits) & mask + // b.value |= uint64(low) << (b.bitsRead & 63) + MOVL (R15)(BP*1), BP + MOVQ R14, CX + SHLQ CL, BP + MOVQ R15, 24(R9) + ORQ BP, R13 + + // exhausted = exhausted || (br1000.off < 4) + CMPQ R15, $0x04 + SETLT AL + ORB AL, DL + +skip_fill1000: + // val0 := br0.peekTopBits(peekBits) + MOVQ R13, R15 + MOVQ BX, CX + SHRQ CL, R15 -#else - // val1 := br3.peekTopBits(peekBits) - MOVQ peek_bits, CX - MOVQ br_value, AX - SHRQ CL, AX // AX = (value >> peek_bits) & mask + // v0 := table[val0&mask] + MOVW (R8)(R15*2), CX -#endif + // br0.advance(uint8(v0.entry) + MOVB CH, AL + SHLQ CL, R13 + ADDB CL, R14 - // v1 := table[val1&mask] - MOVW 0(table)(AX*2), AX // AX - v1 + // val1 := br0.peekTopBits(peekBits) + MOVQ R13, R15 + MOVQ BX, CX + SHRQ CL, R15 + + // v1 := table[val0&mask] + MOVW (R8)(R15*2), CX + + // br0.advance(uint8(v1.entry) + MOVB CH, AH + SHLQ CL, R13 + ADDB CL, R14 + BSWAPL AX + + // val2 := br0.peekTopBits(peekBits) + MOVQ R13, R15 + MOVQ BX, CX + SHRQ CL, R15 + + // v2 := table[val0&mask] + MOVW (R8)(R15*2), CX + + // br0.advance(uint8(v2.entry) + MOVB CH, AH + SHLQ CL, R13 + ADDB CL, R14 + + // val3 := br0.peekTopBits(peekBits) + MOVQ R13, R15 + MOVQ BX, CX + SHRQ CL, R15 + + // v3 := table[val0&mask] + MOVW (R8)(R15*2), CX + + // br0.advance(uint8(v3.entry) + MOVB CH, AL + SHLQ CL, R13 + ADDB CL, R14 + BSWAPL AX + + // these four writes get coalesced + // out[id * dstEvery + 0] = uint8(v0.entry >> 8) + // out[id * dstEvery + 1] = uint8(v1.entry >> 8) + // out[id * dstEvery + 3] = uint8(v2.entry >> 8) + // out[id * dstEvery + 4] = uint8(v3.entry >> 8) + MOVL AX, (SI) + + // update the bitreader reader structure + MOVQ R13, 32(R9) + MOVB R14, 40(R9) + ADDQ DI, SI + + // br1001.fillFast32() + MOVQ 32(R10), R13 + MOVBQZX 40(R10), R14 + CMPQ R14, $0x20 + JBE skip_fill1001 + MOVQ 24(R10), R15 + SUBQ $0x20, R14 + SUBQ $0x04, R15 + MOVQ (R10), BP - // br3.advance(uint8(v1.entry)) - MOVB AH, BH // BH = uint8(v1.entry >> 8) + // b.value |= uint64(low) << (b.bitsRead & 63) + MOVL (R15)(BP*1), BP + MOVQ R14, CX + SHLQ CL, BP + MOVQ R15, 24(R10) + ORQ BP, R13 + + // exhausted = exhausted || (br1001.off < 4) + CMPQ R15, $0x04 + SETLT AL + ORB AL, DL + +skip_fill1001: + // val0 := br1.peekTopBits(peekBits) + MOVQ R13, R15 + MOVQ BX, CX + SHRQ CL, R15 -#ifdef GOAMD64_v3 - MOVBQZX AL, CX - SHLXQ AX, br_value, br_value // value <<= n + // v0 := table[val0&mask] + MOVW (R8)(R15*2), CX -#else - MOVBQZX AL, CX - SHLQ CL, br_value // value <<= n + // br1.advance(uint8(v0.entry) + MOVB CH, AL + SHLQ CL, R13 + ADDB CL, R14 -#endif + // val1 := br1.peekTopBits(peekBits) + MOVQ R13, R15 + MOVQ BX, CX + SHRQ CL, R15 + + // v1 := table[val0&mask] + MOVW (R8)(R15*2), CX + + // br1.advance(uint8(v1.entry) + MOVB CH, AH + SHLQ CL, R13 + ADDB CL, R14 + BSWAPL AX + + // val2 := br1.peekTopBits(peekBits) + MOVQ R13, R15 + MOVQ BX, CX + SHRQ CL, R15 + + // v2 := table[val0&mask] + MOVW (R8)(R15*2), CX + + // br1.advance(uint8(v2.entry) + MOVB CH, AH + SHLQ CL, R13 + ADDB CL, R14 + + // val3 := br1.peekTopBits(peekBits) + MOVQ R13, R15 + MOVQ BX, CX + SHRQ CL, R15 + + // v3 := table[val0&mask] + MOVW (R8)(R15*2), CX + + // br1.advance(uint8(v3.entry) + MOVB CH, AL + SHLQ CL, R13 + ADDB CL, R14 + BSWAPL AX + + // these four writes get coalesced + // out[id * dstEvery + 0] = uint8(v0.entry >> 8) + // out[id * dstEvery + 1] = uint8(v1.entry >> 8) + // out[id * dstEvery + 3] = uint8(v2.entry >> 8) + // out[id * dstEvery + 4] = uint8(v3.entry >> 8) + MOVL AX, (SI) + + // update the bitreader reader structure + MOVQ R13, 32(R10) + MOVB R14, 40(R10) + ADDQ DI, SI + + // br1002.fillFast32() + MOVQ 32(R11), R13 + MOVBQZX 40(R11), R14 + CMPQ R14, $0x20 + JBE skip_fill1002 + MOVQ 24(R11), R15 + SUBQ $0x20, R14 + SUBQ $0x04, R15 + MOVQ (R11), BP - ADDQ CX, br_bits_read // bits_read += n + // b.value |= uint64(low) << (b.bitsRead & 63) + MOVL (R15)(BP*1), BP + MOVQ R14, CX + SHLQ CL, BP + MOVQ R15, 24(R11) + ORQ BP, R13 + + // exhausted = exhausted || (br1002.off < 4) + CMPQ R15, $0x04 + SETLT AL + ORB AL, DL + +skip_fill1002: + // val0 := br2.peekTopBits(peekBits) + MOVQ R13, R15 + MOVQ BX, CX + SHRQ CL, R15 - // these two writes get coalesced - // buf[stream][off] = uint8(v0.entry >> 8) - // buf[stream][off+1] = uint8(v1.entry >> 8) - MOVW BX, 768(buffer)(off*1) + // v0 := table[val0&mask] + MOVW (R8)(R15*2), CX - // update the bitrader reader structure - MOVB br_bits_read, bitReaderShifted_bitsRead(br3) - MOVQ br_value, bitReaderShifted_value(br3) - MOVQ br_offset, bitReaderShifted_off(br3) + // br2.advance(uint8(v0.entry) + MOVB CH, AL + SHLQ CL, R13 + ADDB CL, R14 - ADDQ $2, off // off += 2 + // val1 := br2.peekTopBits(peekBits) + MOVQ R13, R15 + MOVQ BX, CX + SHRQ CL, R15 + + // v1 := table[val0&mask] + MOVW (R8)(R15*2), CX + + // br2.advance(uint8(v1.entry) + MOVB CH, AH + SHLQ CL, R13 + ADDB CL, R14 + BSWAPL AX + + // val2 := br2.peekTopBits(peekBits) + MOVQ R13, R15 + MOVQ BX, CX + SHRQ CL, R15 + + // v2 := table[val0&mask] + MOVW (R8)(R15*2), CX + + // br2.advance(uint8(v2.entry) + MOVB CH, AH + SHLQ CL, R13 + ADDB CL, R14 + + // val3 := br2.peekTopBits(peekBits) + MOVQ R13, R15 + MOVQ BX, CX + SHRQ CL, R15 + + // v3 := table[val0&mask] + MOVW (R8)(R15*2), CX + + // br2.advance(uint8(v3.entry) + MOVB CH, AL + SHLQ CL, R13 + ADDB CL, R14 + BSWAPL AX + + // these four writes get coalesced + // out[id * dstEvery + 0] = uint8(v0.entry >> 8) + // out[id * dstEvery + 1] = uint8(v1.entry >> 8) + // out[id * dstEvery + 3] = uint8(v2.entry >> 8) + // out[id * dstEvery + 4] = uint8(v3.entry >> 8) + MOVL AX, (SI) + + // update the bitreader reader structure + MOVQ R13, 32(R11) + MOVB R14, 40(R11) + ADDQ DI, SI + + // br1003.fillFast32() + MOVQ 32(R12), R13 + MOVBQZX 40(R12), R14 + CMPQ R14, $0x20 + JBE skip_fill1003 + MOVQ 24(R12), R15 + SUBQ $0x20, R14 + SUBQ $0x04, R15 + MOVQ (R12), BP - TESTB DH, DH // any br[i].ofs < 4? - JNZ end + // b.value |= uint64(low) << (b.bitsRead & 63) + MOVL (R15)(BP*1), BP + MOVQ R14, CX + SHLQ CL, BP + MOVQ R15, 24(R12) + ORQ BP, R13 + + // exhausted = exhausted || (br1003.off < 4) + CMPQ R15, $0x04 + SETLT AL + ORB AL, DL + +skip_fill1003: + // val0 := br3.peekTopBits(peekBits) + MOVQ R13, R15 + MOVQ BX, CX + SHRQ CL, R15 - CMPQ off, $bufoff - JL main_loop + // v0 := table[val0&mask] + MOVW (R8)(R15*2), CX -end: - MOVQ 0(SP), BP + // br3.advance(uint8(v0.entry) + MOVB CH, AL + SHLQ CL, R13 + ADDB CL, R14 - MOVB off, ret+56(FP) + // val1 := br3.peekTopBits(peekBits) + MOVQ R13, R15 + MOVQ BX, CX + SHRQ CL, R15 + + // v1 := table[val0&mask] + MOVW (R8)(R15*2), CX + + // br3.advance(uint8(v1.entry) + MOVB CH, AH + SHLQ CL, R13 + ADDB CL, R14 + BSWAPL AX + + // val2 := br3.peekTopBits(peekBits) + MOVQ R13, R15 + MOVQ BX, CX + SHRQ CL, R15 + + // v2 := table[val0&mask] + MOVW (R8)(R15*2), CX + + // br3.advance(uint8(v2.entry) + MOVB CH, AH + SHLQ CL, R13 + ADDB CL, R14 + + // val3 := br3.peekTopBits(peekBits) + MOVQ R13, R15 + MOVQ BX, CX + SHRQ CL, R15 + + // v3 := table[val0&mask] + MOVW (R8)(R15*2), CX + + // br3.advance(uint8(v3.entry) + MOVB CH, AL + SHLQ CL, R13 + ADDB CL, R14 + BSWAPL AX + + // these four writes get coalesced + // out[id * dstEvery + 0] = uint8(v0.entry >> 8) + // out[id * dstEvery + 1] = uint8(v1.entry >> 8) + // out[id * dstEvery + 3] = uint8(v2.entry >> 8) + // out[id * dstEvery + 4] = uint8(v3.entry >> 8) + MOVL AX, (SI) + + // update the bitreader reader structure + MOVQ R13, 32(R12) + MOVB R14, 40(R12) + ADDQ $0x04, (SP) + TESTB DL, DL + JZ main_loop + MOVQ ctx+0(FP), AX + MOVQ 40(AX), CX + MOVQ (SP), DX + SUBQ CX, DX + SHLQ $0x02, DX + MOVQ DX, 64(AX) RET -#undef off -#undef buffer -#undef table +// func decompress1x_main_loop_amd64(ctx *decompress1xContext) +TEXT ·decompress1x_main_loop_amd64(SB), $0-8 + MOVQ ctx+0(FP), CX + MOVQ 16(CX), DX + MOVQ 24(CX), BX + CMPQ BX, $0x04 + JB error_max_decoded_size_exeeded + LEAQ (DX)(BX*1), BX + MOVQ (CX), SI + MOVQ (SI), R8 + MOVQ 24(SI), R9 + MOVQ 32(SI), R10 + MOVBQZX 40(SI), R11 + MOVQ 32(CX), SI + MOVBQZX 8(CX), DI + JMP loop_condition -#undef br_bits_read -#undef br_value -#undef br_offset -#undef peek_bits -#undef exhausted +main_loop: + // Check if we have room for 4 bytes in the output buffer + LEAQ 4(DX), CX + CMPQ CX, BX + JGE error_max_decoded_size_exeeded + + // Decode 4 values + CMPQ R11, $0x20 + JL bitReader_fillFast_1_end + SUBQ $0x20, R11 + SUBQ $0x04, R9 + MOVL (R8)(R9*1), R12 + MOVQ R11, CX + SHLQ CL, R12 + ORQ R12, R10 + +bitReader_fillFast_1_end: + MOVQ DI, CX + MOVQ R10, R12 + SHRQ CL, R12 + MOVW (SI)(R12*2), CX + MOVB CH, AL + MOVBQZX CL, CX + ADDQ CX, R11 + SHLQ CL, R10 + MOVQ DI, CX + MOVQ R10, R12 + SHRQ CL, R12 + MOVW (SI)(R12*2), CX + MOVB CH, AH + MOVBQZX CL, CX + ADDQ CX, R11 + SHLQ CL, R10 + BSWAPL AX + CMPQ R11, $0x20 + JL bitReader_fillFast_2_end + SUBQ $0x20, R11 + SUBQ $0x04, R9 + MOVL (R8)(R9*1), R12 + MOVQ R11, CX + SHLQ CL, R12 + ORQ R12, R10 + +bitReader_fillFast_2_end: + MOVQ DI, CX + MOVQ R10, R12 + SHRQ CL, R12 + MOVW (SI)(R12*2), CX + MOVB CH, AH + MOVBQZX CL, CX + ADDQ CX, R11 + SHLQ CL, R10 + MOVQ DI, CX + MOVQ R10, R12 + SHRQ CL, R12 + MOVW (SI)(R12*2), CX + MOVB CH, AL + MOVBQZX CL, CX + ADDQ CX, R11 + SHLQ CL, R10 + BSWAPL AX + + // Store the decoded values + MOVL AX, (DX) + ADDQ $0x04, DX + +loop_condition: + CMPQ R9, $0x08 + JGE main_loop + + // Update ctx structure + MOVQ ctx+0(FP), AX + MOVQ DX, CX + MOVQ 16(AX), DX + SUBQ DX, CX + MOVQ CX, 40(AX) + MOVQ (AX), AX + MOVQ R9, 24(AX) + MOVQ R10, 32(AX) + MOVB R11, 40(AX) + RET -#undef br0 -#undef br1 -#undef br2 -#undef br3 + // Report error +error_max_decoded_size_exeeded: + MOVQ ctx+0(FP), AX + MOVQ $-1, CX + MOVQ CX, 40(AX) + RET + +// func decompress1x_main_loop_bmi2(ctx *decompress1xContext) +// Requires: BMI2 +TEXT ·decompress1x_main_loop_bmi2(SB), $0-8 + MOVQ ctx+0(FP), CX + MOVQ 16(CX), DX + MOVQ 24(CX), BX + CMPQ BX, $0x04 + JB error_max_decoded_size_exeeded + LEAQ (DX)(BX*1), BX + MOVQ (CX), SI + MOVQ (SI), R8 + MOVQ 24(SI), R9 + MOVQ 32(SI), R10 + MOVBQZX 40(SI), R11 + MOVQ 32(CX), SI + MOVBQZX 8(CX), DI + JMP loop_condition + +main_loop: + // Check if we have room for 4 bytes in the output buffer + LEAQ 4(DX), CX + CMPQ CX, BX + JGE error_max_decoded_size_exeeded + + // Decode 4 values + CMPQ R11, $0x20 + JL bitReader_fillFast_1_end + SUBQ $0x20, R11 + SUBQ $0x04, R9 + MOVL (R8)(R9*1), CX + SHLXQ R11, CX, CX + ORQ CX, R10 + +bitReader_fillFast_1_end: + SHRXQ DI, R10, CX + MOVW (SI)(CX*2), CX + MOVB CH, AL + MOVBQZX CL, CX + ADDQ CX, R11 + SHLXQ CX, R10, R10 + SHRXQ DI, R10, CX + MOVW (SI)(CX*2), CX + MOVB CH, AH + MOVBQZX CL, CX + ADDQ CX, R11 + SHLXQ CX, R10, R10 + BSWAPL AX + CMPQ R11, $0x20 + JL bitReader_fillFast_2_end + SUBQ $0x20, R11 + SUBQ $0x04, R9 + MOVL (R8)(R9*1), CX + SHLXQ R11, CX, CX + ORQ CX, R10 + +bitReader_fillFast_2_end: + SHRXQ DI, R10, CX + MOVW (SI)(CX*2), CX + MOVB CH, AH + MOVBQZX CL, CX + ADDQ CX, R11 + SHLXQ CX, R10, R10 + SHRXQ DI, R10, CX + MOVW (SI)(CX*2), CX + MOVB CH, AL + MOVBQZX CL, CX + ADDQ CX, R11 + SHLXQ CX, R10, R10 + BSWAPL AX + + // Store the decoded values + MOVL AX, (DX) + ADDQ $0x04, DX + +loop_condition: + CMPQ R9, $0x08 + JGE main_loop + + // Update ctx structure + MOVQ ctx+0(FP), AX + MOVQ DX, CX + MOVQ 16(AX), DX + SUBQ DX, CX + MOVQ CX, 40(AX) + MOVQ (AX), AX + MOVQ R9, 24(AX) + MOVQ R10, 32(AX) + MOVB R11, 40(AX) + RET + + // Report error +error_max_decoded_size_exeeded: + MOVQ ctx+0(FP), AX + MOVQ $-1, CX + MOVQ CX, 40(AX) + RET diff --git a/vendor/github.com/klauspost/compress/huff0/decompress_amd64.s.in b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.s.in deleted file mode 100644 index 330d86ae..00000000 --- a/vendor/github.com/klauspost/compress/huff0/decompress_amd64.s.in +++ /dev/null @@ -1,195 +0,0 @@ -// +build !appengine -// +build gc -// +build !noasm - -#include "textflag.h" -#include "funcdata.h" -#include "go_asm.h" - -#ifdef GOAMD64_v4 -#ifndef GOAMD64_v3 -#define GOAMD64_v3 -#endif -#endif - -#define bufoff 256 // see decompress.go, we're using [4][256]byte table - -//func decompress4x_main_loop_x86(pbr0, pbr1, pbr2, pbr3 *bitReaderShifted, -// peekBits uint8, buf *byte, tbl *dEntrySingle) (int, bool) -TEXT ·decompress4x_main_loop_x86(SB), NOSPLIT, $8 -#define off R8 -#define buffer DI -#define table SI - -#define br_bits_read R9 -#define br_value R10 -#define br_offset R11 -#define peek_bits R12 -#define exhausted DX - -#define br0 R13 -#define br1 R14 -#define br2 R15 -#define br3 BP - - MOVQ BP, 0(SP) - - XORQ exhausted, exhausted // exhausted = false - XORQ off, off // off = 0 - - MOVBQZX peekBits+32(FP), peek_bits - MOVQ buf+40(FP), buffer - MOVQ tbl+48(FP), table - - MOVQ pbr0+0(FP), br0 - MOVQ pbr1+8(FP), br1 - MOVQ pbr2+16(FP), br2 - MOVQ pbr3+24(FP), br3 - -main_loop: -{{ define "decode_2_values_x86" }} - // const stream = {{ var "id" }} - // br{{ var "id"}}.fillFast() - MOVBQZX bitReaderShifted_bitsRead(br{{ var "id" }}), br_bits_read - MOVQ bitReaderShifted_value(br{{ var "id" }}), br_value - MOVQ bitReaderShifted_off(br{{ var "id" }}), br_offset - - // We must have at least 2 * max tablelog left - CMPQ br_bits_read, $64-22 - JBE skip_fill{{ var "id" }} - - SUBQ $32, br_bits_read // b.bitsRead -= 32 - SUBQ $4, br_offset // b.off -= 4 - - // v := b.in[b.off-4 : b.off] - // v = v[:4] - // low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - MOVQ bitReaderShifted_in(br{{ var "id" }}), AX - - // b.value |= uint64(low) << (b.bitsRead & 63) -#ifdef GOAMD64_v3 - SHLXQ br_bits_read, 0(br_offset)(AX*1), AX // AX = uint32(b.in[b.off:b.off+4]) << (b.bitsRead & 63) -#else - MOVL 0(br_offset)(AX*1), AX // AX = uint32(b.in[b.off:b.off+4]) - MOVQ br_bits_read, CX - SHLQ CL, AX -#endif - - ORQ AX, br_value - - // exhausted = exhausted || (br{{ var "id"}}.off < 4) - CMPQ br_offset, $4 - SETLT DL - ORB DL, DH - // } -skip_fill{{ var "id" }}: - - // val0 := br{{ var "id"}}.peekTopBits(peekBits) -#ifdef GOAMD64_v3 - SHRXQ peek_bits, br_value, AX // AX = (value >> peek_bits) & mask -#else - MOVQ br_value, AX - MOVQ peek_bits, CX - SHRQ CL, AX // AX = (value >> peek_bits) & mask -#endif - - // v0 := table[val0&mask] - MOVW 0(table)(AX*2), AX // AX - v0 - - // br{{ var "id"}}.advance(uint8(v0.entry)) - MOVB AH, BL // BL = uint8(v0.entry >> 8) - -#ifdef GOAMD64_v3 - MOVBQZX AL, CX - SHLXQ AX, br_value, br_value // value <<= n -#else - MOVBQZX AL, CX - SHLQ CL, br_value // value <<= n -#endif - - ADDQ CX, br_bits_read // bits_read += n - - -#ifdef GOAMD64_v3 - SHRXQ peek_bits, br_value, AX // AX = (value >> peek_bits) & mask -#else - // val1 := br{{ var "id"}}.peekTopBits(peekBits) - MOVQ peek_bits, CX - MOVQ br_value, AX - SHRQ CL, AX // AX = (value >> peek_bits) & mask -#endif - - // v1 := table[val1&mask] - MOVW 0(table)(AX*2), AX // AX - v1 - - // br{{ var "id"}}.advance(uint8(v1.entry)) - MOVB AH, BH // BH = uint8(v1.entry >> 8) - -#ifdef GOAMD64_v3 - MOVBQZX AL, CX - SHLXQ AX, br_value, br_value // value <<= n -#else - MOVBQZX AL, CX - SHLQ CL, br_value // value <<= n -#endif - - ADDQ CX, br_bits_read // bits_read += n - - - // these two writes get coalesced - // buf[stream][off] = uint8(v0.entry >> 8) - // buf[stream][off+1] = uint8(v1.entry >> 8) - MOVW BX, {{ var "bufofs" }}(buffer)(off*1) - - // update the bitrader reader structure - MOVB br_bits_read, bitReaderShifted_bitsRead(br{{ var "id" }}) - MOVQ br_value, bitReaderShifted_value(br{{ var "id" }}) - MOVQ br_offset, bitReaderShifted_off(br{{ var "id" }}) -{{ end }} - - {{ set "id" "0" }} - {{ set "ofs" "0" }} - {{ set "bufofs" "0" }} {{/* id * bufoff */}} - {{ template "decode_2_values_x86" . }} - - {{ set "id" "1" }} - {{ set "ofs" "8" }} - {{ set "bufofs" "256" }} - {{ template "decode_2_values_x86" . }} - - {{ set "id" "2" }} - {{ set "ofs" "16" }} - {{ set "bufofs" "512" }} - {{ template "decode_2_values_x86" . }} - - {{ set "id" "3" }} - {{ set "ofs" "24" }} - {{ set "bufofs" "768" }} - {{ template "decode_2_values_x86" . }} - - ADDQ $2, off // off += 2 - - TESTB DH, DH // any br[i].ofs < 4? - JNZ end - - CMPQ off, $bufoff - JL main_loop -end: - MOVQ 0(SP), BP - - MOVB off, ret+56(FP) - RET -#undef off -#undef buffer -#undef table - -#undef br_bits_read -#undef br_value -#undef br_offset -#undef peek_bits -#undef exhausted - -#undef br0 -#undef br1 -#undef br2 -#undef br3 diff --git a/vendor/github.com/klauspost/compress/huff0/decompress_generic.go b/vendor/github.com/klauspost/compress/huff0/decompress_generic.go index 126b4d68..4f6f37cb 100644 --- a/vendor/github.com/klauspost/compress/huff0/decompress_generic.go +++ b/vendor/github.com/klauspost/compress/huff0/decompress_generic.go @@ -191,3 +191,105 @@ func (d *Decoder) Decompress4X(dst, src []byte) ([]byte, error) { } return dst, nil } + +// Decompress1X will decompress a 1X encoded stream. +// The cap of the output buffer will be the maximum decompressed size. +// The length of the supplied input must match the end of a block exactly. +func (d *Decoder) Decompress1X(dst, src []byte) ([]byte, error) { + if len(d.dt.single) == 0 { + return nil, errors.New("no table loaded") + } + if use8BitTables && d.actualTableLog <= 8 { + return d.decompress1X8Bit(dst, src) + } + var br bitReaderShifted + err := br.init(src) + if err != nil { + return dst, err + } + maxDecodedSize := cap(dst) + dst = dst[:0] + + // Avoid bounds check by always having full sized table. + const tlSize = 1 << tableLogMax + const tlMask = tlSize - 1 + dt := d.dt.single[:tlSize] + + // Use temp table to avoid bound checks/append penalty. + bufs := d.buffer() + buf := &bufs[0] + var off uint8 + + for br.off >= 8 { + br.fillFast() + v := dt[br.peekBitsFast(d.actualTableLog)&tlMask] + br.advance(uint8(v.entry)) + buf[off+0] = uint8(v.entry >> 8) + + v = dt[br.peekBitsFast(d.actualTableLog)&tlMask] + br.advance(uint8(v.entry)) + buf[off+1] = uint8(v.entry >> 8) + + // Refill + br.fillFast() + + v = dt[br.peekBitsFast(d.actualTableLog)&tlMask] + br.advance(uint8(v.entry)) + buf[off+2] = uint8(v.entry >> 8) + + v = dt[br.peekBitsFast(d.actualTableLog)&tlMask] + br.advance(uint8(v.entry)) + buf[off+3] = uint8(v.entry >> 8) + + off += 4 + if off == 0 { + if len(dst)+256 > maxDecodedSize { + br.close() + d.bufs.Put(bufs) + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:]...) + } + } + + if len(dst)+int(off) > maxDecodedSize { + d.bufs.Put(bufs) + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:off]...) + + // br < 8, so uint8 is fine + bitsLeft := uint8(br.off)*8 + 64 - br.bitsRead + for bitsLeft > 0 { + br.fill() + if false && br.bitsRead >= 32 { + if br.off >= 4 { + v := br.in[br.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + br.value = (br.value << 32) | uint64(low) + br.bitsRead -= 32 + br.off -= 4 + } else { + for br.off > 0 { + br.value = (br.value << 8) | uint64(br.in[br.off-1]) + br.bitsRead -= 8 + br.off-- + } + } + } + if len(dst) >= maxDecodedSize { + d.bufs.Put(bufs) + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + v := d.dt.single[br.peekBitsFast(d.actualTableLog)&tlMask] + nBits := uint8(v.entry) + br.advance(nBits) + bitsLeft -= nBits + dst = append(dst, uint8(v.entry>>8)) + } + d.bufs.Put(bufs) + return dst, br.close() +} diff --git a/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go new file mode 100644 index 00000000..3954c512 --- /dev/null +++ b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go @@ -0,0 +1,34 @@ +// Package cpuinfo gives runtime info about the current CPU. +// +// This is a very limited module meant for use internally +// in this project. For more versatile solution check +// https://github.com/klauspost/cpuid. +package cpuinfo + +// HasBMI1 checks whether an x86 CPU supports the BMI1 extension. +func HasBMI1() bool { + return hasBMI1 +} + +// HasBMI2 checks whether an x86 CPU supports the BMI2 extension. +func HasBMI2() bool { + return hasBMI2 +} + +// DisableBMI2 will disable BMI2, for testing purposes. +// Call returned function to restore previous state. +func DisableBMI2() func() { + old := hasBMI2 + hasBMI2 = false + return func() { + hasBMI2 = old + } +} + +// HasBMI checks whether an x86 CPU supports both BMI1 and BMI2 extensions. +func HasBMI() bool { + return HasBMI1() && HasBMI2() +} + +var hasBMI1 bool +var hasBMI2 bool diff --git a/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go new file mode 100644 index 00000000..e802579c --- /dev/null +++ b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go @@ -0,0 +1,11 @@ +//go:build amd64 && !appengine && !noasm && gc +// +build amd64,!appengine,!noasm,gc + +package cpuinfo + +// go:noescape +func x86extensions() (bmi1, bmi2 bool) + +func init() { + hasBMI1, hasBMI2 = x86extensions() +} diff --git a/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.s b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.s new file mode 100644 index 00000000..4465fbe9 --- /dev/null +++ b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.s @@ -0,0 +1,36 @@ +// +build !appengine +// +build gc +// +build !noasm + +#include "textflag.h" +#include "funcdata.h" +#include "go_asm.h" + +TEXT ·x86extensions(SB), NOSPLIT, $0 + // 1. determine max EAX value + XORQ AX, AX + CPUID + + CMPQ AX, $7 + JB unsupported + + // 2. EAX = 7, ECX = 0 --- see Table 3-8 "Information Returned by CPUID Instruction" + MOVQ $7, AX + MOVQ $0, CX + CPUID + + BTQ $3, BX // bit 3 = BMI1 + SETCS AL + + BTQ $8, BX // bit 8 = BMI2 + SETCS AH + + MOVB AL, bmi1+0(FP) + MOVB AH, bmi2+1(FP) + RET + +unsupported: + XORQ AX, AX + MOVB AL, bmi1+0(FP) + MOVB AL, bmi2+1(FP) + RET diff --git a/vendor/github.com/klauspost/compress/s2/README.md b/vendor/github.com/klauspost/compress/s2/README.md index 11979345..73c0c462 100644 --- a/vendor/github.com/klauspost/compress/s2/README.md +++ b/vendor/github.com/klauspost/compress/s2/README.md @@ -19,6 +19,7 @@ This is important, so you don't have to worry about spending CPU cycles on alrea * Adjustable compression (3 levels) * Concurrent stream compression * Faster decompression, even for Snappy compatible content +* Concurrent Snappy/S2 stream decompression * Ability to quickly skip forward in compressed stream * Random seeking with indexes * Compatible with reading Snappy compressed content @@ -415,6 +416,25 @@ Without assembly decompression is also very fast; single goroutine decompression Even though S2 typically compresses better than Snappy, decompression speed is always better. +### Concurrent Stream Decompression + +For full stream decompression S2 offers a [DecodeConcurrent](https://pkg.go.dev/github.com/klauspost/compress/s2#Reader.DecodeConcurrent) +that will decode a full stream using multiple goroutines. + +Example scaling, AMD Ryzen 3950X, 16 cores, decompression using `s2d -bench=3 `, best of 3: + +| Input | `-cpu=1` | `-cpu=2` | `-cpu=4` | `-cpu=8` | `-cpu=16` | +|-------------------------------------------|------------|------------|------------|------------|-------------| +| enwik10.snappy | 1098.6MB/s | 1819.8MB/s | 3625.6MB/s | 6910.6MB/s | 10818.2MB/s | +| enwik10.s2 | 1303.5MB/s | 2606.1MB/s | 4847.9MB/s | 8878.4MB/s | 9592.1MB/s | +| sofia-air-quality-dataset.tar.snappy | 1302.0MB/s | 2165.0MB/s | 4244.5MB/s | 8241.0MB/s | 12920.5MB/s | +| sofia-air-quality-dataset.tar.s2 | 1399.2MB/s | 2463.2MB/s | 5196.5MB/s | 9639.8MB/s | 11439.5MB/s | +| sofia-air-quality-dataset.tar.s2 (no asm) | 837.5MB/s | 1652.6MB/s | 3183.6MB/s | 5945.0MB/s | 9620.7MB/s | + +Scaling can be expected to be pretty linear until memory bandwidth is saturated. + +For now the DecodeConcurrent can only be used for full streams without seeking or combining with regular reads. + ## Block compression @@ -873,7 +893,7 @@ for each entry { } // Uncompressed uses previous offset and adds EstBlockSize - entry[entryNum].UncompressedOffset = entry[entryNum-1].UncompressedOffset + EstBlockSize + entry[entryNum].UncompressedOffset = entry[entryNum-1].UncompressedOffset + EstBlockSize + uOff } @@ -901,6 +921,14 @@ for each entry { } ``` +To decode from any given uncompressed offset `(wantOffset)`: + +* Iterate entries until `entry[n].UncompressedOffset > wantOffset`. +* Start decoding from `entry[n-1].CompressedOffset`. +* Discard `entry[n-1].UncompressedOffset - wantOffset` bytes from the decoded stream. + +See [using indexes](https://github.com/klauspost/compress/tree/master/s2#using-indexes) for functions that perform the operations with a simpler interface. + # Format Extensions * Frame [Stream identifier](https://github.com/google/snappy/blob/master/framing_format.txt#L68) changed from `sNaPpY` to `S2sTwO`. diff --git a/vendor/github.com/klauspost/compress/s2/decode.go b/vendor/github.com/klauspost/compress/s2/decode.go index 9e7fce88..2aba9e27 100644 --- a/vendor/github.com/klauspost/compress/s2/decode.go +++ b/vendor/github.com/klauspost/compress/s2/decode.go @@ -11,6 +11,8 @@ import ( "fmt" "io" "io/ioutil" + "runtime" + "sync" ) var ( @@ -169,6 +171,14 @@ func ReaderSkippableCB(id uint8, fn func(r io.Reader) error) ReaderOption { } } +// ReaderIgnoreCRC will make the reader skip CRC calculation and checks. +func ReaderIgnoreCRC() ReaderOption { + return func(r *Reader) error { + r.ignoreCRC = true + return nil + } +} + // Reader is an io.Reader that can read Snappy-compressed bytes. type Reader struct { r io.Reader @@ -191,18 +201,19 @@ type Reader struct { paramsOK bool snappyFrame bool ignoreStreamID bool + ignoreCRC bool } // ensureBufferSize will ensure that the buffer can take at least n bytes. // If false is returned the buffer exceeds maximum allowed size. func (r *Reader) ensureBufferSize(n int) bool { - if len(r.buf) >= n { - return true - } if n > r.maxBufSize { r.err = ErrCorrupt return false } + if cap(r.buf) >= n { + return true + } // Realloc buffer. r.buf = make([]byte, n) return true @@ -220,6 +231,7 @@ func (r *Reader) Reset(reader io.Reader) { r.err = nil r.i = 0 r.j = 0 + r.blockStart = 0 r.readHeader = r.ignoreStreamID } @@ -344,7 +356,7 @@ func (r *Reader) Read(p []byte) (int, error) { r.err = err return 0, r.err } - if crc(r.decoded[:n]) != checksum { + if !r.ignoreCRC && crc(r.decoded[:n]) != checksum { r.err = ErrCRC return 0, r.err } @@ -385,7 +397,7 @@ func (r *Reader) Read(p []byte) (int, error) { if !r.readFull(r.decoded[:n], false) { return 0, r.err } - if crc(r.decoded[:n]) != checksum { + if !r.ignoreCRC && crc(r.decoded[:n]) != checksum { r.err = ErrCRC return 0, r.err } @@ -435,6 +447,259 @@ func (r *Reader) Read(p []byte) (int, error) { } } +// DecodeConcurrent will decode the full stream to w. +// This function should not be combined with reading, seeking or other operations. +// Up to 'concurrent' goroutines will be used. +// If <= 0, runtime.NumCPU will be used. +// On success the number of bytes decompressed nil and is returned. +// This is mainly intended for bigger streams. +func (r *Reader) DecodeConcurrent(w io.Writer, concurrent int) (written int64, err error) { + if r.i > 0 || r.j > 0 || r.blockStart > 0 { + return 0, errors.New("DecodeConcurrent called after ") + } + if concurrent <= 0 { + concurrent = runtime.NumCPU() + } + + // Write to output + var errMu sync.Mutex + var aErr error + setErr := func(e error) (ok bool) { + errMu.Lock() + defer errMu.Unlock() + if e == nil { + return aErr == nil + } + if aErr == nil { + aErr = e + } + return false + } + hasErr := func() (ok bool) { + errMu.Lock() + v := aErr != nil + errMu.Unlock() + return v + } + + var aWritten int64 + toRead := make(chan []byte, concurrent) + writtenBlocks := make(chan []byte, concurrent) + queue := make(chan chan []byte, concurrent) + reUse := make(chan chan []byte, concurrent) + for i := 0; i < concurrent; i++ { + toRead <- make([]byte, 0, r.maxBufSize) + writtenBlocks <- make([]byte, 0, r.maxBufSize) + reUse <- make(chan []byte, 1) + } + // Writer + var wg sync.WaitGroup + wg.Add(1) + go func() { + defer wg.Done() + for toWrite := range queue { + entry := <-toWrite + reUse <- toWrite + if hasErr() { + writtenBlocks <- entry + continue + } + n, err := w.Write(entry) + want := len(entry) + writtenBlocks <- entry + if err != nil { + setErr(err) + continue + } + if n != want { + setErr(io.ErrShortWrite) + continue + } + aWritten += int64(n) + } + }() + + // Reader + defer func() { + close(queue) + if r.err != nil { + err = r.err + setErr(r.err) + } + wg.Wait() + if err == nil { + err = aErr + } + written = aWritten + }() + + for !hasErr() { + if !r.readFull(r.buf[:4], true) { + if r.err == io.EOF { + r.err = nil + } + return 0, r.err + } + chunkType := r.buf[0] + if !r.readHeader { + if chunkType != chunkTypeStreamIdentifier { + r.err = ErrCorrupt + return 0, r.err + } + r.readHeader = true + } + chunkLen := int(r.buf[1]) | int(r.buf[2])<<8 | int(r.buf[3])<<16 + + // The chunk types are specified at + // https://github.com/google/snappy/blob/master/framing_format.txt + switch chunkType { + case chunkTypeCompressedData: + r.blockStart += int64(r.j) + // Section 4.2. Compressed data (chunk type 0x00). + if chunkLen < checksumSize { + r.err = ErrCorrupt + return 0, r.err + } + if chunkLen > r.maxBufSize { + r.err = ErrCorrupt + return 0, r.err + } + orgBuf := <-toRead + buf := orgBuf[:chunkLen] + + if !r.readFull(buf, false) { + return 0, r.err + } + + checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 + buf = buf[checksumSize:] + + n, err := DecodedLen(buf) + if err != nil { + r.err = err + return 0, r.err + } + if r.snappyFrame && n > maxSnappyBlockSize { + r.err = ErrCorrupt + return 0, r.err + } + + if n > r.maxBlock { + r.err = ErrCorrupt + return 0, r.err + } + wg.Add(1) + + decoded := <-writtenBlocks + entry := <-reUse + queue <- entry + go func() { + defer wg.Done() + decoded = decoded[:n] + _, err := Decode(decoded, buf) + toRead <- orgBuf + if err != nil { + writtenBlocks <- decoded + setErr(err) + return + } + if !r.ignoreCRC && crc(decoded) != checksum { + writtenBlocks <- decoded + setErr(ErrCRC) + return + } + entry <- decoded + }() + continue + + case chunkTypeUncompressedData: + + // Section 4.3. Uncompressed data (chunk type 0x01). + if chunkLen < checksumSize { + r.err = ErrCorrupt + return 0, r.err + } + if chunkLen > r.maxBufSize { + r.err = ErrCorrupt + return 0, r.err + } + // Grab write buffer + orgBuf := <-writtenBlocks + buf := orgBuf[:checksumSize] + if !r.readFull(buf, false) { + return 0, r.err + } + checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 + // Read content. + n := chunkLen - checksumSize + + if r.snappyFrame && n > maxSnappyBlockSize { + r.err = ErrCorrupt + return 0, r.err + } + if n > r.maxBlock { + r.err = ErrCorrupt + return 0, r.err + } + // Read uncompressed + buf = orgBuf[:n] + if !r.readFull(buf, false) { + return 0, r.err + } + + if !r.ignoreCRC && crc(buf) != checksum { + r.err = ErrCRC + return 0, r.err + } + entry := <-reUse + queue <- entry + entry <- buf + continue + + case chunkTypeStreamIdentifier: + // Section 4.1. Stream identifier (chunk type 0xff). + if chunkLen != len(magicBody) { + r.err = ErrCorrupt + return 0, r.err + } + if !r.readFull(r.buf[:len(magicBody)], false) { + return 0, r.err + } + if string(r.buf[:len(magicBody)]) != magicBody { + if string(r.buf[:len(magicBody)]) != magicBodySnappy { + r.err = ErrCorrupt + return 0, r.err + } else { + r.snappyFrame = true + } + } else { + r.snappyFrame = false + } + continue + } + + if chunkType <= 0x7f { + // Section 4.5. Reserved unskippable chunks (chunk types 0x02-0x7f). + // fmt.Printf("ERR chunktype: 0x%x\n", chunkType) + r.err = ErrUnsupported + return 0, r.err + } + // Section 4.4 Padding (chunk type 0xfe). + // Section 4.6. Reserved skippable chunks (chunk types 0x80-0xfd). + if chunkLen > maxChunkSize { + // fmt.Printf("ERR chunkLen: 0x%x\n", chunkLen) + r.err = ErrUnsupported + return 0, r.err + } + + // fmt.Printf("skippable: ID: 0x%x, len: 0x%x\n", chunkType, chunkLen) + if !r.skippable(r.buf, chunkLen, false, chunkType) { + return 0, r.err + } + } + return 0, r.err +} + // Skip will skip n bytes forward in the decompressed output. // For larger skips this consumes less CPU and is faster than reading output and discarding it. // CRC is not checked on skipped blocks. @@ -699,8 +964,16 @@ func (r *ReadSeeker) Seek(offset int64, whence int) (int64, error) { case io.SeekCurrent: offset += r.blockStart + int64(r.i) case io.SeekEnd: - offset = -offset + if offset > 0 { + return 0, errors.New("seek after end of file") + } + offset = r.index.TotalUncompressed + offset + } + + if offset < 0 { + return 0, errors.New("seek before start of file") } + c, u, err := r.index.Find(offset) if err != nil { return r.blockStart + int64(r.i), err @@ -712,10 +985,6 @@ func (r *ReadSeeker) Seek(offset int64, whence int) (int64, error) { return 0, err } - if offset < 0 { - offset = r.index.TotalUncompressed + offset - } - r.i = r.j // Remove rest of current block. if u < offset { // Forward inside block diff --git a/vendor/github.com/klauspost/compress/s2/encode.go b/vendor/github.com/klauspost/compress/s2/encode.go index 59f992ca..1aefabf3 100644 --- a/vendor/github.com/klauspost/compress/s2/encode.go +++ b/vendor/github.com/klauspost/compress/s2/encode.go @@ -1119,12 +1119,6 @@ func (w *Writer) closeIndex(idx bool) ([]byte, error) { if w.appendIndex { w.written += int64(len(index)) } - if true { - _, err := w.index.Load(index) - if err != nil { - panic(err) - } - } } if w.pad > 1 { diff --git a/vendor/github.com/klauspost/compress/s2/encode_best.go b/vendor/github.com/klauspost/compress/s2/encode_best.go index 44803477..4bc80bc6 100644 --- a/vendor/github.com/klauspost/compress/s2/encode_best.go +++ b/vendor/github.com/klauspost/compress/s2/encode_best.go @@ -370,7 +370,7 @@ func encodeBlockBestSnappy(dst, src []byte) (d int) { } offset := m.s - m.offset - return score - emitCopySize(offset, m.length) + return score - emitCopyNoRepeatSize(offset, m.length) } matchAt := func(offset, s int, first uint32) match { @@ -567,6 +567,10 @@ func emitCopySize(offset, length int) int { // Offset no more than 2 bytes. if length > 64 { + if offset < 2048 { + // Emit 8 bytes, then rest as repeats... + return 2 + emitRepeatSize(offset, length-8) + } // Emit remaining as repeats, at least 4 bytes remain. return 3 + emitRepeatSize(offset, length-60) } @@ -577,6 +581,28 @@ func emitCopySize(offset, length int) int { return 2 } +// emitCopyNoRepeatSize returns the size to encode the offset+length +// +// It assumes that: +// 1 <= offset && offset <= math.MaxUint32 +// 4 <= length && length <= 1 << 24 +func emitCopyNoRepeatSize(offset, length int) int { + if offset >= 65536 { + return 5 + 5*(length/64) + } + + // Offset no more than 2 bytes. + if length > 64 { + // Emit remaining as repeats, at least 4 bytes remain. + return 3 + 3*(length/60) + } + if length >= 12 || offset >= 2048 { + return 3 + } + // Emit the remaining copy, encoded as 2 bytes. + return 2 +} + // emitRepeatSize returns the number of bytes required to encode a repeat. // Length must be at least 4 and < 1<<24 func emitRepeatSize(offset, length int) int { diff --git a/vendor/github.com/klauspost/compress/s2/encode_go.go b/vendor/github.com/klauspost/compress/s2/encode_go.go index 43d43534..94784b82 100644 --- a/vendor/github.com/klauspost/compress/s2/encode_go.go +++ b/vendor/github.com/klauspost/compress/s2/encode_go.go @@ -180,14 +180,23 @@ func emitCopy(dst []byte, offset, length int) int { // Offset no more than 2 bytes. if length > 64 { - // Emit a length 60 copy, encoded as 3 bytes. - // Emit remaining as repeat value (minimum 4 bytes). - dst[2] = uint8(offset >> 8) - dst[1] = uint8(offset) - dst[0] = 59<<2 | tagCopy2 - length -= 60 + off := 3 + if offset < 2048 { + // emit 8 bytes as tagCopy1, rest as repeats. + dst[1] = uint8(offset) + dst[0] = uint8(offset>>8)<<5 | uint8(8-4)<<2 | tagCopy1 + length -= 8 + off = 2 + } else { + // Emit a length 60 copy, encoded as 3 bytes. + // Emit remaining as repeat value (minimum 4 bytes). + dst[2] = uint8(offset >> 8) + dst[1] = uint8(offset) + dst[0] = 59<<2 | tagCopy2 + length -= 60 + } // Emit remaining as repeats, at least 4 bytes remain. - return 3 + emitRepeat(dst[3:], offset, length) + return off + emitRepeat(dst[off:], offset, length) } if length >= 12 || offset >= 2048 { // Emit the remaining copy, encoded as 3 bytes. diff --git a/vendor/github.com/klauspost/compress/s2/encodeblock_amd64.go b/vendor/github.com/klauspost/compress/s2/encodeblock_amd64.go index d9312e5b..88f27c09 100644 --- a/vendor/github.com/klauspost/compress/s2/encodeblock_amd64.go +++ b/vendor/github.com/klauspost/compress/s2/encodeblock_amd64.go @@ -5,6 +5,8 @@ package s2 +func _dummy_() + // encodeBlockAsm encodes a non-empty src to a guaranteed-large-enough dst. // Maximum input 4294967295 bytes. // It assumes that the varint-encoded length of the decompressed bytes has already been written. diff --git a/vendor/github.com/klauspost/compress/s2/encodeblock_amd64.s b/vendor/github.com/klauspost/compress/s2/encodeblock_amd64.s index 729dbf53..36915d94 100644 --- a/vendor/github.com/klauspost/compress/s2/encodeblock_amd64.s +++ b/vendor/github.com/klauspost/compress/s2/encodeblock_amd64.s @@ -5,6 +5,15 @@ #include "textflag.h" +// func _dummy_() +TEXT ·_dummy_(SB), $0 +#ifdef GOAMD64_v4 +#ifndef GOAMD64_v3 +#define GOAMD64_v3 +#endif +#endif + RET + // func encodeBlockAsm(dst []byte, src []byte) int // Requires: BMI, SSE2 TEXT ·encodeBlockAsm(SB), $65560-56 @@ -253,17 +262,6 @@ matchlen_loopback_repeat_extend_encodeBlockAsm: #ifdef GOAMD64_v3 TZCNTQ R11, R11 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R11, R11 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R11, R11 @@ -476,6 +474,90 @@ four_bytes_remain_repeat_as_copy_encodeBlockAsm: two_byte_offset_repeat_as_copy_encodeBlockAsm: CMPL SI, $0x40 JLE two_byte_offset_short_repeat_as_copy_encodeBlockAsm + CMPL DI, $0x00000800 + JAE long_offset_short_repeat_as_copy_encodeBlockAsm + MOVL $0x00000001, R8 + LEAL 16(R8), R8 + MOVB DI, 1(AX) + MOVL DI, R9 + SHRL $0x08, R9 + SHLL $0x05, R9 + ORL R9, R8 + MOVB R8, (AX) + ADDQ $0x02, AX + SUBL $0x08, SI + + // emitRepeat + LEAL -4(SI), SI + JMP cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + +emit_repeat_again_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b: + MOVL SI, R8 + LEAL -4(SI), SI + CMPL R8, $0x08 + JLE repeat_two_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + CMPL R8, $0x0c + JGE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + CMPL DI, $0x00000800 + JLT repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + +cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b: + CMPL SI, $0x00000104 + JLT repeat_three_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + CMPL SI, $0x00010100 + JLT repeat_four_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + CMPL SI, $0x0100ffff + JLT repeat_five_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + LEAL -16842747(SI), SI + MOVW $0x001d, (AX) + MOVW $0xfffb, 2(AX) + MOVB $0xff, 4(AX) + ADDQ $0x05, AX + JMP emit_repeat_again_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + +repeat_five_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b: + LEAL -65536(SI), SI + MOVL SI, DI + MOVW $0x001d, (AX) + MOVW SI, 2(AX) + SARL $0x10, DI + MOVB DI, 4(AX) + ADDQ $0x05, AX + JMP repeat_end_emit_encodeBlockAsm + +repeat_four_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b: + LEAL -256(SI), SI + MOVW $0x0019, (AX) + MOVW SI, 2(AX) + ADDQ $0x04, AX + JMP repeat_end_emit_encodeBlockAsm + +repeat_three_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b: + LEAL -4(SI), SI + MOVW $0x0015, (AX) + MOVB SI, 2(AX) + ADDQ $0x03, AX + JMP repeat_end_emit_encodeBlockAsm + +repeat_two_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b: + SHLL $0x02, SI + ORL $0x01, SI + MOVW SI, (AX) + ADDQ $0x02, AX + JMP repeat_end_emit_encodeBlockAsm + +repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b: + XORQ R8, R8 + LEAL 1(R8)(SI*4), SI + MOVB DI, 1(AX) + SARL $0x08, DI + SHLL $0x05, DI + ORL DI, SI + MOVB SI, (AX) + ADDQ $0x02, AX + JMP repeat_end_emit_encodeBlockAsm + +long_offset_short_repeat_as_copy_encodeBlockAsm: MOVB $0xee, (AX) MOVW DI, 1(AX) LEAL -60(SI), SI @@ -791,17 +873,6 @@ matchlen_loopback_match_nolit_encodeBlockAsm: #ifdef GOAMD64_v3 TZCNTQ R9, R9 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R9, R9 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R9, R9 @@ -944,6 +1015,90 @@ four_bytes_remain_match_nolit_encodeBlockAsm: two_byte_offset_match_nolit_encodeBlockAsm: CMPL R10, $0x40 JLE two_byte_offset_short_match_nolit_encodeBlockAsm + CMPL SI, $0x00000800 + JAE long_offset_short_match_nolit_encodeBlockAsm + MOVL $0x00000001, DI + LEAL 16(DI), DI + MOVB SI, 1(AX) + MOVL SI, R8 + SHRL $0x08, R8 + SHLL $0x05, R8 + ORL R8, DI + MOVB DI, (AX) + ADDQ $0x02, AX + SUBL $0x08, R10 + + // emitRepeat + LEAL -4(R10), R10 + JMP cant_repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short_2b + +emit_repeat_again_match_nolit_encodeBlockAsm_emit_copy_short_2b: + MOVL R10, DI + LEAL -4(R10), R10 + CMPL DI, $0x08 + JLE repeat_two_match_nolit_encodeBlockAsm_emit_copy_short_2b + CMPL DI, $0x0c + JGE cant_repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short_2b + CMPL SI, $0x00000800 + JLT repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short_2b + +cant_repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short_2b: + CMPL R10, $0x00000104 + JLT repeat_three_match_nolit_encodeBlockAsm_emit_copy_short_2b + CMPL R10, $0x00010100 + JLT repeat_four_match_nolit_encodeBlockAsm_emit_copy_short_2b + CMPL R10, $0x0100ffff + JLT repeat_five_match_nolit_encodeBlockAsm_emit_copy_short_2b + LEAL -16842747(R10), R10 + MOVW $0x001d, (AX) + MOVW $0xfffb, 2(AX) + MOVB $0xff, 4(AX) + ADDQ $0x05, AX + JMP emit_repeat_again_match_nolit_encodeBlockAsm_emit_copy_short_2b + +repeat_five_match_nolit_encodeBlockAsm_emit_copy_short_2b: + LEAL -65536(R10), R10 + MOVL R10, SI + MOVW $0x001d, (AX) + MOVW R10, 2(AX) + SARL $0x10, SI + MOVB SI, 4(AX) + ADDQ $0x05, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm + +repeat_four_match_nolit_encodeBlockAsm_emit_copy_short_2b: + LEAL -256(R10), R10 + MOVW $0x0019, (AX) + MOVW R10, 2(AX) + ADDQ $0x04, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm + +repeat_three_match_nolit_encodeBlockAsm_emit_copy_short_2b: + LEAL -4(R10), R10 + MOVW $0x0015, (AX) + MOVB R10, 2(AX) + ADDQ $0x03, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm + +repeat_two_match_nolit_encodeBlockAsm_emit_copy_short_2b: + SHLL $0x02, R10 + ORL $0x01, R10 + MOVW R10, (AX) + ADDQ $0x02, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm + +repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short_2b: + XORQ DI, DI + LEAL 1(DI)(R10*4), R10 + MOVB SI, 1(AX) + SARL $0x08, SI + SHLL $0x05, SI + ORL SI, R10 + MOVB R10, (AX) + ADDQ $0x02, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm + +long_offset_short_match_nolit_encodeBlockAsm: MOVB $0xee, (AX) MOVW SI, 1(AX) LEAL -60(R10), R10 @@ -1134,17 +1289,36 @@ memmove_emit_remainder_encodeBlockAsm: MOVL SI, BX // genMemMoveShort + CMPQ BX, $0x03 + JB emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_1or2 + JE emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_3 CMPQ BX, $0x08 - JLE emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_8 + JB emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_4through7 CMPQ BX, $0x10 JBE emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_8through16 CMPQ BX, $0x20 JBE emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_17through32 JMP emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_33through64 -emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_8: - MOVQ (CX), SI - MOVQ SI, (AX) +emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_1or2: + MOVB (CX), SI + MOVB -1(CX)(BX*1), CL + MOVB SI, (AX) + MOVB CL, -1(AX)(BX*1) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm + +emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_3: + MOVW (CX), SI + MOVB 2(CX), CL + MOVW SI, (AX) + MOVB CL, 2(AX) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm + +emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_4through7: + MOVL (CX), SI + MOVL -4(CX)(BX*1), CX + MOVL SI, (AX) + MOVL CX, -4(AX)(BX*1) JMP memmove_end_copy_emit_remainder_encodeBlockAsm emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_8through16: @@ -1466,17 +1640,6 @@ matchlen_loopback_repeat_extend_encodeBlockAsm4MB: #ifdef GOAMD64_v3 TZCNTQ R11, R11 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R11, R11 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R11, R11 @@ -1667,6 +1830,77 @@ four_bytes_remain_repeat_as_copy_encodeBlockAsm4MB: two_byte_offset_repeat_as_copy_encodeBlockAsm4MB: CMPL SI, $0x40 JLE two_byte_offset_short_repeat_as_copy_encodeBlockAsm4MB + CMPL DI, $0x00000800 + JAE long_offset_short_repeat_as_copy_encodeBlockAsm4MB + MOVL $0x00000001, R8 + LEAL 16(R8), R8 + MOVB DI, 1(AX) + SHRL $0x08, DI + SHLL $0x05, DI + ORL DI, R8 + MOVB R8, (AX) + ADDQ $0x02, AX + SUBL $0x08, SI + + // emitRepeat + LEAL -4(SI), SI + JMP cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b + MOVL SI, R8 + LEAL -4(SI), SI + CMPL R8, $0x08 + JLE repeat_two_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b + CMPL R8, $0x0c + JGE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b + CMPL DI, $0x00000800 + JLT repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b + +cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b: + CMPL SI, $0x00000104 + JLT repeat_three_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b + CMPL SI, $0x00010100 + JLT repeat_four_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b + LEAL -65536(SI), SI + MOVL SI, DI + MOVW $0x001d, (AX) + MOVW SI, 2(AX) + SARL $0x10, DI + MOVB DI, 4(AX) + ADDQ $0x05, AX + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_four_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b: + LEAL -256(SI), SI + MOVW $0x0019, (AX) + MOVW SI, 2(AX) + ADDQ $0x04, AX + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_three_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b: + LEAL -4(SI), SI + MOVW $0x0015, (AX) + MOVB SI, 2(AX) + ADDQ $0x03, AX + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_two_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b: + SHLL $0x02, SI + ORL $0x01, SI + MOVW SI, (AX) + ADDQ $0x02, AX + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b: + XORQ R8, R8 + LEAL 1(R8)(SI*4), SI + MOVB DI, 1(AX) + SARL $0x08, DI + SHLL $0x05, DI + ORL DI, SI + MOVB SI, (AX) + ADDQ $0x02, AX + JMP repeat_end_emit_encodeBlockAsm4MB + +long_offset_short_repeat_as_copy_encodeBlockAsm4MB: MOVB $0xee, (AX) MOVW DI, 1(AX) LEAL -60(SI), SI @@ -1963,17 +2197,6 @@ matchlen_loopback_match_nolit_encodeBlockAsm4MB: #ifdef GOAMD64_v3 TZCNTQ R9, R9 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R9, R9 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R9, R9 @@ -2105,26 +2328,35 @@ four_bytes_remain_match_nolit_encodeBlockAsm4MB: two_byte_offset_match_nolit_encodeBlockAsm4MB: CMPL R10, $0x40 JLE two_byte_offset_short_match_nolit_encodeBlockAsm4MB - MOVB $0xee, (AX) - MOVW SI, 1(AX) - LEAL -60(R10), R10 - ADDQ $0x03, AX + CMPL SI, $0x00000800 + JAE long_offset_short_match_nolit_encodeBlockAsm4MB + MOVL $0x00000001, DI + LEAL 16(DI), DI + MOVB SI, 1(AX) + SHRL $0x08, SI + SHLL $0x05, SI + ORL SI, DI + MOVB DI, (AX) + ADDQ $0x02, AX + SUBL $0x08, R10 // emitRepeat + LEAL -4(R10), R10 + JMP cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b MOVL R10, DI LEAL -4(R10), R10 CMPL DI, $0x08 - JLE repeat_two_match_nolit_encodeBlockAsm4MB_emit_copy_short + JLE repeat_two_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b CMPL DI, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short + JGE cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b CMPL SI, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short + JLT repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b -cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short: +cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b: CMPL R10, $0x00000104 - JLT repeat_three_match_nolit_encodeBlockAsm4MB_emit_copy_short + JLT repeat_three_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b CMPL R10, $0x00010100 - JLT repeat_four_match_nolit_encodeBlockAsm4MB_emit_copy_short + JLT repeat_four_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b LEAL -65536(R10), R10 MOVL R10, SI MOVW $0x001d, (AX) @@ -2134,28 +2366,28 @@ cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short: ADDQ $0x05, AX JMP match_nolit_emitcopy_end_encodeBlockAsm4MB -repeat_four_match_nolit_encodeBlockAsm4MB_emit_copy_short: +repeat_four_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b: LEAL -256(R10), R10 MOVW $0x0019, (AX) MOVW R10, 2(AX) ADDQ $0x04, AX JMP match_nolit_emitcopy_end_encodeBlockAsm4MB -repeat_three_match_nolit_encodeBlockAsm4MB_emit_copy_short: +repeat_three_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b: LEAL -4(R10), R10 MOVW $0x0015, (AX) MOVB R10, 2(AX) ADDQ $0x03, AX JMP match_nolit_emitcopy_end_encodeBlockAsm4MB -repeat_two_match_nolit_encodeBlockAsm4MB_emit_copy_short: +repeat_two_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b: SHLL $0x02, R10 ORL $0x01, R10 MOVW R10, (AX) ADDQ $0x02, AX JMP match_nolit_emitcopy_end_encodeBlockAsm4MB -repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short: +repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b: XORQ DI, DI LEAL 1(DI)(R10*4), R10 MOVB SI, 1(AX) @@ -2165,17 +2397,79 @@ repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short: MOVB R10, (AX) ADDQ $0x02, AX JMP match_nolit_emitcopy_end_encodeBlockAsm4MB - JMP two_byte_offset_match_nolit_encodeBlockAsm4MB -two_byte_offset_short_match_nolit_encodeBlockAsm4MB: - CMPL R10, $0x0c - JGE emit_copy_three_match_nolit_encodeBlockAsm4MB - CMPL SI, $0x00000800 - JGE emit_copy_three_match_nolit_encodeBlockAsm4MB - MOVB $0x01, BL - LEAL -16(BX)(R10*4), R10 - MOVB SI, 1(AX) - SHRL $0x08, SI +long_offset_short_match_nolit_encodeBlockAsm4MB: + MOVB $0xee, (AX) + MOVW SI, 1(AX) + LEAL -60(R10), R10 + ADDQ $0x03, AX + + // emitRepeat + MOVL R10, DI + LEAL -4(R10), R10 + CMPL DI, $0x08 + JLE repeat_two_match_nolit_encodeBlockAsm4MB_emit_copy_short + CMPL DI, $0x0c + JGE cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short + CMPL SI, $0x00000800 + JLT repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short + +cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short: + CMPL R10, $0x00000104 + JLT repeat_three_match_nolit_encodeBlockAsm4MB_emit_copy_short + CMPL R10, $0x00010100 + JLT repeat_four_match_nolit_encodeBlockAsm4MB_emit_copy_short + LEAL -65536(R10), R10 + MOVL R10, SI + MOVW $0x001d, (AX) + MOVW R10, 2(AX) + SARL $0x10, SI + MOVB SI, 4(AX) + ADDQ $0x05, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +repeat_four_match_nolit_encodeBlockAsm4MB_emit_copy_short: + LEAL -256(R10), R10 + MOVW $0x0019, (AX) + MOVW R10, 2(AX) + ADDQ $0x04, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +repeat_three_match_nolit_encodeBlockAsm4MB_emit_copy_short: + LEAL -4(R10), R10 + MOVW $0x0015, (AX) + MOVB R10, 2(AX) + ADDQ $0x03, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +repeat_two_match_nolit_encodeBlockAsm4MB_emit_copy_short: + SHLL $0x02, R10 + ORL $0x01, R10 + MOVW R10, (AX) + ADDQ $0x02, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short: + XORQ DI, DI + LEAL 1(DI)(R10*4), R10 + MOVB SI, 1(AX) + SARL $0x08, SI + SHLL $0x05, SI + ORL SI, R10 + MOVB R10, (AX) + ADDQ $0x02, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + JMP two_byte_offset_match_nolit_encodeBlockAsm4MB + +two_byte_offset_short_match_nolit_encodeBlockAsm4MB: + CMPL R10, $0x0c + JGE emit_copy_three_match_nolit_encodeBlockAsm4MB + CMPL SI, $0x00000800 + JGE emit_copy_three_match_nolit_encodeBlockAsm4MB + MOVB $0x01, BL + LEAL -16(BX)(R10*4), R10 + MOVB SI, 1(AX) + SHRL $0x08, SI SHLL $0x05, SI ORL SI, R10 MOVB R10, (AX) @@ -2276,17 +2570,36 @@ memmove_emit_remainder_encodeBlockAsm4MB: MOVL SI, BX // genMemMoveShort + CMPQ BX, $0x03 + JB emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_1or2 + JE emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_3 CMPQ BX, $0x08 - JLE emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_8 + JB emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_4through7 CMPQ BX, $0x10 JBE emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_8through16 CMPQ BX, $0x20 JBE emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_17through32 JMP emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_33through64 -emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_8: - MOVQ (CX), SI - MOVQ SI, (AX) +emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_1or2: + MOVB (CX), SI + MOVB -1(CX)(BX*1), CL + MOVB SI, (AX) + MOVB CL, -1(AX)(BX*1) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm4MB + +emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_3: + MOVW (CX), SI + MOVB 2(CX), CL + MOVW SI, (AX) + MOVB CL, 2(AX) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm4MB + +emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_4through7: + MOVL (CX), SI + MOVL -4(CX)(BX*1), CX + MOVL SI, (AX) + MOVL CX, -4(AX)(BX*1) JMP memmove_end_copy_emit_remainder_encodeBlockAsm4MB emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_8through16: @@ -2597,17 +2910,6 @@ matchlen_loopback_repeat_extend_encodeBlockAsm12B: #ifdef GOAMD64_v3 TZCNTQ R11, R11 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R11, R11 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R11, R11 @@ -2706,6 +3008,65 @@ repeat_as_copy_encodeBlockAsm12B: two_byte_offset_repeat_as_copy_encodeBlockAsm12B: CMPL SI, $0x40 JLE two_byte_offset_short_repeat_as_copy_encodeBlockAsm12B + CMPL DI, $0x00000800 + JAE long_offset_short_repeat_as_copy_encodeBlockAsm12B + MOVL $0x00000001, R8 + LEAL 16(R8), R8 + MOVB DI, 1(AX) + SHRL $0x08, DI + SHLL $0x05, DI + ORL DI, R8 + MOVB R8, (AX) + ADDQ $0x02, AX + SUBL $0x08, SI + + // emitRepeat + LEAL -4(SI), SI + JMP cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b + MOVL SI, R8 + LEAL -4(SI), SI + CMPL R8, $0x08 + JLE repeat_two_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b + CMPL R8, $0x0c + JGE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b + CMPL DI, $0x00000800 + JLT repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b + +cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b: + CMPL SI, $0x00000104 + JLT repeat_three_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b + LEAL -256(SI), SI + MOVW $0x0019, (AX) + MOVW SI, 2(AX) + ADDQ $0x04, AX + JMP repeat_end_emit_encodeBlockAsm12B + +repeat_three_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b: + LEAL -4(SI), SI + MOVW $0x0015, (AX) + MOVB SI, 2(AX) + ADDQ $0x03, AX + JMP repeat_end_emit_encodeBlockAsm12B + +repeat_two_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b: + SHLL $0x02, SI + ORL $0x01, SI + MOVW SI, (AX) + ADDQ $0x02, AX + JMP repeat_end_emit_encodeBlockAsm12B + +repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b: + XORQ R8, R8 + LEAL 1(R8)(SI*4), SI + MOVB DI, 1(AX) + SARL $0x08, DI + SHLL $0x05, DI + ORL DI, SI + MOVB SI, (AX) + ADDQ $0x02, AX + JMP repeat_end_emit_encodeBlockAsm12B + +long_offset_short_repeat_as_copy_encodeBlockAsm12B: MOVB $0xee, (AX) MOVW DI, 1(AX) LEAL -60(SI), SI @@ -2979,17 +3340,6 @@ matchlen_loopback_match_nolit_encodeBlockAsm12B: #ifdef GOAMD64_v3 TZCNTQ R9, R9 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R9, R9 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R9, R9 @@ -3041,6 +3391,65 @@ match_nolit_end_encodeBlockAsm12B: two_byte_offset_match_nolit_encodeBlockAsm12B: CMPL R10, $0x40 JLE two_byte_offset_short_match_nolit_encodeBlockAsm12B + CMPL SI, $0x00000800 + JAE long_offset_short_match_nolit_encodeBlockAsm12B + MOVL $0x00000001, DI + LEAL 16(DI), DI + MOVB SI, 1(AX) + SHRL $0x08, SI + SHLL $0x05, SI + ORL SI, DI + MOVB DI, (AX) + ADDQ $0x02, AX + SUBL $0x08, R10 + + // emitRepeat + LEAL -4(R10), R10 + JMP cant_repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short_2b + MOVL R10, DI + LEAL -4(R10), R10 + CMPL DI, $0x08 + JLE repeat_two_match_nolit_encodeBlockAsm12B_emit_copy_short_2b + CMPL DI, $0x0c + JGE cant_repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short_2b + CMPL SI, $0x00000800 + JLT repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short_2b + +cant_repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short_2b: + CMPL R10, $0x00000104 + JLT repeat_three_match_nolit_encodeBlockAsm12B_emit_copy_short_2b + LEAL -256(R10), R10 + MOVW $0x0019, (AX) + MOVW R10, 2(AX) + ADDQ $0x04, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm12B + +repeat_three_match_nolit_encodeBlockAsm12B_emit_copy_short_2b: + LEAL -4(R10), R10 + MOVW $0x0015, (AX) + MOVB R10, 2(AX) + ADDQ $0x03, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm12B + +repeat_two_match_nolit_encodeBlockAsm12B_emit_copy_short_2b: + SHLL $0x02, R10 + ORL $0x01, R10 + MOVW R10, (AX) + ADDQ $0x02, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm12B + +repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short_2b: + XORQ DI, DI + LEAL 1(DI)(R10*4), R10 + MOVB SI, 1(AX) + SARL $0x08, SI + SHLL $0x05, SI + ORL SI, R10 + MOVB R10, (AX) + ADDQ $0x02, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm12B + +long_offset_short_match_nolit_encodeBlockAsm12B: MOVB $0xee, (AX) MOVW SI, 1(AX) LEAL -60(R10), R10 @@ -3189,17 +3598,36 @@ memmove_emit_remainder_encodeBlockAsm12B: MOVL SI, BX // genMemMoveShort + CMPQ BX, $0x03 + JB emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_1or2 + JE emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_3 CMPQ BX, $0x08 - JLE emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_8 + JB emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_4through7 CMPQ BX, $0x10 JBE emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_8through16 CMPQ BX, $0x20 JBE emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_17through32 JMP emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_33through64 -emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_8: - MOVQ (CX), SI - MOVQ SI, (AX) +emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_1or2: + MOVB (CX), SI + MOVB -1(CX)(BX*1), CL + MOVB SI, (AX) + MOVB CL, -1(AX)(BX*1) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_3: + MOVW (CX), SI + MOVB 2(CX), CL + MOVW SI, (AX) + MOVB CL, 2(AX) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_4through7: + MOVL (CX), SI + MOVL -4(CX)(BX*1), CX + MOVL SI, (AX) + MOVL CX, -4(AX)(BX*1) JMP memmove_end_copy_emit_remainder_encodeBlockAsm12B emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_8through16: @@ -3510,17 +3938,6 @@ matchlen_loopback_repeat_extend_encodeBlockAsm10B: #ifdef GOAMD64_v3 TZCNTQ R11, R11 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R11, R11 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R11, R11 @@ -3619,6 +4036,65 @@ repeat_as_copy_encodeBlockAsm10B: two_byte_offset_repeat_as_copy_encodeBlockAsm10B: CMPL SI, $0x40 JLE two_byte_offset_short_repeat_as_copy_encodeBlockAsm10B + CMPL DI, $0x00000800 + JAE long_offset_short_repeat_as_copy_encodeBlockAsm10B + MOVL $0x00000001, R8 + LEAL 16(R8), R8 + MOVB DI, 1(AX) + SHRL $0x08, DI + SHLL $0x05, DI + ORL DI, R8 + MOVB R8, (AX) + ADDQ $0x02, AX + SUBL $0x08, SI + + // emitRepeat + LEAL -4(SI), SI + JMP cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b + MOVL SI, R8 + LEAL -4(SI), SI + CMPL R8, $0x08 + JLE repeat_two_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b + CMPL R8, $0x0c + JGE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b + CMPL DI, $0x00000800 + JLT repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b + +cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b: + CMPL SI, $0x00000104 + JLT repeat_three_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b + LEAL -256(SI), SI + MOVW $0x0019, (AX) + MOVW SI, 2(AX) + ADDQ $0x04, AX + JMP repeat_end_emit_encodeBlockAsm10B + +repeat_three_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b: + LEAL -4(SI), SI + MOVW $0x0015, (AX) + MOVB SI, 2(AX) + ADDQ $0x03, AX + JMP repeat_end_emit_encodeBlockAsm10B + +repeat_two_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b: + SHLL $0x02, SI + ORL $0x01, SI + MOVW SI, (AX) + ADDQ $0x02, AX + JMP repeat_end_emit_encodeBlockAsm10B + +repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b: + XORQ R8, R8 + LEAL 1(R8)(SI*4), SI + MOVB DI, 1(AX) + SARL $0x08, DI + SHLL $0x05, DI + ORL DI, SI + MOVB SI, (AX) + ADDQ $0x02, AX + JMP repeat_end_emit_encodeBlockAsm10B + +long_offset_short_repeat_as_copy_encodeBlockAsm10B: MOVB $0xee, (AX) MOVW DI, 1(AX) LEAL -60(SI), SI @@ -3892,17 +4368,6 @@ matchlen_loopback_match_nolit_encodeBlockAsm10B: #ifdef GOAMD64_v3 TZCNTQ R9, R9 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R9, R9 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R9, R9 @@ -3954,6 +4419,65 @@ match_nolit_end_encodeBlockAsm10B: two_byte_offset_match_nolit_encodeBlockAsm10B: CMPL R10, $0x40 JLE two_byte_offset_short_match_nolit_encodeBlockAsm10B + CMPL SI, $0x00000800 + JAE long_offset_short_match_nolit_encodeBlockAsm10B + MOVL $0x00000001, DI + LEAL 16(DI), DI + MOVB SI, 1(AX) + SHRL $0x08, SI + SHLL $0x05, SI + ORL SI, DI + MOVB DI, (AX) + ADDQ $0x02, AX + SUBL $0x08, R10 + + // emitRepeat + LEAL -4(R10), R10 + JMP cant_repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short_2b + MOVL R10, DI + LEAL -4(R10), R10 + CMPL DI, $0x08 + JLE repeat_two_match_nolit_encodeBlockAsm10B_emit_copy_short_2b + CMPL DI, $0x0c + JGE cant_repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short_2b + CMPL SI, $0x00000800 + JLT repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short_2b + +cant_repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short_2b: + CMPL R10, $0x00000104 + JLT repeat_three_match_nolit_encodeBlockAsm10B_emit_copy_short_2b + LEAL -256(R10), R10 + MOVW $0x0019, (AX) + MOVW R10, 2(AX) + ADDQ $0x04, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm10B + +repeat_three_match_nolit_encodeBlockAsm10B_emit_copy_short_2b: + LEAL -4(R10), R10 + MOVW $0x0015, (AX) + MOVB R10, 2(AX) + ADDQ $0x03, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm10B + +repeat_two_match_nolit_encodeBlockAsm10B_emit_copy_short_2b: + SHLL $0x02, R10 + ORL $0x01, R10 + MOVW R10, (AX) + ADDQ $0x02, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm10B + +repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short_2b: + XORQ DI, DI + LEAL 1(DI)(R10*4), R10 + MOVB SI, 1(AX) + SARL $0x08, SI + SHLL $0x05, SI + ORL SI, R10 + MOVB R10, (AX) + ADDQ $0x02, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm10B + +long_offset_short_match_nolit_encodeBlockAsm10B: MOVB $0xee, (AX) MOVW SI, 1(AX) LEAL -60(R10), R10 @@ -4102,17 +4626,36 @@ memmove_emit_remainder_encodeBlockAsm10B: MOVL SI, BX // genMemMoveShort + CMPQ BX, $0x03 + JB emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_1or2 + JE emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_3 CMPQ BX, $0x08 - JLE emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_8 + JB emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_4through7 CMPQ BX, $0x10 JBE emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_8through16 CMPQ BX, $0x20 JBE emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_17through32 JMP emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_33through64 -emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_8: - MOVQ (CX), SI - MOVQ SI, (AX) +emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_1or2: + MOVB (CX), SI + MOVB -1(CX)(BX*1), CL + MOVB SI, (AX) + MOVB CL, -1(AX)(BX*1) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_3: + MOVW (CX), SI + MOVB 2(CX), CL + MOVW SI, (AX) + MOVB CL, 2(AX) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_4through7: + MOVL (CX), SI + MOVL -4(CX)(BX*1), CX + MOVL SI, (AX) + MOVL CX, -4(AX)(BX*1) JMP memmove_end_copy_emit_remainder_encodeBlockAsm10B emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_8through16: @@ -4423,17 +4966,6 @@ matchlen_loopback_repeat_extend_encodeBlockAsm8B: #ifdef GOAMD64_v3 TZCNTQ R11, R11 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R11, R11 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R11, R11 @@ -4528,6 +5060,61 @@ repeat_as_copy_encodeBlockAsm8B: two_byte_offset_repeat_as_copy_encodeBlockAsm8B: CMPL SI, $0x40 JLE two_byte_offset_short_repeat_as_copy_encodeBlockAsm8B + CMPL DI, $0x00000800 + JAE long_offset_short_repeat_as_copy_encodeBlockAsm8B + MOVL $0x00000001, R8 + LEAL 16(R8), R8 + MOVB DI, 1(AX) + SHRL $0x08, DI + SHLL $0x05, DI + ORL DI, R8 + MOVB R8, (AX) + ADDQ $0x02, AX + SUBL $0x08, SI + + // emitRepeat + LEAL -4(SI), SI + JMP cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b + MOVL SI, DI + LEAL -4(SI), SI + CMPL DI, $0x08 + JLE repeat_two_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b + CMPL DI, $0x0c + JGE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b + +cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b: + CMPL SI, $0x00000104 + JLT repeat_three_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b + LEAL -256(SI), SI + MOVW $0x0019, (AX) + MOVW SI, 2(AX) + ADDQ $0x04, AX + JMP repeat_end_emit_encodeBlockAsm8B + +repeat_three_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b: + LEAL -4(SI), SI + MOVW $0x0015, (AX) + MOVB SI, 2(AX) + ADDQ $0x03, AX + JMP repeat_end_emit_encodeBlockAsm8B + +repeat_two_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b: + SHLL $0x02, SI + ORL $0x01, SI + MOVW SI, (AX) + ADDQ $0x02, AX + JMP repeat_end_emit_encodeBlockAsm8B + XORQ R8, R8 + LEAL 1(R8)(SI*4), SI + MOVB DI, 1(AX) + SARL $0x08, DI + SHLL $0x05, DI + ORL DI, SI + MOVB SI, (AX) + ADDQ $0x02, AX + JMP repeat_end_emit_encodeBlockAsm8B + +long_offset_short_repeat_as_copy_encodeBlockAsm8B: MOVB $0xee, (AX) MOVW DI, 1(AX) LEAL -60(SI), SI @@ -4795,17 +5382,6 @@ matchlen_loopback_match_nolit_encodeBlockAsm8B: #ifdef GOAMD64_v3 TZCNTQ R9, R9 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R9, R9 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R9, R9 @@ -4839,24 +5415,79 @@ matchlen_match2_match_nolit_encodeBlockAsm8B: SUBL $0x02, DI LEAL 2(R10), R10 -matchlen_match1_match_nolit_encodeBlockAsm8B: - CMPL DI, $0x01 - JL match_nolit_end_encodeBlockAsm8B - MOVB (R8)(R10*1), R9 - CMPB (SI)(R10*1), R9 - JNE match_nolit_end_encodeBlockAsm8B - LEAL 1(R10), R10 +matchlen_match1_match_nolit_encodeBlockAsm8B: + CMPL DI, $0x01 + JL match_nolit_end_encodeBlockAsm8B + MOVB (R8)(R10*1), R9 + CMPB (SI)(R10*1), R9 + JNE match_nolit_end_encodeBlockAsm8B + LEAL 1(R10), R10 + +match_nolit_end_encodeBlockAsm8B: + ADDL R10, CX + MOVL 16(SP), SI + ADDL $0x04, R10 + MOVL CX, 12(SP) + + // emitCopy +two_byte_offset_match_nolit_encodeBlockAsm8B: + CMPL R10, $0x40 + JLE two_byte_offset_short_match_nolit_encodeBlockAsm8B + CMPL SI, $0x00000800 + JAE long_offset_short_match_nolit_encodeBlockAsm8B + MOVL $0x00000001, DI + LEAL 16(DI), DI + MOVB SI, 1(AX) + SHRL $0x08, SI + SHLL $0x05, SI + ORL SI, DI + MOVB DI, (AX) + ADDQ $0x02, AX + SUBL $0x08, R10 + + // emitRepeat + LEAL -4(R10), R10 + JMP cant_repeat_two_offset_match_nolit_encodeBlockAsm8B_emit_copy_short_2b + MOVL R10, SI + LEAL -4(R10), R10 + CMPL SI, $0x08 + JLE repeat_two_match_nolit_encodeBlockAsm8B_emit_copy_short_2b + CMPL SI, $0x0c + JGE cant_repeat_two_offset_match_nolit_encodeBlockAsm8B_emit_copy_short_2b + +cant_repeat_two_offset_match_nolit_encodeBlockAsm8B_emit_copy_short_2b: + CMPL R10, $0x00000104 + JLT repeat_three_match_nolit_encodeBlockAsm8B_emit_copy_short_2b + LEAL -256(R10), R10 + MOVW $0x0019, (AX) + MOVW R10, 2(AX) + ADDQ $0x04, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm8B + +repeat_three_match_nolit_encodeBlockAsm8B_emit_copy_short_2b: + LEAL -4(R10), R10 + MOVW $0x0015, (AX) + MOVB R10, 2(AX) + ADDQ $0x03, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm8B -match_nolit_end_encodeBlockAsm8B: - ADDL R10, CX - MOVL 16(SP), SI - ADDL $0x04, R10 - MOVL CX, 12(SP) +repeat_two_match_nolit_encodeBlockAsm8B_emit_copy_short_2b: + SHLL $0x02, R10 + ORL $0x01, R10 + MOVW R10, (AX) + ADDQ $0x02, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm8B + XORQ DI, DI + LEAL 1(DI)(R10*4), R10 + MOVB SI, 1(AX) + SARL $0x08, SI + SHLL $0x05, SI + ORL SI, R10 + MOVB R10, (AX) + ADDQ $0x02, AX + JMP match_nolit_emitcopy_end_encodeBlockAsm8B - // emitCopy -two_byte_offset_match_nolit_encodeBlockAsm8B: - CMPL R10, $0x40 - JLE two_byte_offset_short_match_nolit_encodeBlockAsm8B +long_offset_short_match_nolit_encodeBlockAsm8B: MOVB $0xee, (AX) MOVW SI, 1(AX) LEAL -60(R10), R10 @@ -4999,17 +5630,36 @@ memmove_emit_remainder_encodeBlockAsm8B: MOVL SI, BX // genMemMoveShort + CMPQ BX, $0x03 + JB emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_1or2 + JE emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_3 CMPQ BX, $0x08 - JLE emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_8 + JB emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_4through7 CMPQ BX, $0x10 JBE emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_8through16 CMPQ BX, $0x20 JBE emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_17through32 JMP emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_33through64 -emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_8: - MOVQ (CX), SI - MOVQ SI, (AX) +emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_1or2: + MOVB (CX), SI + MOVB -1(CX)(BX*1), CL + MOVB SI, (AX) + MOVB CL, -1(AX)(BX*1) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_3: + MOVW (CX), SI + MOVB 2(CX), CL + MOVW SI, (AX) + MOVB CL, 2(AX) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_4through7: + MOVL (CX), SI + MOVL -4(CX)(BX*1), CX + MOVL SI, (AX) + MOVL CX, -4(AX)(BX*1) JMP memmove_end_copy_emit_remainder_encodeBlockAsm8B emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_8through16: @@ -5225,17 +5875,6 @@ matchlen_loopback_match_nolit_encodeBetterBlockAsm: #ifdef GOAMD64_v3 TZCNTQ R11, R11 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R11, R11 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R11, R11 @@ -5541,6 +6180,90 @@ four_bytes_remain_match_nolit_encodeBetterBlockAsm: two_byte_offset_match_nolit_encodeBetterBlockAsm: CMPL R12, $0x40 JLE two_byte_offset_short_match_nolit_encodeBetterBlockAsm + CMPL R8, $0x00000800 + JAE long_offset_short_match_nolit_encodeBetterBlockAsm + MOVL $0x00000001, SI + LEAL 16(SI), SI + MOVB R8, 1(AX) + MOVL R8, R9 + SHRL $0x08, R9 + SHLL $0x05, R9 + ORL R9, SI + MOVB SI, (AX) + ADDQ $0x02, AX + SUBL $0x08, R12 + + // emitRepeat + LEAL -4(R12), R12 + JMP cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + +emit_repeat_again_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b: + MOVL R12, SI + LEAL -4(R12), R12 + CMPL SI, $0x08 + JLE repeat_two_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + CMPL SI, $0x0c + JGE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + CMPL R8, $0x00000800 + JLT repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + +cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b: + CMPL R12, $0x00000104 + JLT repeat_three_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + CMPL R12, $0x00010100 + JLT repeat_four_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + CMPL R12, $0x0100ffff + JLT repeat_five_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + LEAL -16842747(R12), R12 + MOVW $0x001d, (AX) + MOVW $0xfffb, 2(AX) + MOVB $0xff, 4(AX) + ADDQ $0x05, AX + JMP emit_repeat_again_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + +repeat_five_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b: + LEAL -65536(R12), R12 + MOVL R12, R8 + MOVW $0x001d, (AX) + MOVW R12, 2(AX) + SARL $0x10, R8 + MOVB R8, 4(AX) + ADDQ $0x05, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +repeat_four_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b: + LEAL -256(R12), R12 + MOVW $0x0019, (AX) + MOVW R12, 2(AX) + ADDQ $0x04, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +repeat_three_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b: + LEAL -4(R12), R12 + MOVW $0x0015, (AX) + MOVB R12, 2(AX) + ADDQ $0x03, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +repeat_two_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b: + SHLL $0x02, R12 + ORL $0x01, R12 + MOVW R12, (AX) + ADDQ $0x02, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b: + XORQ SI, SI + LEAL 1(SI)(R12*4), R12 + MOVB R8, 1(AX) + SARL $0x08, R8 + SHLL $0x05, R8 + ORL R8, R12 + MOVB R12, (AX) + ADDQ $0x02, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +long_offset_short_match_nolit_encodeBetterBlockAsm: MOVB $0xee, (AX) MOVW R8, 1(AX) LEAL -60(R12), R12 @@ -5979,8 +6702,9 @@ memmove_emit_remainder_encodeBetterBlockAsm: MOVL SI, BX // genMemMoveShort - CMPQ BX, $0x04 - JLE emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_4 + CMPQ BX, $0x03 + JB emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_1or2 + JE emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_3 CMPQ BX, $0x08 JB emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_4through7 CMPQ BX, $0x10 @@ -5989,9 +6713,18 @@ memmove_emit_remainder_encodeBetterBlockAsm: JBE emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_17through32 JMP emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_33through64 -emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_4: - MOVL (CX), SI - MOVL SI, (AX) +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_1or2: + MOVB (CX), SI + MOVB -1(CX)(BX*1), CL + MOVB SI, (AX) + MOVB CL, -1(AX)(BX*1) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_3: + MOVW (CX), SI + MOVB 2(CX), CL + MOVW SI, (AX) + MOVB CL, 2(AX) JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_4through7: @@ -6214,17 +6947,6 @@ matchlen_loopback_match_nolit_encodeBetterBlockAsm4MB: #ifdef GOAMD64_v3 TZCNTQ R11, R11 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R11, R11 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R11, R11 @@ -6511,6 +7233,77 @@ four_bytes_remain_match_nolit_encodeBetterBlockAsm4MB: two_byte_offset_match_nolit_encodeBetterBlockAsm4MB: CMPL R12, $0x40 JLE two_byte_offset_short_match_nolit_encodeBetterBlockAsm4MB + CMPL R8, $0x00000800 + JAE long_offset_short_match_nolit_encodeBetterBlockAsm4MB + MOVL $0x00000001, SI + LEAL 16(SI), SI + MOVB R8, 1(AX) + SHRL $0x08, R8 + SHLL $0x05, R8 + ORL R8, SI + MOVB SI, (AX) + ADDQ $0x02, AX + SUBL $0x08, R12 + + // emitRepeat + LEAL -4(R12), R12 + JMP cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b + MOVL R12, SI + LEAL -4(R12), R12 + CMPL SI, $0x08 + JLE repeat_two_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b + CMPL SI, $0x0c + JGE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b + CMPL R8, $0x00000800 + JLT repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b + +cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b: + CMPL R12, $0x00000104 + JLT repeat_three_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b + CMPL R12, $0x00010100 + JLT repeat_four_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b + LEAL -65536(R12), R12 + MOVL R12, R8 + MOVW $0x001d, (AX) + MOVW R12, 2(AX) + SARL $0x10, R8 + MOVB R8, 4(AX) + ADDQ $0x05, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +repeat_four_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b: + LEAL -256(R12), R12 + MOVW $0x0019, (AX) + MOVW R12, 2(AX) + ADDQ $0x04, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +repeat_three_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b: + LEAL -4(R12), R12 + MOVW $0x0015, (AX) + MOVB R12, 2(AX) + ADDQ $0x03, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +repeat_two_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b: + SHLL $0x02, R12 + ORL $0x01, R12 + MOVW R12, (AX) + ADDQ $0x02, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b: + XORQ SI, SI + LEAL 1(SI)(R12*4), R12 + MOVB R8, 1(AX) + SARL $0x08, R8 + SHLL $0x05, R8 + ORL R8, R12 + MOVB R12, (AX) + ADDQ $0x02, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +long_offset_short_match_nolit_encodeBetterBlockAsm4MB: MOVB $0xee, (AX) MOVW R8, 1(AX) LEAL -60(R12), R12 @@ -6911,8 +7704,9 @@ memmove_emit_remainder_encodeBetterBlockAsm4MB: MOVL SI, BX // genMemMoveShort - CMPQ BX, $0x04 - JLE emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_4 + CMPQ BX, $0x03 + JB emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_1or2 + JE emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_3 CMPQ BX, $0x08 JB emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_4through7 CMPQ BX, $0x10 @@ -6921,9 +7715,18 @@ memmove_emit_remainder_encodeBetterBlockAsm4MB: JBE emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_17through32 JMP emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_33through64 -emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_4: - MOVL (CX), SI - MOVL SI, (AX) +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_1or2: + MOVB (CX), SI + MOVB -1(CX)(BX*1), CL + MOVB SI, (AX) + MOVB CL, -1(AX)(BX*1) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm4MB + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_3: + MOVW (CX), SI + MOVB 2(CX), CL + MOVW SI, (AX) + MOVB CL, 2(AX) JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm4MB emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_4through7: @@ -7138,17 +7941,6 @@ matchlen_loopback_match_nolit_encodeBetterBlockAsm12B: #ifdef GOAMD64_v3 TZCNTQ R11, R11 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R11, R11 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R11, R11 @@ -7312,29 +8104,88 @@ emit_lit_memmove_long_match_emit_encodeBetterBlockAsm12Blarge_big_loop_back: DECQ R13 JNA emit_lit_memmove_long_match_emit_encodeBetterBlockAsm12Blarge_big_loop_back -emit_lit_memmove_long_match_emit_encodeBetterBlockAsm12Blarge_forward_sse_loop_32: - MOVOU -32(R10)(R14*1), X4 - MOVOU -16(R10)(R14*1), X5 - MOVOA X4, -32(AX)(R14*1) - MOVOA X5, -16(AX)(R14*1) - ADDQ $0x20, R14 - CMPQ R9, R14 - JAE emit_lit_memmove_long_match_emit_encodeBetterBlockAsm12Blarge_forward_sse_loop_32 - MOVOU X0, (AX) - MOVOU X1, 16(AX) - MOVOU X2, -32(AX)(R9*1) - MOVOU X3, -16(AX)(R9*1) - MOVQ SI, AX +emit_lit_memmove_long_match_emit_encodeBetterBlockAsm12Blarge_forward_sse_loop_32: + MOVOU -32(R10)(R14*1), X4 + MOVOU -16(R10)(R14*1), X5 + MOVOA X4, -32(AX)(R14*1) + MOVOA X5, -16(AX)(R14*1) + ADDQ $0x20, R14 + CMPQ R9, R14 + JAE emit_lit_memmove_long_match_emit_encodeBetterBlockAsm12Blarge_forward_sse_loop_32 + MOVOU X0, (AX) + MOVOU X1, 16(AX) + MOVOU X2, -32(AX)(R9*1) + MOVOU X3, -16(AX)(R9*1) + MOVQ SI, AX + +emit_literal_done_match_emit_encodeBetterBlockAsm12B: + ADDL R12, CX + ADDL $0x04, R12 + MOVL CX, 12(SP) + + // emitCopy +two_byte_offset_match_nolit_encodeBetterBlockAsm12B: + CMPL R12, $0x40 + JLE two_byte_offset_short_match_nolit_encodeBetterBlockAsm12B + CMPL R8, $0x00000800 + JAE long_offset_short_match_nolit_encodeBetterBlockAsm12B + MOVL $0x00000001, SI + LEAL 16(SI), SI + MOVB R8, 1(AX) + SHRL $0x08, R8 + SHLL $0x05, R8 + ORL R8, SI + MOVB SI, (AX) + ADDQ $0x02, AX + SUBL $0x08, R12 + + // emitRepeat + LEAL -4(R12), R12 + JMP cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b + MOVL R12, SI + LEAL -4(R12), R12 + CMPL SI, $0x08 + JLE repeat_two_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b + CMPL SI, $0x0c + JGE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b + CMPL R8, $0x00000800 + JLT repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b + +cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b: + CMPL R12, $0x00000104 + JLT repeat_three_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b + LEAL -256(R12), R12 + MOVW $0x0019, (AX) + MOVW R12, 2(AX) + ADDQ $0x04, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm12B + +repeat_three_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b: + LEAL -4(R12), R12 + MOVW $0x0015, (AX) + MOVB R12, 2(AX) + ADDQ $0x03, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm12B + +repeat_two_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b: + SHLL $0x02, R12 + ORL $0x01, R12 + MOVW R12, (AX) + ADDQ $0x02, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm12B -emit_literal_done_match_emit_encodeBetterBlockAsm12B: - ADDL R12, CX - ADDL $0x04, R12 - MOVL CX, 12(SP) +repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b: + XORQ SI, SI + LEAL 1(SI)(R12*4), R12 + MOVB R8, 1(AX) + SARL $0x08, R8 + SHLL $0x05, R8 + ORL R8, R12 + MOVB R12, (AX) + ADDQ $0x02, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm12B - // emitCopy -two_byte_offset_match_nolit_encodeBetterBlockAsm12B: - CMPL R12, $0x40 - JLE two_byte_offset_short_match_nolit_encodeBetterBlockAsm12B +long_offset_short_match_nolit_encodeBetterBlockAsm12B: MOVB $0xee, (AX) MOVW R8, 1(AX) LEAL -60(R12), R12 @@ -7689,8 +8540,9 @@ memmove_emit_remainder_encodeBetterBlockAsm12B: MOVL SI, BX // genMemMoveShort - CMPQ BX, $0x04 - JLE emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_4 + CMPQ BX, $0x03 + JB emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_1or2 + JE emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_3 CMPQ BX, $0x08 JB emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_4through7 CMPQ BX, $0x10 @@ -7699,9 +8551,18 @@ memmove_emit_remainder_encodeBetterBlockAsm12B: JBE emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_17through32 JMP emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_33through64 -emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_4: - MOVL (CX), SI - MOVL SI, (AX) +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_1or2: + MOVB (CX), SI + MOVB -1(CX)(BX*1), CL + MOVB SI, (AX) + MOVB CL, -1(AX)(BX*1) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_3: + MOVW (CX), SI + MOVB 2(CX), CL + MOVW SI, (AX) + MOVB CL, 2(AX) JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm12B emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_4through7: @@ -7916,17 +8777,6 @@ matchlen_loopback_match_nolit_encodeBetterBlockAsm10B: #ifdef GOAMD64_v3 TZCNTQ R11, R11 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R11, R11 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R11, R11 @@ -8113,6 +8963,65 @@ emit_literal_done_match_emit_encodeBetterBlockAsm10B: two_byte_offset_match_nolit_encodeBetterBlockAsm10B: CMPL R12, $0x40 JLE two_byte_offset_short_match_nolit_encodeBetterBlockAsm10B + CMPL R8, $0x00000800 + JAE long_offset_short_match_nolit_encodeBetterBlockAsm10B + MOVL $0x00000001, SI + LEAL 16(SI), SI + MOVB R8, 1(AX) + SHRL $0x08, R8 + SHLL $0x05, R8 + ORL R8, SI + MOVB SI, (AX) + ADDQ $0x02, AX + SUBL $0x08, R12 + + // emitRepeat + LEAL -4(R12), R12 + JMP cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b + MOVL R12, SI + LEAL -4(R12), R12 + CMPL SI, $0x08 + JLE repeat_two_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b + CMPL SI, $0x0c + JGE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b + CMPL R8, $0x00000800 + JLT repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b + +cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b: + CMPL R12, $0x00000104 + JLT repeat_three_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b + LEAL -256(R12), R12 + MOVW $0x0019, (AX) + MOVW R12, 2(AX) + ADDQ $0x04, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm10B + +repeat_three_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b: + LEAL -4(R12), R12 + MOVW $0x0015, (AX) + MOVB R12, 2(AX) + ADDQ $0x03, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm10B + +repeat_two_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b: + SHLL $0x02, R12 + ORL $0x01, R12 + MOVW R12, (AX) + ADDQ $0x02, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm10B + +repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b: + XORQ SI, SI + LEAL 1(SI)(R12*4), R12 + MOVB R8, 1(AX) + SARL $0x08, R8 + SHLL $0x05, R8 + ORL R8, R12 + MOVB R12, (AX) + ADDQ $0x02, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm10B + +long_offset_short_match_nolit_encodeBetterBlockAsm10B: MOVB $0xee, (AX) MOVW R8, 1(AX) LEAL -60(R12), R12 @@ -8467,8 +9376,9 @@ memmove_emit_remainder_encodeBetterBlockAsm10B: MOVL SI, BX // genMemMoveShort - CMPQ BX, $0x04 - JLE emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_4 + CMPQ BX, $0x03 + JB emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_1or2 + JE emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_3 CMPQ BX, $0x08 JB emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_4through7 CMPQ BX, $0x10 @@ -8477,9 +9387,18 @@ memmove_emit_remainder_encodeBetterBlockAsm10B: JBE emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_17through32 JMP emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_33through64 -emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_4: - MOVL (CX), SI - MOVL SI, (AX) +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_1or2: + MOVB (CX), SI + MOVB -1(CX)(BX*1), CL + MOVB SI, (AX) + MOVB CL, -1(AX)(BX*1) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_3: + MOVW (CX), SI + MOVB 2(CX), CL + MOVW SI, (AX) + MOVB CL, 2(AX) JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm10B emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_4through7: @@ -8694,17 +9613,6 @@ matchlen_loopback_match_nolit_encodeBetterBlockAsm8B: #ifdef GOAMD64_v3 TZCNTQ R11, R11 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R11, R11 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R11, R11 @@ -8891,6 +9799,61 @@ emit_literal_done_match_emit_encodeBetterBlockAsm8B: two_byte_offset_match_nolit_encodeBetterBlockAsm8B: CMPL R12, $0x40 JLE two_byte_offset_short_match_nolit_encodeBetterBlockAsm8B + CMPL R8, $0x00000800 + JAE long_offset_short_match_nolit_encodeBetterBlockAsm8B + MOVL $0x00000001, SI + LEAL 16(SI), SI + MOVB R8, 1(AX) + SHRL $0x08, R8 + SHLL $0x05, R8 + ORL R8, SI + MOVB SI, (AX) + ADDQ $0x02, AX + SUBL $0x08, R12 + + // emitRepeat + LEAL -4(R12), R12 + JMP cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b + MOVL R12, SI + LEAL -4(R12), R12 + CMPL SI, $0x08 + JLE repeat_two_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b + CMPL SI, $0x0c + JGE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b + +cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b: + CMPL R12, $0x00000104 + JLT repeat_three_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b + LEAL -256(R12), R12 + MOVW $0x0019, (AX) + MOVW R12, 2(AX) + ADDQ $0x04, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm8B + +repeat_three_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b: + LEAL -4(R12), R12 + MOVW $0x0015, (AX) + MOVB R12, 2(AX) + ADDQ $0x03, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm8B + +repeat_two_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b: + SHLL $0x02, R12 + ORL $0x01, R12 + MOVW R12, (AX) + ADDQ $0x02, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm8B + XORQ SI, SI + LEAL 1(SI)(R12*4), R12 + MOVB R8, 1(AX) + SARL $0x08, R8 + SHLL $0x05, R8 + ORL R8, R12 + MOVB R12, (AX) + ADDQ $0x02, AX + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm8B + +long_offset_short_match_nolit_encodeBetterBlockAsm8B: MOVB $0xee, (AX) MOVW R8, 1(AX) LEAL -60(R12), R12 @@ -9235,8 +10198,9 @@ memmove_emit_remainder_encodeBetterBlockAsm8B: MOVL SI, BX // genMemMoveShort - CMPQ BX, $0x04 - JLE emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_4 + CMPQ BX, $0x03 + JB emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_1or2 + JE emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_3 CMPQ BX, $0x08 JB emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_4through7 CMPQ BX, $0x10 @@ -9245,9 +10209,18 @@ memmove_emit_remainder_encodeBetterBlockAsm8B: JBE emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_17through32 JMP emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_33through64 -emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_4: - MOVL (CX), SI - MOVL SI, (AX) +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_1or2: + MOVB (CX), SI + MOVB -1(CX)(BX*1), CL + MOVB SI, (AX) + MOVB CL, -1(AX)(BX*1) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_3: + MOVW (CX), SI + MOVB 2(CX), CL + MOVW SI, (AX) + MOVB CL, 2(AX) JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm8B emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_4through7: @@ -9584,17 +10557,6 @@ matchlen_loopback_repeat_extend_encodeSnappyBlockAsm: #ifdef GOAMD64_v3 TZCNTQ R10, R10 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R10, R10 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R10, R10 @@ -9918,17 +10880,6 @@ matchlen_loopback_match_nolit_encodeSnappyBlockAsm: #ifdef GOAMD64_v3 TZCNTQ R9, R9 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R9, R9 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R9, R9 @@ -10127,17 +11078,36 @@ memmove_emit_remainder_encodeSnappyBlockAsm: MOVL SI, BX // genMemMoveShort + CMPQ BX, $0x03 + JB emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_1or2 + JE emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_3 CMPQ BX, $0x08 - JLE emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_8 + JB emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_4through7 CMPQ BX, $0x10 JBE emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_8through16 CMPQ BX, $0x20 JBE emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_17through32 JMP emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_33through64 -emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_8: - MOVQ (CX), SI - MOVQ SI, (AX) +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_1or2: + MOVB (CX), SI + MOVB -1(CX)(BX*1), CL + MOVB SI, (AX) + MOVB CL, -1(AX)(BX*1) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_3: + MOVW (CX), SI + MOVB 2(CX), CL + MOVW SI, (AX) + MOVB CL, 2(AX) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_4through7: + MOVL (CX), SI + MOVL -4(CX)(BX*1), CX + MOVL SI, (AX) + MOVL CX, -4(AX)(BX*1) JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_8through16: @@ -10448,17 +11418,6 @@ matchlen_loopback_repeat_extend_encodeSnappyBlockAsm64K: #ifdef GOAMD64_v3 TZCNTQ R10, R10 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R10, R10 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R10, R10 @@ -10739,17 +11698,6 @@ matchlen_loopback_match_nolit_encodeSnappyBlockAsm64K: #ifdef GOAMD64_v3 TZCNTQ R9, R9 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R9, R9 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R9, R9 @@ -10905,17 +11853,36 @@ memmove_emit_remainder_encodeSnappyBlockAsm64K: MOVL SI, BX // genMemMoveShort + CMPQ BX, $0x03 + JB emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_1or2 + JE emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_3 CMPQ BX, $0x08 - JLE emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_8 + JB emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_4through7 CMPQ BX, $0x10 JBE emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_8through16 CMPQ BX, $0x20 JBE emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_17through32 JMP emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_33through64 -emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_8: - MOVQ (CX), SI - MOVQ SI, (AX) +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_1or2: + MOVB (CX), SI + MOVB -1(CX)(BX*1), CL + MOVB SI, (AX) + MOVB CL, -1(AX)(BX*1) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm64K + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_3: + MOVW (CX), SI + MOVB 2(CX), CL + MOVW SI, (AX) + MOVB CL, 2(AX) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm64K + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_4through7: + MOVL (CX), SI + MOVL -4(CX)(BX*1), CX + MOVL SI, (AX) + MOVL CX, -4(AX)(BX*1) JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm64K emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_8through16: @@ -11226,17 +12193,6 @@ matchlen_loopback_repeat_extend_encodeSnappyBlockAsm12B: #ifdef GOAMD64_v3 TZCNTQ R10, R10 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R10, R10 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R10, R10 @@ -11517,17 +12473,6 @@ matchlen_loopback_match_nolit_encodeSnappyBlockAsm12B: #ifdef GOAMD64_v3 TZCNTQ R9, R9 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R9, R9 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R9, R9 @@ -11683,17 +12628,36 @@ memmove_emit_remainder_encodeSnappyBlockAsm12B: MOVL SI, BX // genMemMoveShort + CMPQ BX, $0x03 + JB emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_1or2 + JE emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_3 CMPQ BX, $0x08 - JLE emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_8 + JB emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_4through7 CMPQ BX, $0x10 JBE emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_8through16 CMPQ BX, $0x20 JBE emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_17through32 JMP emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_33through64 -emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_8: - MOVQ (CX), SI - MOVQ SI, (AX) +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_1or2: + MOVB (CX), SI + MOVB -1(CX)(BX*1), CL + MOVB SI, (AX) + MOVB CL, -1(AX)(BX*1) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_3: + MOVW (CX), SI + MOVB 2(CX), CL + MOVW SI, (AX) + MOVB CL, 2(AX) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_4through7: + MOVL (CX), SI + MOVL -4(CX)(BX*1), CX + MOVL SI, (AX) + MOVL CX, -4(AX)(BX*1) JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm12B emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_8through16: @@ -12004,17 +12968,6 @@ matchlen_loopback_repeat_extend_encodeSnappyBlockAsm10B: #ifdef GOAMD64_v3 TZCNTQ R10, R10 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R10, R10 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R10, R10 @@ -12295,17 +13248,6 @@ matchlen_loopback_match_nolit_encodeSnappyBlockAsm10B: #ifdef GOAMD64_v3 TZCNTQ R9, R9 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R9, R9 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R9, R9 @@ -12461,17 +13403,36 @@ memmove_emit_remainder_encodeSnappyBlockAsm10B: MOVL SI, BX // genMemMoveShort + CMPQ BX, $0x03 + JB emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_1or2 + JE emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_3 CMPQ BX, $0x08 - JLE emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_8 + JB emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_4through7 CMPQ BX, $0x10 JBE emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_8through16 CMPQ BX, $0x20 JBE emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_17through32 JMP emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_33through64 -emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_8: - MOVQ (CX), SI - MOVQ SI, (AX) +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_1or2: + MOVB (CX), SI + MOVB -1(CX)(BX*1), CL + MOVB SI, (AX) + MOVB CL, -1(AX)(BX*1) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_3: + MOVW (CX), SI + MOVB 2(CX), CL + MOVW SI, (AX) + MOVB CL, 2(AX) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_4through7: + MOVL (CX), SI + MOVL -4(CX)(BX*1), CX + MOVL SI, (AX) + MOVL CX, -4(AX)(BX*1) JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm10B emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_8through16: @@ -12782,17 +13743,6 @@ matchlen_loopback_repeat_extend_encodeSnappyBlockAsm8B: #ifdef GOAMD64_v3 TZCNTQ R10, R10 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R10, R10 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R10, R10 @@ -13071,17 +14021,6 @@ matchlen_loopback_match_nolit_encodeSnappyBlockAsm8B: #ifdef GOAMD64_v3 TZCNTQ R9, R9 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R9, R9 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R9, R9 @@ -13235,17 +14174,36 @@ memmove_emit_remainder_encodeSnappyBlockAsm8B: MOVL SI, BX // genMemMoveShort + CMPQ BX, $0x03 + JB emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_1or2 + JE emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_3 CMPQ BX, $0x08 - JLE emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_8 + JB emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_4through7 CMPQ BX, $0x10 JBE emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_8through16 CMPQ BX, $0x20 JBE emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_17through32 JMP emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_33through64 -emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_8: - MOVQ (CX), SI - MOVQ SI, (AX) +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_1or2: + MOVB (CX), SI + MOVB -1(CX)(BX*1), CL + MOVB SI, (AX) + MOVB CL, -1(AX)(BX*1) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_3: + MOVW (CX), SI + MOVB 2(CX), CL + MOVW SI, (AX) + MOVB CL, 2(AX) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_4through7: + MOVL (CX), SI + MOVL -4(CX)(BX*1), CX + MOVL SI, (AX) + MOVL CX, -4(AX)(BX*1) JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm8B emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_8through16: @@ -13461,17 +14419,6 @@ matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm: #ifdef GOAMD64_v3 TZCNTQ R11, R11 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R11, R11 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R11, R11 @@ -13850,17 +14797,36 @@ memmove_emit_remainder_encodeSnappyBetterBlockAsm: MOVL SI, BX // genMemMoveShort + CMPQ BX, $0x03 + JB emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_1or2 + JE emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_3 CMPQ BX, $0x08 - JLE emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_8 + JB emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_4through7 CMPQ BX, $0x10 JBE emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_8through16 CMPQ BX, $0x20 JBE emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_17through32 JMP emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_33through64 -emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_8: - MOVQ (CX), SI - MOVQ SI, (AX) +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_1or2: + MOVB (CX), SI + MOVB -1(CX)(BX*1), CL + MOVB SI, (AX) + MOVB CL, -1(AX)(BX*1) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_3: + MOVW (CX), SI + MOVB 2(CX), CL + MOVW SI, (AX) + MOVB CL, 2(AX) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_4through7: + MOVL (CX), SI + MOVL -4(CX)(BX*1), CX + MOVL SI, (AX) + MOVL CX, -4(AX)(BX*1) JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_8through16: @@ -14068,17 +15034,6 @@ matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm64K: #ifdef GOAMD64_v3 TZCNTQ R11, R11 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R11, R11 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R11, R11 @@ -14386,17 +15341,36 @@ memmove_emit_remainder_encodeSnappyBetterBlockAsm64K: MOVL SI, BX // genMemMoveShort + CMPQ BX, $0x03 + JB emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_1or2 + JE emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_3 CMPQ BX, $0x08 - JLE emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_8 + JB emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_4through7 CMPQ BX, $0x10 JBE emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_8through16 CMPQ BX, $0x20 JBE emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_17through32 JMP emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_33through64 -emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_8: - MOVQ (CX), SI - MOVQ SI, (AX) +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_1or2: + MOVB (CX), SI + MOVB -1(CX)(BX*1), CL + MOVB SI, (AX) + MOVB CL, -1(AX)(BX*1) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm64K + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_3: + MOVW (CX), SI + MOVB 2(CX), CL + MOVW SI, (AX) + MOVB CL, 2(AX) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm64K + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_4through7: + MOVL (CX), SI + MOVL -4(CX)(BX*1), CX + MOVL SI, (AX) + MOVL CX, -4(AX)(BX*1) JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm64K emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_8through16: @@ -14604,17 +15578,6 @@ matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm12B: #ifdef GOAMD64_v3 TZCNTQ R11, R11 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R11, R11 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R11, R11 @@ -14922,17 +15885,36 @@ memmove_emit_remainder_encodeSnappyBetterBlockAsm12B: MOVL SI, BX // genMemMoveShort + CMPQ BX, $0x03 + JB emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_1or2 + JE emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_3 CMPQ BX, $0x08 - JLE emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_8 + JB emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_4through7 CMPQ BX, $0x10 JBE emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_8through16 CMPQ BX, $0x20 JBE emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_17through32 JMP emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_33through64 -emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_8: - MOVQ (CX), SI - MOVQ SI, (AX) +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_1or2: + MOVB (CX), SI + MOVB -1(CX)(BX*1), CL + MOVB SI, (AX) + MOVB CL, -1(AX)(BX*1) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_3: + MOVW (CX), SI + MOVB 2(CX), CL + MOVW SI, (AX) + MOVB CL, 2(AX) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_4through7: + MOVL (CX), SI + MOVL -4(CX)(BX*1), CX + MOVL SI, (AX) + MOVL CX, -4(AX)(BX*1) JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm12B emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_8through16: @@ -15140,17 +16122,6 @@ matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm10B: #ifdef GOAMD64_v3 TZCNTQ R11, R11 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R11, R11 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R11, R11 @@ -15458,17 +16429,36 @@ memmove_emit_remainder_encodeSnappyBetterBlockAsm10B: MOVL SI, BX // genMemMoveShort + CMPQ BX, $0x03 + JB emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_1or2 + JE emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_3 CMPQ BX, $0x08 - JLE emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_8 + JB emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_4through7 CMPQ BX, $0x10 JBE emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_8through16 CMPQ BX, $0x20 JBE emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_17through32 JMP emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_33through64 -emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_8: - MOVQ (CX), SI - MOVQ SI, (AX) +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_1or2: + MOVB (CX), SI + MOVB -1(CX)(BX*1), CL + MOVB SI, (AX) + MOVB CL, -1(AX)(BX*1) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_3: + MOVW (CX), SI + MOVB 2(CX), CL + MOVW SI, (AX) + MOVB CL, 2(AX) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_4through7: + MOVL (CX), SI + MOVL -4(CX)(BX*1), CX + MOVL SI, (AX) + MOVL CX, -4(AX)(BX*1) JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm10B emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_8through16: @@ -15676,17 +16666,6 @@ matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm8B: #ifdef GOAMD64_v3 TZCNTQ R11, R11 -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ R11, R11 - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ R11, R11 @@ -15992,17 +16971,36 @@ memmove_emit_remainder_encodeSnappyBetterBlockAsm8B: MOVL SI, BX // genMemMoveShort + CMPQ BX, $0x03 + JB emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_1or2 + JE emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_3 CMPQ BX, $0x08 - JLE emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_8 + JB emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_4through7 CMPQ BX, $0x10 JBE emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_8through16 CMPQ BX, $0x20 JBE emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_17through32 JMP emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_33through64 -emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_8: - MOVQ (CX), SI - MOVQ SI, (AX) +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_1or2: + MOVB (CX), SI + MOVB -1(CX)(BX*1), CL + MOVB SI, (AX) + MOVB CL, -1(AX)(BX*1) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_3: + MOVW (CX), SI + MOVB 2(CX), CL + MOVW SI, (AX) + MOVB CL, 2(AX) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_4through7: + MOVL (CX), SI + MOVL -4(CX)(BX*1), CX + MOVL SI, (AX) + MOVL CX, -4(AX)(BX*1) JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm8B emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_8through16: @@ -16443,6 +17441,97 @@ four_bytes_remain_standalone: two_byte_offset_standalone: CMPL DX, $0x40 JLE two_byte_offset_short_standalone + CMPL CX, $0x00000800 + JAE long_offset_short_standalone + MOVL $0x00000001, SI + LEAL 16(SI), SI + MOVB CL, 1(AX) + MOVL CX, DI + SHRL $0x08, DI + SHLL $0x05, DI + ORL DI, SI + MOVB SI, (AX) + ADDQ $0x02, BX + ADDQ $0x02, AX + SUBL $0x08, DX + + // emitRepeat + LEAL -4(DX), DX + JMP cant_repeat_two_offset_standalone_emit_copy_short_2b + +emit_repeat_again_standalone_emit_copy_short_2b: + MOVL DX, SI + LEAL -4(DX), DX + CMPL SI, $0x08 + JLE repeat_two_standalone_emit_copy_short_2b + CMPL SI, $0x0c + JGE cant_repeat_two_offset_standalone_emit_copy_short_2b + CMPL CX, $0x00000800 + JLT repeat_two_offset_standalone_emit_copy_short_2b + +cant_repeat_two_offset_standalone_emit_copy_short_2b: + CMPL DX, $0x00000104 + JLT repeat_three_standalone_emit_copy_short_2b + CMPL DX, $0x00010100 + JLT repeat_four_standalone_emit_copy_short_2b + CMPL DX, $0x0100ffff + JLT repeat_five_standalone_emit_copy_short_2b + LEAL -16842747(DX), DX + MOVW $0x001d, (AX) + MOVW $0xfffb, 2(AX) + MOVB $0xff, 4(AX) + ADDQ $0x05, AX + ADDQ $0x05, BX + JMP emit_repeat_again_standalone_emit_copy_short_2b + +repeat_five_standalone_emit_copy_short_2b: + LEAL -65536(DX), DX + MOVL DX, CX + MOVW $0x001d, (AX) + MOVW DX, 2(AX) + SARL $0x10, CX + MOVB CL, 4(AX) + ADDQ $0x05, BX + ADDQ $0x05, AX + JMP gen_emit_copy_end + +repeat_four_standalone_emit_copy_short_2b: + LEAL -256(DX), DX + MOVW $0x0019, (AX) + MOVW DX, 2(AX) + ADDQ $0x04, BX + ADDQ $0x04, AX + JMP gen_emit_copy_end + +repeat_three_standalone_emit_copy_short_2b: + LEAL -4(DX), DX + MOVW $0x0015, (AX) + MOVB DL, 2(AX) + ADDQ $0x03, BX + ADDQ $0x03, AX + JMP gen_emit_copy_end + +repeat_two_standalone_emit_copy_short_2b: + SHLL $0x02, DX + ORL $0x01, DX + MOVW DX, (AX) + ADDQ $0x02, BX + ADDQ $0x02, AX + JMP gen_emit_copy_end + +repeat_two_offset_standalone_emit_copy_short_2b: + XORQ SI, SI + LEAL 1(SI)(DX*4), DX + MOVB CL, 1(AX) + SARL $0x08, CX + SHLL $0x05, CX + ORL CX, DX + MOVB DL, (AX) + ADDQ $0x02, BX + ADDQ $0x02, AX + JMP gen_emit_copy_end + +long_offset_short_standalone: MOVB $0xee, (AX) MOVW CX, 1(AX) LEAL -60(DX), DX @@ -16644,17 +17733,6 @@ matchlen_loopback_standalone: #ifdef GOAMD64_v3 TZCNTQ BX, BX -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef GOAMD64_v4 - TZCNTQ BX, BX - -#define TZCNTQ_EMITTED 1 -#endif - -#ifdef TZCNTQ_EMITTED -#undef TZCNTQ_EMITTED #else BSFQ BX, BX diff --git a/vendor/github.com/klauspost/compress/s2/index.go b/vendor/github.com/klauspost/compress/s2/index.go index fd857682..7b24a006 100644 --- a/vendor/github.com/klauspost/compress/s2/index.go +++ b/vendor/github.com/klauspost/compress/s2/index.go @@ -10,6 +10,7 @@ import ( "encoding/json" "fmt" "io" + "sort" ) const ( @@ -100,6 +101,15 @@ func (i *Index) Find(offset int64) (compressedOff, uncompressedOff int64, err er if offset > i.TotalUncompressed { return 0, 0, io.ErrUnexpectedEOF } + if len(i.info) > 200 { + n := sort.Search(len(i.info), func(n int) bool { + return i.info[n].uncompressedOffset > offset + }) + if n == 0 { + n = 1 + } + return i.info[n-1].compressedOffset, i.info[n-1].uncompressedOffset, nil + } for _, info := range i.info { if info.uncompressedOffset > offset { break diff --git a/vendor/github.com/klauspost/compress/zstd/README.md b/vendor/github.com/klauspost/compress/zstd/README.md index e3445ac1..beb7fa87 100644 --- a/vendor/github.com/klauspost/compress/zstd/README.md +++ b/vendor/github.com/klauspost/compress/zstd/README.md @@ -386,47 +386,31 @@ In practice this means that concurrency is often limited to utilizing about 3 co ### Benchmarks -These are some examples of performance compared to [datadog cgo library](https://github.com/DataDog/zstd). - The first two are streaming decodes and the last are smaller inputs. - + +Running on AMD Ryzen 9 3950X 16-Core Processor. AMD64 assembly used. + ``` -BenchmarkDecoderSilesia-8 3 385000067 ns/op 550.51 MB/s 5498 B/op 8 allocs/op -BenchmarkDecoderSilesiaCgo-8 6 197666567 ns/op 1072.25 MB/s 270672 B/op 8 allocs/op - -BenchmarkDecoderEnwik9-8 1 2027001600 ns/op 493.34 MB/s 10496 B/op 18 allocs/op -BenchmarkDecoderEnwik9Cgo-8 2 979499200 ns/op 1020.93 MB/s 270672 B/op 8 allocs/op - -Concurrent performance: - -BenchmarkDecoder_DecodeAllParallel/kppkn.gtb.zst-16 28915 42469 ns/op 4340.07 MB/s 114 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/geo.protodata.zst-16 116505 9965 ns/op 11900.16 MB/s 16 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/plrabn12.txt.zst-16 8952 134272 ns/op 3588.70 MB/s 915 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/lcet10.txt.zst-16 11820 102538 ns/op 4161.90 MB/s 594 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/asyoulik.txt.zst-16 34782 34184 ns/op 3661.88 MB/s 60 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/alice29.txt.zst-16 27712 43447 ns/op 3500.58 MB/s 99 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/html_x_4.zst-16 62826 18750 ns/op 21845.10 MB/s 104 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/paper-100k.pdf.zst-16 631545 1794 ns/op 57078.74 MB/s 2 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/fireworks.jpeg.zst-16 1690140 712 ns/op 172938.13 MB/s 1 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/urls.10K.zst-16 10432 113593 ns/op 6180.73 MB/s 1143 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/html.zst-16 113206 10671 ns/op 9596.27 MB/s 15 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/comp-data.bin.zst-16 1530615 779 ns/op 5229.49 MB/s 0 B/op 0 allocs/op - -BenchmarkDecoder_DecodeAllParallelCgo/kppkn.gtb.zst-16 65217 16192 ns/op 11383.34 MB/s 46 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/geo.protodata.zst-16 292671 4039 ns/op 29363.19 MB/s 6 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/plrabn12.txt.zst-16 26314 46021 ns/op 10470.43 MB/s 293 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/lcet10.txt.zst-16 33897 34900 ns/op 12227.96 MB/s 205 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/asyoulik.txt.zst-16 104348 11433 ns/op 10949.01 MB/s 20 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/alice29.txt.zst-16 75949 15510 ns/op 9805.60 MB/s 32 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/html_x_4.zst-16 173910 6756 ns/op 60624.29 MB/s 37 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/paper-100k.pdf.zst-16 923076 1339 ns/op 76474.87 MB/s 1 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/fireworks.jpeg.zst-16 922920 1351 ns/op 91102.57 MB/s 2 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/urls.10K.zst-16 27649 43618 ns/op 16096.19 MB/s 407 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/html.zst-16 279073 4160 ns/op 24614.18 MB/s 6 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/comp-data.bin.zst-16 749938 1579 ns/op 2581.71 MB/s 0 B/op 0 allocs/op +BenchmarkDecoderSilesia-32 5 206878840 ns/op 1024.50 MB/s 49808 B/op 43 allocs/op +BenchmarkDecoderEnwik9-32 1 1271809000 ns/op 786.28 MB/s 72048 B/op 52 allocs/op + +Concurrent blocks, performance: + +BenchmarkDecoder_DecodeAllParallel/kppkn.gtb.zst-32 67356 17857 ns/op 10321.96 MB/s 22.48 pct 102 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/geo.protodata.zst-32 266656 4421 ns/op 26823.21 MB/s 11.89 pct 19 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/plrabn12.txt.zst-32 20992 56842 ns/op 8477.17 MB/s 39.90 pct 754 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/lcet10.txt.zst-32 27456 43932 ns/op 9714.01 MB/s 33.27 pct 524 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/asyoulik.txt.zst-32 78432 15047 ns/op 8319.15 MB/s 40.34 pct 66 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/alice29.txt.zst-32 65800 18436 ns/op 8249.63 MB/s 37.75 pct 88 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/html_x_4.zst-32 102993 11523 ns/op 35546.09 MB/s 3.637 pct 143 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/paper-100k.pdf.zst-32 1000000 1070 ns/op 95720.98 MB/s 80.53 pct 3 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/fireworks.jpeg.zst-32 749802 1752 ns/op 70272.35 MB/s 100.0 pct 5 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/urls.10K.zst-32 22640 52934 ns/op 13263.37 MB/s 26.25 pct 1014 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/html.zst-32 226412 5232 ns/op 19572.27 MB/s 14.49 pct 20 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/comp-data.bin.zst-32 923041 1276 ns/op 3194.71 MB/s 31.26 pct 0 B/op 0 allocs/op ``` -This reflects the performance around May 2020, but this may be out of date. +This reflects the performance around May 2022, but this may be out of date. ## Zstd inside ZIP files diff --git a/vendor/github.com/klauspost/compress/zstd/bitreader.go b/vendor/github.com/klauspost/compress/zstd/bitreader.go index d7cd15ba..97299d49 100644 --- a/vendor/github.com/klauspost/compress/zstd/bitreader.go +++ b/vendor/github.com/klauspost/compress/zstd/bitreader.go @@ -63,13 +63,6 @@ func (b *bitReader) get32BitsFast(n uint8) uint32 { return v } -func (b *bitReader) get16BitsFast(n uint8) uint16 { - const regMask = 64 - 1 - v := uint16((b.value << (b.bitsRead & regMask)) >> ((regMask + 1 - n) & regMask)) - b.bitsRead += n - return v -} - // fillFast() will make sure at least 32 bits are available. // There must be at least 4 bytes available. func (b *bitReader) fillFast() { diff --git a/vendor/github.com/klauspost/compress/zstd/bitwriter.go b/vendor/github.com/klauspost/compress/zstd/bitwriter.go index b3661828..78b3c61b 100644 --- a/vendor/github.com/klauspost/compress/zstd/bitwriter.go +++ b/vendor/github.com/klauspost/compress/zstd/bitwriter.go @@ -5,8 +5,6 @@ package zstd -import "fmt" - // bitWriter will write bits. // First bit will be LSB of the first byte of output. type bitWriter struct { @@ -73,80 +71,6 @@ func (b *bitWriter) addBits16Clean(value uint16, bits uint8) { b.nBits += bits } -// flush will flush all pending full bytes. -// There will be at least 56 bits available for writing when this has been called. -// Using flush32 is faster, but leaves less space for writing. -func (b *bitWriter) flush() { - v := b.nBits >> 3 - switch v { - case 0: - case 1: - b.out = append(b.out, - byte(b.bitContainer), - ) - case 2: - b.out = append(b.out, - byte(b.bitContainer), - byte(b.bitContainer>>8), - ) - case 3: - b.out = append(b.out, - byte(b.bitContainer), - byte(b.bitContainer>>8), - byte(b.bitContainer>>16), - ) - case 4: - b.out = append(b.out, - byte(b.bitContainer), - byte(b.bitContainer>>8), - byte(b.bitContainer>>16), - byte(b.bitContainer>>24), - ) - case 5: - b.out = append(b.out, - byte(b.bitContainer), - byte(b.bitContainer>>8), - byte(b.bitContainer>>16), - byte(b.bitContainer>>24), - byte(b.bitContainer>>32), - ) - case 6: - b.out = append(b.out, - byte(b.bitContainer), - byte(b.bitContainer>>8), - byte(b.bitContainer>>16), - byte(b.bitContainer>>24), - byte(b.bitContainer>>32), - byte(b.bitContainer>>40), - ) - case 7: - b.out = append(b.out, - byte(b.bitContainer), - byte(b.bitContainer>>8), - byte(b.bitContainer>>16), - byte(b.bitContainer>>24), - byte(b.bitContainer>>32), - byte(b.bitContainer>>40), - byte(b.bitContainer>>48), - ) - case 8: - b.out = append(b.out, - byte(b.bitContainer), - byte(b.bitContainer>>8), - byte(b.bitContainer>>16), - byte(b.bitContainer>>24), - byte(b.bitContainer>>32), - byte(b.bitContainer>>40), - byte(b.bitContainer>>48), - byte(b.bitContainer>>56), - ) - default: - panic(fmt.Errorf("bits (%d) > 64", b.nBits)) - } - b.bitContainer >>= v << 3 - b.nBits &= 7 -} - // flush32 will flush out, so there are at least 32 bits available for writing. func (b *bitWriter) flush32() { if b.nBits < 32 { diff --git a/vendor/github.com/klauspost/compress/zstd/blockdec.go b/vendor/github.com/klauspost/compress/zstd/blockdec.go index 7d567a54..7eed729b 100644 --- a/vendor/github.com/klauspost/compress/zstd/blockdec.go +++ b/vendor/github.com/klauspost/compress/zstd/blockdec.go @@ -5,9 +5,14 @@ package zstd import ( + "bytes" + "encoding/binary" "errors" "fmt" "io" + "io/ioutil" + "os" + "path/filepath" "sync" "github.com/klauspost/compress/huff0" @@ -38,14 +43,14 @@ const ( // maxCompressedBlockSize is the biggest allowed compressed block size (128KB) maxCompressedBlockSize = 128 << 10 + compressedBlockOverAlloc = 16 + maxCompressedBlockSizeAlloc = 128<<10 + compressedBlockOverAlloc + // Maximum possible block size (all Raw+Uncompressed). maxBlockSize = (1 << 21) - 1 - // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#literals_section_header - maxCompressedLiteralSize = 1 << 18 - maxRLELiteralSize = 1 << 20 - maxMatchLen = 131074 - maxSequences = 0x7f00 + 0xffff + maxMatchLen = 131074 + maxSequences = 0x7f00 + 0xffff // We support slightly less than the reference decoder to be able to // use ints on 32 bit archs. @@ -97,7 +102,6 @@ type blockDec struct { // Block is RLE, this is the size. RLESize uint32 - tmp [4]byte Type blockType @@ -136,7 +140,7 @@ func (b *blockDec) reset(br byteBuffer, windowSize uint64) error { b.Type = blockType((bh >> 1) & 3) // find size. cSize := int(bh >> 3) - maxSize := maxBlockSize + maxSize := maxCompressedBlockSizeAlloc switch b.Type { case blockTypeReserved: return ErrReservedBlockType @@ -157,9 +161,9 @@ func (b *blockDec) reset(br byteBuffer, windowSize uint64) error { println("Data size on stream:", cSize) } b.RLESize = 0 - maxSize = maxCompressedBlockSize + maxSize = maxCompressedBlockSizeAlloc if windowSize < maxCompressedBlockSize && b.lowMem { - maxSize = int(windowSize) + maxSize = int(windowSize) + compressedBlockOverAlloc } if cSize > maxCompressedBlockSize || uint64(cSize) > b.WindowSize { if debugDecoder { @@ -190,9 +194,9 @@ func (b *blockDec) reset(br byteBuffer, windowSize uint64) error { // Read block data. if cap(b.dataStorage) < cSize { if b.lowMem || cSize > maxCompressedBlockSize { - b.dataStorage = make([]byte, 0, cSize) + b.dataStorage = make([]byte, 0, cSize+compressedBlockOverAlloc) } else { - b.dataStorage = make([]byte, 0, maxCompressedBlockSize) + b.dataStorage = make([]byte, 0, maxCompressedBlockSizeAlloc) } } if cap(b.dst) <= maxSize { @@ -360,14 +364,9 @@ func (b *blockDec) decodeLiterals(in []byte, hist *history) (remain []byte, err } if cap(b.literalBuf) < litRegenSize { if b.lowMem { - b.literalBuf = make([]byte, litRegenSize) + b.literalBuf = make([]byte, litRegenSize, litRegenSize+compressedBlockOverAlloc) } else { - if litRegenSize > maxCompressedLiteralSize { - // Exceptional - b.literalBuf = make([]byte, litRegenSize) - } else { - b.literalBuf = make([]byte, litRegenSize, maxCompressedLiteralSize) - } + b.literalBuf = make([]byte, litRegenSize, maxCompressedBlockSize+compressedBlockOverAlloc) } } literals = b.literalBuf[:litRegenSize] @@ -397,14 +396,14 @@ func (b *blockDec) decodeLiterals(in []byte, hist *history) (remain []byte, err // Ensure we have space to store it. if cap(b.literalBuf) < litRegenSize { if b.lowMem { - b.literalBuf = make([]byte, 0, litRegenSize) + b.literalBuf = make([]byte, 0, litRegenSize+compressedBlockOverAlloc) } else { - b.literalBuf = make([]byte, 0, maxCompressedLiteralSize) + b.literalBuf = make([]byte, 0, maxCompressedBlockSize+compressedBlockOverAlloc) } } var err error // Use our out buffer. - huff.MaxDecodedSize = maxCompressedBlockSize + huff.MaxDecodedSize = litRegenSize if fourStreams { literals, err = huff.Decoder().Decompress4X(b.literalBuf[:0:litRegenSize], literals) } else { @@ -429,9 +428,9 @@ func (b *blockDec) decodeLiterals(in []byte, hist *history) (remain []byte, err // Ensure we have space to store it. if cap(b.literalBuf) < litRegenSize { if b.lowMem { - b.literalBuf = make([]byte, 0, litRegenSize) + b.literalBuf = make([]byte, 0, litRegenSize+compressedBlockOverAlloc) } else { - b.literalBuf = make([]byte, 0, maxCompressedBlockSize) + b.literalBuf = make([]byte, 0, maxCompressedBlockSize+compressedBlockOverAlloc) } } huff := hist.huffTree @@ -448,7 +447,7 @@ func (b *blockDec) decodeLiterals(in []byte, hist *history) (remain []byte, err return in, err } hist.huffTree = huff - huff.MaxDecodedSize = maxCompressedBlockSize + huff.MaxDecodedSize = litRegenSize // Use our out buffer. if fourStreams { literals, err = huff.Decoder().Decompress4X(b.literalBuf[:0:litRegenSize], literals) @@ -463,6 +462,8 @@ func (b *blockDec) decodeLiterals(in []byte, hist *history) (remain []byte, err if len(literals) != litRegenSize { return in, fmt.Errorf("literal output size mismatch want %d, got %d", litRegenSize, len(literals)) } + // Re-cap to get extra size. + literals = b.literalBuf[:len(literals)] if debugDecoder { printf("Decompressed %d literals into %d bytes\n", litCompSize, litRegenSize) } @@ -486,10 +487,15 @@ func (b *blockDec) decodeCompressed(hist *history) error { b.dst = append(b.dst, hist.decoders.literals...) return nil } - err = hist.decoders.decodeSync(hist) + before := len(hist.decoders.out) + err = hist.decoders.decodeSync(hist.b[hist.ignoreBuffer:]) if err != nil { return err } + if hist.decoders.maxSyncLen > 0 { + hist.decoders.maxSyncLen += uint64(before) + hist.decoders.maxSyncLen -= uint64(len(hist.decoders.out)) + } b.dst = hist.decoders.out hist.recentOffsets = hist.decoders.prevOffset return nil @@ -632,6 +638,22 @@ func (b *blockDec) prepareSequences(in []byte, hist *history) (err error) { println("initializing sequences:", err) return err } + // Extract blocks... + if false && hist.dict == nil { + fatalErr := func(err error) { + if err != nil { + panic(err) + } + } + fn := fmt.Sprintf("n-%d-lits-%d-prev-%d-%d-%d-win-%d.blk", hist.decoders.nSeqs, len(hist.decoders.literals), hist.recentOffsets[0], hist.recentOffsets[1], hist.recentOffsets[2], hist.windowSize) + var buf bytes.Buffer + fatalErr(binary.Write(&buf, binary.LittleEndian, hist.decoders.litLengths.fse)) + fatalErr(binary.Write(&buf, binary.LittleEndian, hist.decoders.matchLengths.fse)) + fatalErr(binary.Write(&buf, binary.LittleEndian, hist.decoders.offsets.fse)) + buf.Write(in) + ioutil.WriteFile(filepath.Join("testdata", "seqs", fn), buf.Bytes(), os.ModePerm) + } + return nil } @@ -650,6 +672,7 @@ func (b *blockDec) decodeSequences(hist *history) error { } hist.decoders.windowSize = hist.windowSize hist.decoders.prevOffset = hist.recentOffsets + err := hist.decoders.decode(b.sequence) hist.recentOffsets = hist.decoders.prevOffset return err diff --git a/vendor/github.com/klauspost/compress/zstd/bytebuf.go b/vendor/github.com/klauspost/compress/zstd/bytebuf.go index b80191e4..4493baa7 100644 --- a/vendor/github.com/klauspost/compress/zstd/bytebuf.go +++ b/vendor/github.com/klauspost/compress/zstd/bytebuf.go @@ -52,10 +52,6 @@ func (b *byteBuf) readBig(n int, dst []byte) ([]byte, error) { return r, nil } -func (b *byteBuf) remain() []byte { - return *b -} - func (b *byteBuf) readByte() (byte, error) { bb := *b if len(bb) < 1 { diff --git a/vendor/github.com/klauspost/compress/zstd/bytereader.go b/vendor/github.com/klauspost/compress/zstd/bytereader.go index 2c4fca17..0e59a242 100644 --- a/vendor/github.com/klauspost/compress/zstd/bytereader.go +++ b/vendor/github.com/klauspost/compress/zstd/bytereader.go @@ -13,12 +13,6 @@ type byteReader struct { off int } -// init will initialize the reader and set the input. -func (b *byteReader) init(in []byte) { - b.b = in - b.off = 0 -} - // advance the stream b n bytes. func (b *byteReader) advance(n uint) { b.off += int(n) diff --git a/vendor/github.com/klauspost/compress/zstd/decoder.go b/vendor/github.com/klauspost/compress/zstd/decoder.go index 9fcdaac1..286c8f9d 100644 --- a/vendor/github.com/klauspost/compress/zstd/decoder.go +++ b/vendor/github.com/klauspost/compress/zstd/decoder.go @@ -347,18 +347,20 @@ func (d *Decoder) DecodeAll(input, dst []byte) ([]byte, error) { } frame.history.setDict(&dict) } - - if frame.FrameContentSize != fcsUnknown && frame.FrameContentSize > d.o.maxDecodedSize-uint64(len(dst)) { - return dst, ErrDecoderSizeExceeded + if frame.WindowSize > d.o.maxWindowSize { + return dst, ErrWindowSizeExceeded } - if frame.FrameContentSize < 1<<30 { - // Never preallocate more than 1 GB up front. + if frame.FrameContentSize != fcsUnknown { + if frame.FrameContentSize > d.o.maxDecodedSize-uint64(len(dst)) { + return dst, ErrDecoderSizeExceeded + } if cap(dst)-len(dst) < int(frame.FrameContentSize) { - dst2 := make([]byte, len(dst), len(dst)+int(frame.FrameContentSize)) + dst2 := make([]byte, len(dst), len(dst)+int(frame.FrameContentSize)+compressedBlockOverAlloc) copy(dst2, dst) dst = dst2 } } + if cap(dst) == 0 { // Allocate len(input) * 2 by default if nothing is provided // and we didn't get frame content size. @@ -437,7 +439,7 @@ func (d *Decoder) nextBlock(blocking bool) (ok bool) { println("got", len(d.current.b), "bytes, error:", d.current.err, "data crc:", tmp) } - if len(next.b) > 0 { + if !d.o.ignoreChecksum && len(next.b) > 0 { n, err := d.current.crc.Write(next.b) if err == nil { if n != len(next.b) { @@ -449,7 +451,7 @@ func (d *Decoder) nextBlock(blocking bool) (ok bool) { got := d.current.crc.Sum64() var tmp [4]byte binary.LittleEndian.PutUint32(tmp[:], uint32(got)) - if !bytes.Equal(tmp[:], next.d.checkCRC) && !ignoreCRC { + if !d.o.ignoreChecksum && !bytes.Equal(tmp[:], next.d.checkCRC) { if debugDecoder { println("CRC Check Failed:", tmp[:], " (got) !=", next.d.checkCRC, "(on stream)") } @@ -533,9 +535,15 @@ func (d *Decoder) nextBlockSync() (ok bool) { // Update/Check CRC if d.frame.HasCheckSum { - d.frame.crc.Write(d.current.b) + if !d.o.ignoreChecksum { + d.frame.crc.Write(d.current.b) + } if d.current.d.Last { - d.current.err = d.frame.checkCRC() + if !d.o.ignoreChecksum { + d.current.err = d.frame.checkCRC() + } else { + d.current.err = d.frame.consumeCRC() + } if d.current.err != nil { println("CRC error:", d.current.err) return false @@ -629,60 +637,18 @@ func (d *Decoder) startSyncDecoder(r io.Reader) error { // Create Decoder: // ASYNC: -// Spawn 4 go routines. -// 0: Read frames and decode blocks. -// 1: Decode block and literals. Receives hufftree and seqdecs, returns seqdecs and huff tree. -// 2: Wait for recentOffsets if needed. Decode sequences, send recentOffsets. -// 3: Wait for stream history, execute sequences, send stream history. +// Spawn 3 go routines. +// 0: Read frames and decode block literals. +// 1: Decode sequences. +// 2: Execute sequences, send to output. func (d *Decoder) startStreamDecoder(ctx context.Context, r io.Reader, output chan decodeOutput) { defer d.streamWg.Done() br := readerWrapper{r: r} - var seqPrepare = make(chan *blockDec, d.o.concurrent) var seqDecode = make(chan *blockDec, d.o.concurrent) var seqExecute = make(chan *blockDec, d.o.concurrent) - // Async 1: Prepare blocks... - go func() { - var hist history - var hasErr bool - for block := range seqPrepare { - if hasErr { - if block != nil { - seqDecode <- block - } - continue - } - if block.async.newHist != nil { - if debugDecoder { - println("Async 1: new history") - } - hist.reset() - if block.async.newHist.dict != nil { - hist.setDict(block.async.newHist.dict) - } - } - if block.err != nil || block.Type != blockTypeCompressed { - hasErr = block.err != nil - seqDecode <- block - continue - } - - remain, err := block.decodeLiterals(block.data, &hist) - block.err = err - hasErr = block.err != nil - if err == nil { - block.async.literals = hist.decoders.literals - block.async.seqData = remain - } else if debugDecoder { - println("decodeLiterals error:", err) - } - seqDecode <- block - } - close(seqDecode) - }() - - // Async 2: Decode sequences... + // Async 1: Decode sequences... go func() { var hist history var hasErr bool @@ -696,7 +662,7 @@ func (d *Decoder) startStreamDecoder(ctx context.Context, r io.Reader, output ch } if block.async.newHist != nil { if debugDecoder { - println("Async 2: new history, recent:", block.async.newHist.recentOffsets) + println("Async 1: new history, recent:", block.async.newHist.recentOffsets) } hist.decoders = block.async.newHist.decoders hist.recentOffsets = block.async.newHist.recentOffsets @@ -750,7 +716,7 @@ func (d *Decoder) startStreamDecoder(ctx context.Context, r io.Reader, output ch } if block.async.newHist != nil { if debugDecoder { - println("Async 3: new history") + println("Async 2: new history") } hist.windowSize = block.async.newHist.windowSize hist.allocFrameBuffer = block.async.newHist.allocFrameBuffer @@ -837,6 +803,33 @@ func (d *Decoder) startStreamDecoder(ctx context.Context, r io.Reader, output ch decodeStream: for { + var hist history + var hasErr bool + + decodeBlock := func(block *blockDec) { + if hasErr { + if block != nil { + seqDecode <- block + } + return + } + if block.err != nil || block.Type != blockTypeCompressed { + hasErr = block.err != nil + seqDecode <- block + return + } + + remain, err := block.decodeLiterals(block.data, &hist) + block.err = err + hasErr = block.err != nil + if err == nil { + block.async.literals = hist.decoders.literals + block.async.seqData = remain + } else if debugDecoder { + println("decodeLiterals error:", err) + } + seqDecode <- block + } frame := d.frame if debugDecoder { println("New frame...") @@ -863,7 +856,7 @@ decodeStream: case <-ctx.Done(): case dec := <-d.decoders: dec.sendErr(err) - seqPrepare <- dec + decodeBlock(dec) } break decodeStream } @@ -883,6 +876,10 @@ decodeStream: if debugDecoder { println("Alloc History:", h.allocFrameBuffer) } + hist.reset() + if h.dict != nil { + hist.setDict(h.dict) + } dec.async.newHist = &h dec.async.fcs = frame.FrameContentSize historySent = true @@ -909,7 +906,7 @@ decodeStream: } err = dec.err last := dec.Last - seqPrepare <- dec + decodeBlock(dec) if err != nil { break decodeStream } @@ -918,7 +915,7 @@ decodeStream: } } } - close(seqPrepare) + close(seqDecode) wg.Wait() d.frame.history.b = frameHistCache } diff --git a/vendor/github.com/klauspost/compress/zstd/decoder_options.go b/vendor/github.com/klauspost/compress/zstd/decoder_options.go index fd05c9bb..c70e6fa0 100644 --- a/vendor/github.com/klauspost/compress/zstd/decoder_options.go +++ b/vendor/github.com/klauspost/compress/zstd/decoder_options.go @@ -19,6 +19,7 @@ type decoderOptions struct { maxDecodedSize uint64 maxWindowSize uint64 dicts []dict + ignoreChecksum bool } func (o *decoderOptions) setDefault() { @@ -31,7 +32,7 @@ func (o *decoderOptions) setDefault() { if o.concurrent > 4 { o.concurrent = 4 } - o.maxDecodedSize = 1 << 63 + o.maxDecodedSize = 64 << 30 } // WithDecoderLowmem will set whether to use a lower amount of memory, @@ -66,7 +67,7 @@ func WithDecoderConcurrency(n int) DOption { // WithDecoderMaxMemory allows to set a maximum decoded size for in-memory // non-streaming operations or maximum window size for streaming operations. // This can be used to control memory usage of potentially hostile content. -// Maximum and default is 1 << 63 bytes. +// Maximum is 1 << 63 bytes. Default is 64GiB. func WithDecoderMaxMemory(n uint64) DOption { return func(o *decoderOptions) error { if n == 0 { @@ -112,3 +113,11 @@ func WithDecoderMaxWindow(size uint64) DOption { return nil } } + +// IgnoreChecksum allows to forcibly ignore checksum checking. +func IgnoreChecksum(b bool) DOption { + return func(o *decoderOptions) error { + o.ignoreChecksum = b + return nil + } +} diff --git a/vendor/github.com/klauspost/compress/zstd/enc_better.go b/vendor/github.com/klauspost/compress/zstd/enc_better.go index 602c05ee..c769f694 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_better.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_better.go @@ -156,8 +156,8 @@ encodeLoop: panic("offset0 was 0") } - nextHashS := hashLen(cv, betterShortTableBits, betterShortLen) nextHashL := hashLen(cv, betterLongTableBits, betterLongLen) + nextHashS := hashLen(cv, betterShortTableBits, betterShortLen) candidateL := e.longTable[nextHashL] candidateS := e.table[nextHashS] @@ -518,8 +518,8 @@ encodeLoop: } // Store this, since we have it. - nextHashS := hashLen(cv, betterShortTableBits, betterShortLen) nextHashL := hashLen(cv, betterLongTableBits, betterLongLen) + nextHashS := hashLen(cv, betterShortTableBits, betterShortLen) // We have at least 4 byte match. // No need to check backwards. We come straight from a match @@ -674,8 +674,8 @@ encodeLoop: panic("offset0 was 0") } - nextHashS := hashLen(cv, betterShortTableBits, betterShortLen) nextHashL := hashLen(cv, betterLongTableBits, betterLongLen) + nextHashS := hashLen(cv, betterShortTableBits, betterShortLen) candidateL := e.longTable[nextHashL] candidateS := e.table[nextHashS] @@ -1047,8 +1047,8 @@ encodeLoop: } // Store this, since we have it. - nextHashS := hashLen(cv, betterShortTableBits, betterShortLen) nextHashL := hashLen(cv, betterLongTableBits, betterLongLen) + nextHashS := hashLen(cv, betterShortTableBits, betterShortLen) // We have at least 4 byte match. // No need to check backwards. We come straight from a match diff --git a/vendor/github.com/klauspost/compress/zstd/enc_dfast.go b/vendor/github.com/klauspost/compress/zstd/enc_dfast.go index d6b31042..7ff0c64f 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_dfast.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_dfast.go @@ -127,8 +127,8 @@ encodeLoop: panic("offset0 was 0") } - nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen) nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen) + nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen) candidateL := e.longTable[nextHashL] candidateS := e.table[nextHashS] @@ -439,8 +439,8 @@ encodeLoop: var t int32 for { - nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen) nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen) + nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen) candidateL := e.longTable[nextHashL] candidateS := e.table[nextHashS] @@ -785,8 +785,8 @@ encodeLoop: panic("offset0 was 0") } - nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen) nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen) + nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen) candidateL := e.longTable[nextHashL] candidateS := e.table[nextHashS] @@ -969,7 +969,7 @@ encodeLoop: te0 := tableEntry{offset: index0 + e.cur, val: uint32(cv0)} te1 := tableEntry{offset: index1 + e.cur, val: uint32(cv1)} longHash1 := hashLen(cv0, dFastLongTableBits, dFastLongLen) - longHash2 := hashLen(cv0, dFastLongTableBits, dFastLongLen) + longHash2 := hashLen(cv1, dFastLongTableBits, dFastLongLen) e.longTable[longHash1] = te0 e.longTable[longHash2] = te1 e.markLongShardDirty(longHash1) @@ -1002,8 +1002,8 @@ encodeLoop: } // Store this, since we have it. - nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen) nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen) + nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen) // We have at least 4 byte match. // No need to check backwards. We come straight from a match diff --git a/vendor/github.com/klauspost/compress/zstd/encoder.go b/vendor/github.com/klauspost/compress/zstd/encoder.go index dcc987a7..e6b1d01c 100644 --- a/vendor/github.com/klauspost/compress/zstd/encoder.go +++ b/vendor/github.com/klauspost/compress/zstd/encoder.go @@ -551,7 +551,7 @@ func (e *Encoder) EncodeAll(src, dst []byte) []byte { } // If we can do everything in one block, prefer that. - if len(src) <= maxCompressedBlockSize { + if len(src) <= e.o.blockSize { enc.Reset(e.o.dict, true) // Slightly faster with no history and everything in one block. if e.o.crc { diff --git a/vendor/github.com/klauspost/compress/zstd/framedec.go b/vendor/github.com/klauspost/compress/zstd/framedec.go index 11089d22..fa0a633f 100644 --- a/vendor/github.com/klauspost/compress/zstd/framedec.go +++ b/vendor/github.com/klauspost/compress/zstd/framedec.go @@ -253,10 +253,11 @@ func (d *frameDec) reset(br byteBuffer) error { return ErrWindowSizeTooSmall } d.history.windowSize = int(d.WindowSize) - if d.o.lowMem && d.history.windowSize < maxBlockSize { + if !d.o.lowMem || d.history.windowSize < maxBlockSize { + // Alloc 2x window size if not low-mem, or very small window size. d.history.allocFrameBuffer = d.history.windowSize * 2 - // TODO: Maybe use FrameContent size } else { + // Alloc with one additional block d.history.allocFrameBuffer = d.history.windowSize + maxBlockSize } @@ -290,13 +291,6 @@ func (d *frameDec) checkCRC() error { if !d.HasCheckSum { return nil } - var tmp [4]byte - got := d.crc.Sum64() - // Flip to match file order. - tmp[0] = byte(got >> 0) - tmp[1] = byte(got >> 8) - tmp[2] = byte(got >> 16) - tmp[3] = byte(got >> 24) // We can overwrite upper tmp now want, err := d.rawInput.readSmall(4) @@ -305,7 +299,19 @@ func (d *frameDec) checkCRC() error { return err } - if !bytes.Equal(tmp[:], want) && !ignoreCRC { + if d.o.ignoreChecksum { + return nil + } + + var tmp [4]byte + got := d.crc.Sum64() + // Flip to match file order. + tmp[0] = byte(got >> 0) + tmp[1] = byte(got >> 8) + tmp[2] = byte(got >> 16) + tmp[3] = byte(got >> 24) + + if !bytes.Equal(tmp[:], want) { if debugDecoder { println("CRC Check Failed:", tmp[:], "!=", want) } @@ -317,6 +323,19 @@ func (d *frameDec) checkCRC() error { return nil } +// consumeCRC reads the checksum data if the frame has one. +func (d *frameDec) consumeCRC() error { + if d.HasCheckSum { + _, err := d.rawInput.readSmall(4) + if err != nil { + println("CRC missing?", err) + return err + } + } + + return nil +} + // runDecoder will create a sync decoder that will decode a block of data. func (d *frameDec) runDecoder(dst []byte, dec *blockDec) ([]byte, error) { saved := d.history.b @@ -326,6 +345,19 @@ func (d *frameDec) runDecoder(dst []byte, dec *blockDec) ([]byte, error) { d.history.ignoreBuffer = len(dst) // Store input length, so we only check new data. crcStart := len(dst) + d.history.decoders.maxSyncLen = 0 + if d.FrameContentSize != fcsUnknown { + d.history.decoders.maxSyncLen = d.FrameContentSize + uint64(len(dst)) + if d.history.decoders.maxSyncLen > d.o.maxDecodedSize { + return dst, ErrDecoderSizeExceeded + } + if uint64(cap(dst)) < d.history.decoders.maxSyncLen { + // Alloc for output + dst2 := make([]byte, len(dst), d.history.decoders.maxSyncLen+compressedBlockOverAlloc) + copy(dst2, dst) + dst = dst2 + } + } var err error for { err = dec.reset(d.rawInput, d.WindowSize) @@ -360,13 +392,17 @@ func (d *frameDec) runDecoder(dst []byte, dec *blockDec) ([]byte, error) { if d.FrameContentSize != fcsUnknown && uint64(len(d.history.b)-crcStart) != d.FrameContentSize { err = ErrFrameSizeMismatch } else if d.HasCheckSum { - var n int - n, err = d.crc.Write(dst[crcStart:]) - if err == nil { - if n != len(dst)-crcStart { - err = io.ErrShortWrite - } else { - err = d.checkCRC() + if d.o.ignoreChecksum { + err = d.consumeCRC() + } else { + var n int + n, err = d.crc.Write(dst[crcStart:]) + if err == nil { + if n != len(dst)-crcStart { + err = io.ErrShortWrite + } else { + err = d.checkCRC() + } } } } diff --git a/vendor/github.com/klauspost/compress/zstd/fse_decoder.go b/vendor/github.com/klauspost/compress/zstd/fse_decoder.go index bb3d4fd6..23333b96 100644 --- a/vendor/github.com/klauspost/compress/zstd/fse_decoder.go +++ b/vendor/github.com/klauspost/compress/zstd/fse_decoder.go @@ -5,8 +5,10 @@ package zstd import ( + "encoding/binary" "errors" "fmt" + "io" ) const ( @@ -182,6 +184,29 @@ func (s *fseDecoder) readNCount(b *byteReader, maxSymbol uint16) error { return s.buildDtable() } +func (s *fseDecoder) mustReadFrom(r io.Reader) { + fatalErr := func(err error) { + if err != nil { + panic(err) + } + } + // dt [maxTablesize]decSymbol // Decompression table. + // symbolLen uint16 // Length of active part of the symbol table. + // actualTableLog uint8 // Selected tablelog. + // maxBits uint8 // Maximum number of additional bits + // // used for table creation to avoid allocations. + // stateTable [256]uint16 + // norm [maxSymbolValue + 1]int16 + // preDefined bool + fatalErr(binary.Read(r, binary.LittleEndian, &s.dt)) + fatalErr(binary.Read(r, binary.LittleEndian, &s.symbolLen)) + fatalErr(binary.Read(r, binary.LittleEndian, &s.actualTableLog)) + fatalErr(binary.Read(r, binary.LittleEndian, &s.maxBits)) + fatalErr(binary.Read(r, binary.LittleEndian, &s.stateTable)) + fatalErr(binary.Read(r, binary.LittleEndian, &s.norm)) + fatalErr(binary.Read(r, binary.LittleEndian, &s.preDefined)) +} + // decSymbol contains information about a state entry, // Including the state offset base, the output symbol and // the number of bits to read for the low part of the destination state. @@ -204,18 +229,10 @@ func (d decSymbol) newState() uint16 { return uint16(d >> 16) } -func (d decSymbol) baseline() uint32 { - return uint32(d >> 32) -} - func (d decSymbol) baselineInt() int { return int(d >> 32) } -func (d *decSymbol) set(nbits, addBits uint8, newState uint16, baseline uint32) { - *d = decSymbol(nbits) | (decSymbol(addBits) << 8) | (decSymbol(newState) << 16) | (decSymbol(baseline) << 32) -} - func (d *decSymbol) setNBits(nBits uint8) { const mask = 0xffffffffffffff00 *d = (*d & mask) | decSymbol(nBits) @@ -231,11 +248,6 @@ func (d *decSymbol) setNewState(state uint16) { *d = (*d & mask) | decSymbol(state)<<16 } -func (d *decSymbol) setBaseline(baseline uint32) { - const mask = 0xffffffff - *d = (*d & mask) | decSymbol(baseline)<<32 -} - func (d *decSymbol) setExt(addBits uint8, baseline uint32) { const mask = 0xffff00ff *d = (*d & mask) | (decSymbol(addBits) << 8) | (decSymbol(baseline) << 32) @@ -352,34 +364,7 @@ func (s *fseState) init(br *bitReader, tableLog uint8, dt []decSymbol) { s.state = dt[br.getBits(tableLog)] } -// next returns the current symbol and sets the next state. -// At least tablelog bits must be available in the bit reader. -func (s *fseState) next(br *bitReader) { - lowBits := uint16(br.getBits(s.state.nbBits())) - s.state = s.dt[s.state.newState()+lowBits] -} - -// finished returns true if all bits have been read from the bitstream -// and the next state would require reading bits from the input. -func (s *fseState) finished(br *bitReader) bool { - return br.finished() && s.state.nbBits() > 0 -} - -// final returns the current state symbol without decoding the next. -func (s *fseState) final() (int, uint8) { - return s.state.baselineInt(), s.state.addBits() -} - // final returns the current state symbol without decoding the next. func (s decSymbol) final() (int, uint8) { return s.baselineInt(), s.addBits() } - -// nextFast returns the next symbol and sets the next state. -// This can only be used if no symbols are 0 bits. -// At least tablelog bits must be available in the bit reader. -func (s *fseState) nextFast(br *bitReader) (uint32, uint8) { - lowBits := br.get16BitsFast(s.state.nbBits()) - s.state = s.dt[s.state.newState()+lowBits] - return s.state.baseline(), s.state.addBits() -} diff --git a/vendor/github.com/klauspost/compress/zstd/fse_encoder.go b/vendor/github.com/klauspost/compress/zstd/fse_encoder.go index 5442061b..ab26326a 100644 --- a/vendor/github.com/klauspost/compress/zstd/fse_encoder.go +++ b/vendor/github.com/klauspost/compress/zstd/fse_encoder.go @@ -76,21 +76,6 @@ func (s *fseEncoder) HistogramFinished(maxSymbol uint8, maxCount int) { s.clearCount = maxCount != 0 } -// prepare will prepare and allocate scratch tables used for both compression and decompression. -func (s *fseEncoder) prepare() (*fseEncoder, error) { - if s == nil { - s = &fseEncoder{} - } - s.useRLE = false - if s.clearCount && s.maxCount == 0 { - for i := range s.count { - s.count[i] = 0 - } - s.clearCount = false - } - return s, nil -} - // allocCtable will allocate tables needed for compression. // If existing tables a re big enough, they are simply re-used. func (s *fseEncoder) allocCtable() { @@ -709,14 +694,6 @@ func (c *cState) init(bw *bitWriter, ct *cTable, first symbolTransform) { c.state = c.stateTable[lu] } -// encode the output symbol provided and write it to the bitstream. -func (c *cState) encode(symbolTT symbolTransform) { - nbBitsOut := (uint32(c.state) + symbolTT.deltaNbBits) >> 16 - dstState := int32(c.state>>(nbBitsOut&15)) + int32(symbolTT.deltaFindState) - c.bw.addBits16NC(c.state, uint8(nbBitsOut)) - c.state = c.stateTable[dstState] -} - // flush will write the tablelog to the output and flush the remaining full bytes. func (c *cState) flush(tableLog uint8) { c.bw.flush32() diff --git a/vendor/github.com/klauspost/compress/zstd/fuzz.go b/vendor/github.com/klauspost/compress/zstd/fuzz.go deleted file mode 100644 index 7f2210e0..00000000 --- a/vendor/github.com/klauspost/compress/zstd/fuzz.go +++ /dev/null @@ -1,11 +0,0 @@ -//go:build ignorecrc -// +build ignorecrc - -// Copyright 2019+ Klaus Post. All rights reserved. -// License information can be found in the LICENSE file. -// Based on work by Yann Collet, released under BSD License. - -package zstd - -// ignoreCRC can be used for fuzz testing to ignore CRC values... -const ignoreCRC = true diff --git a/vendor/github.com/klauspost/compress/zstd/fuzz_none.go b/vendor/github.com/klauspost/compress/zstd/fuzz_none.go deleted file mode 100644 index 6811c68a..00000000 --- a/vendor/github.com/klauspost/compress/zstd/fuzz_none.go +++ /dev/null @@ -1,11 +0,0 @@ -//go:build !ignorecrc -// +build !ignorecrc - -// Copyright 2019+ Klaus Post. All rights reserved. -// License information can be found in the LICENSE file. -// Based on work by Yann Collet, released under BSD License. - -package zstd - -// ignoreCRC can be used for fuzz testing to ignore CRC values... -const ignoreCRC = false diff --git a/vendor/github.com/klauspost/compress/zstd/hash.go b/vendor/github.com/klauspost/compress/zstd/hash.go index cf33f29a..5d73c21e 100644 --- a/vendor/github.com/klauspost/compress/zstd/hash.go +++ b/vendor/github.com/klauspost/compress/zstd/hash.go @@ -33,9 +33,3 @@ func hashLen(u uint64, length, mls uint8) uint32 { return (uint32(u) * prime4bytes) >> (32 - length) } } - -// hash3 returns the hash of the lower 3 bytes of u to fit in a hash table with h bits. -// Preferably h should be a constant and should always be <32. -func hash3(u uint32, h uint8) uint32 { - return ((u << (32 - 24)) * prime3bytes) >> ((32 - h) & 31) -} diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec.go b/vendor/github.com/klauspost/compress/zstd/seqdec.go index 819f1461..df044720 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec.go +++ b/vendor/github.com/klauspost/compress/zstd/seqdec.go @@ -73,6 +73,7 @@ type sequenceDecs struct { seqSize int windowSize int maxBits uint8 + maxSyncLen uint64 } // initialize all 3 decoders from the stream input. @@ -98,153 +99,13 @@ func (s *sequenceDecs) initialize(br *bitReader, hist *history, out []byte) erro return nil } -// decode sequences from the stream with the provided history. -func (s *sequenceDecs) decode(seqs []seqVals) error { - br := s.br - - // Grab full sizes tables, to avoid bounds checks. - llTable, mlTable, ofTable := s.litLengths.fse.dt[:maxTablesize], s.matchLengths.fse.dt[:maxTablesize], s.offsets.fse.dt[:maxTablesize] - llState, mlState, ofState := s.litLengths.state.state, s.matchLengths.state.state, s.offsets.state.state - s.seqSize = 0 - litRemain := len(s.literals) - maxBlockSize := maxCompressedBlockSize - if s.windowSize < maxBlockSize { - maxBlockSize = s.windowSize - } - for i := range seqs { - var ll, mo, ml int - if br.off > 4+((maxOffsetBits+16+16)>>3) { - // inlined function: - // ll, mo, ml = s.nextFast(br, llState, mlState, ofState) - - // Final will not read from stream. - var llB, mlB, moB uint8 - ll, llB = llState.final() - ml, mlB = mlState.final() - mo, moB = ofState.final() - - // extra bits are stored in reverse order. - br.fillFast() - mo += br.getBits(moB) - if s.maxBits > 32 { - br.fillFast() - } - ml += br.getBits(mlB) - ll += br.getBits(llB) - - if moB > 1 { - s.prevOffset[2] = s.prevOffset[1] - s.prevOffset[1] = s.prevOffset[0] - s.prevOffset[0] = mo - } else { - // mo = s.adjustOffset(mo, ll, moB) - // Inlined for rather big speedup - if ll == 0 { - // There is an exception though, when current sequence's literals_length = 0. - // In this case, repeated offsets are shifted by one, so an offset_value of 1 means Repeated_Offset2, - // an offset_value of 2 means Repeated_Offset3, and an offset_value of 3 means Repeated_Offset1 - 1_byte. - mo++ - } - - if mo == 0 { - mo = s.prevOffset[0] - } else { - var temp int - if mo == 3 { - temp = s.prevOffset[0] - 1 - } else { - temp = s.prevOffset[mo] - } - - if temp == 0 { - // 0 is not valid; input is corrupted; force offset to 1 - println("WARNING: temp was 0") - temp = 1 - } - - if mo != 1 { - s.prevOffset[2] = s.prevOffset[1] - } - s.prevOffset[1] = s.prevOffset[0] - s.prevOffset[0] = temp - mo = temp - } - } - br.fillFast() - } else { - if br.overread() { - if debugDecoder { - printf("reading sequence %d, exceeded available data\n", i) - } - return io.ErrUnexpectedEOF - } - ll, mo, ml = s.next(br, llState, mlState, ofState) - br.fill() - } - - if debugSequences { - println("Seq", i, "Litlen:", ll, "mo:", mo, "(abs) ml:", ml) - } - // Evaluate. - // We might be doing this async, so do it early. - if mo == 0 && ml > 0 { - return fmt.Errorf("zero matchoff and matchlen (%d) > 0", ml) - } - if ml > maxMatchLen { - return fmt.Errorf("match len (%d) bigger than max allowed length", ml) - } - s.seqSize += ll + ml - if s.seqSize > maxBlockSize { - return fmt.Errorf("output (%d) bigger than max block size (%d)", s.seqSize, maxBlockSize) - } - litRemain -= ll - if litRemain < 0 { - return fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", ll, litRemain+ll) - } - seqs[i] = seqVals{ - ll: ll, - ml: ml, - mo: mo, - } - if i == len(seqs)-1 { - // This is the last sequence, so we shouldn't update state. - break - } - - // Manually inlined, ~ 5-20% faster - // Update all 3 states at once. Approx 20% faster. - nBits := llState.nbBits() + mlState.nbBits() + ofState.nbBits() - if nBits == 0 { - llState = llTable[llState.newState()&maxTableMask] - mlState = mlTable[mlState.newState()&maxTableMask] - ofState = ofTable[ofState.newState()&maxTableMask] - } else { - bits := br.get32BitsFast(nBits) - lowBits := uint16(bits >> ((ofState.nbBits() + mlState.nbBits()) & 31)) - llState = llTable[(llState.newState()+lowBits)&maxTableMask] - - lowBits = uint16(bits >> (ofState.nbBits() & 31)) - lowBits &= bitMask[mlState.nbBits()&15] - mlState = mlTable[(mlState.newState()+lowBits)&maxTableMask] - - lowBits = uint16(bits) & bitMask[ofState.nbBits()&15] - ofState = ofTable[(ofState.newState()+lowBits)&maxTableMask] - } - } - s.seqSize += litRemain - if s.seqSize > maxBlockSize { - return fmt.Errorf("output (%d) bigger than max block size (%d)", s.seqSize, maxBlockSize) - } - err := br.close() - if err != nil { - printf("Closing sequences: %v, %+v\n", err, *br) - } - return err -} - // execute will execute the decoded sequence with the provided history. // The sequence must be evaluated before being sent. func (s *sequenceDecs) execute(seqs []seqVals, hist []byte) error { + if len(s.dict) == 0 { + return s.executeSimple(seqs, hist) + } + // Ensure we have enough output size... if len(s.out)+s.seqSize > cap(s.out) { addBytes := s.seqSize + len(s.out) @@ -327,6 +188,7 @@ func (s *sequenceDecs) execute(seqs []seqVals, hist []byte) error { } } } + // Add final literals copy(out[t:], s.literals) if debugDecoder { @@ -341,14 +203,18 @@ func (s *sequenceDecs) execute(seqs []seqVals, hist []byte) error { } // decode sequences from the stream with the provided history. -func (s *sequenceDecs) decodeSync(history *history) error { +func (s *sequenceDecs) decodeSync(hist []byte) error { + supported, err := s.decodeSyncSimple(hist) + if supported { + return err + } + br := s.br seqs := s.nSeqs startSize := len(s.out) // Grab full sizes tables, to avoid bounds checks. llTable, mlTable, ofTable := s.litLengths.fse.dt[:maxTablesize], s.matchLengths.fse.dt[:maxTablesize], s.offsets.fse.dt[:maxTablesize] llState, mlState, ofState := s.litLengths.state.state, s.matchLengths.state.state, s.offsets.state.state - hist := history.b[history.ignoreBuffer:] out := s.out maxBlockSize := maxCompressedBlockSize if s.windowSize < maxBlockSize { @@ -433,7 +299,7 @@ func (s *sequenceDecs) decodeSync(history *history) error { } size := ll + ml + len(out) if size-startSize > maxBlockSize { - return fmt.Errorf("output (%d) bigger than max block size (%d)", size, maxBlockSize) + return fmt.Errorf("output (%d) bigger than max block size (%d)", size-startSize, maxBlockSize) } if size > cap(out) { // Not enough size, which can happen under high volume block streaming conditions @@ -463,13 +329,13 @@ func (s *sequenceDecs) decodeSync(history *history) error { if mo > len(out)+len(hist) || mo > s.windowSize { if len(s.dict) == 0 { - return fmt.Errorf("match offset (%d) bigger than current history (%d)", mo, len(out)+len(hist)) + return fmt.Errorf("match offset (%d) bigger than current history (%d)", mo, len(out)+len(hist)-startSize) } // we may be in dictionary. dictO := len(s.dict) - (mo - (len(out) + len(hist))) if dictO < 0 || dictO >= len(s.dict) { - return fmt.Errorf("match offset (%d) bigger than current history (%d)", mo, len(out)+len(hist)) + return fmt.Errorf("match offset (%d) bigger than current history (%d)", mo, len(out)+len(hist)-startSize) } end := dictO + ml if end > len(s.dict) { @@ -530,6 +396,7 @@ func (s *sequenceDecs) decodeSync(history *history) error { ofState = ofTable[ofState.newState()&maxTableMask] } else { bits := br.get32BitsFast(nBits) + lowBits := uint16(bits >> ((ofState.nbBits() + mlState.nbBits()) & 31)) llState = llTable[(llState.newState()+lowBits)&maxTableMask] @@ -543,8 +410,8 @@ func (s *sequenceDecs) decodeSync(history *history) error { } // Check if space for literals - if len(s.literals)+len(s.out)-startSize > maxBlockSize { - return fmt.Errorf("output (%d) bigger than max block size (%d)", len(s.out), maxBlockSize) + if size := len(s.literals) + len(s.out) - startSize; size > maxBlockSize { + return fmt.Errorf("output (%d) bigger than max block size (%d)", size, maxBlockSize) } // Add final literals @@ -552,16 +419,6 @@ func (s *sequenceDecs) decodeSync(history *history) error { return br.close() } -// update states, at least 27 bits must be available. -func (s *sequenceDecs) update(br *bitReader) { - // Max 8 bits - s.litLengths.state.next(br) - // Max 9 bits - s.matchLengths.state.next(br) - // Max 8 bits - s.offsets.state.next(br) -} - var bitMask [16]uint16 func init() { @@ -570,87 +427,6 @@ func init() { } } -// update states, at least 27 bits must be available. -func (s *sequenceDecs) updateAlt(br *bitReader) { - // Update all 3 states at once. Approx 20% faster. - a, b, c := s.litLengths.state.state, s.matchLengths.state.state, s.offsets.state.state - - nBits := a.nbBits() + b.nbBits() + c.nbBits() - if nBits == 0 { - s.litLengths.state.state = s.litLengths.state.dt[a.newState()] - s.matchLengths.state.state = s.matchLengths.state.dt[b.newState()] - s.offsets.state.state = s.offsets.state.dt[c.newState()] - return - } - bits := br.get32BitsFast(nBits) - lowBits := uint16(bits >> ((c.nbBits() + b.nbBits()) & 31)) - s.litLengths.state.state = s.litLengths.state.dt[a.newState()+lowBits] - - lowBits = uint16(bits >> (c.nbBits() & 31)) - lowBits &= bitMask[b.nbBits()&15] - s.matchLengths.state.state = s.matchLengths.state.dt[b.newState()+lowBits] - - lowBits = uint16(bits) & bitMask[c.nbBits()&15] - s.offsets.state.state = s.offsets.state.dt[c.newState()+lowBits] -} - -// nextFast will return new states when there are at least 4 unused bytes left on the stream when done. -func (s *sequenceDecs) nextFast(br *bitReader, llState, mlState, ofState decSymbol) (ll, mo, ml int) { - // Final will not read from stream. - ll, llB := llState.final() - ml, mlB := mlState.final() - mo, moB := ofState.final() - - // extra bits are stored in reverse order. - br.fillFast() - mo += br.getBits(moB) - if s.maxBits > 32 { - br.fillFast() - } - ml += br.getBits(mlB) - ll += br.getBits(llB) - - if moB > 1 { - s.prevOffset[2] = s.prevOffset[1] - s.prevOffset[1] = s.prevOffset[0] - s.prevOffset[0] = mo - return - } - // mo = s.adjustOffset(mo, ll, moB) - // Inlined for rather big speedup - if ll == 0 { - // There is an exception though, when current sequence's literals_length = 0. - // In this case, repeated offsets are shifted by one, so an offset_value of 1 means Repeated_Offset2, - // an offset_value of 2 means Repeated_Offset3, and an offset_value of 3 means Repeated_Offset1 - 1_byte. - mo++ - } - - if mo == 0 { - mo = s.prevOffset[0] - return - } - var temp int - if mo == 3 { - temp = s.prevOffset[0] - 1 - } else { - temp = s.prevOffset[mo] - } - - if temp == 0 { - // 0 is not valid; input is corrupted; force offset to 1 - println("temp was 0") - temp = 1 - } - - if mo != 1 { - s.prevOffset[2] = s.prevOffset[1] - } - s.prevOffset[1] = s.prevOffset[0] - s.prevOffset[0] = temp - mo = temp - return -} - func (s *sequenceDecs) next(br *bitReader, llState, mlState, ofState decSymbol) (ll, mo, ml int) { // Final will not read from stream. ll, llB := llState.final() diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go new file mode 100644 index 00000000..847b322a --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go @@ -0,0 +1,362 @@ +//go:build amd64 && !appengine && !noasm && gc +// +build amd64,!appengine,!noasm,gc + +package zstd + +import ( + "fmt" + + "github.com/klauspost/compress/internal/cpuinfo" +) + +type decodeSyncAsmContext struct { + llTable []decSymbol + mlTable []decSymbol + ofTable []decSymbol + llState uint64 + mlState uint64 + ofState uint64 + iteration int + litRemain int + out []byte + outPosition int + literals []byte + litPosition int + history []byte + windowSize int + ll int // set on error (not for all errors, please refer to _generate/gen.go) + ml int // set on error (not for all errors, please refer to _generate/gen.go) + mo int // set on error (not for all errors, please refer to _generate/gen.go) +} + +// sequenceDecs_decodeSync_amd64 implements the main loop of sequenceDecs.decodeSync in x86 asm. +// +// Please refer to seqdec_generic.go for the reference implementation. +//go:noescape +func sequenceDecs_decodeSync_amd64(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int + +// sequenceDecs_decodeSync_bmi2 implements the main loop of sequenceDecs.decodeSync in x86 asm with BMI2 extensions. +//go:noescape +func sequenceDecs_decodeSync_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int + +// sequenceDecs_decodeSync_safe_amd64 does the same as above, but does not write more than output buffer. +//go:noescape +func sequenceDecs_decodeSync_safe_amd64(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int + +// sequenceDecs_decodeSync_safe_bmi2 does the same as above, but does not write more than output buffer. +//go:noescape +func sequenceDecs_decodeSync_safe_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int + +// decode sequences from the stream with the provided history but without a dictionary. +func (s *sequenceDecs) decodeSyncSimple(hist []byte) (bool, error) { + if len(s.dict) > 0 { + return false, nil + } + if s.maxSyncLen == 0 && cap(s.out)-len(s.out) < maxCompressedBlockSize { + return false, nil + } + useSafe := false + if s.maxSyncLen == 0 && cap(s.out)-len(s.out) < maxCompressedBlockSizeAlloc { + useSafe = true + } + if s.maxSyncLen > 0 && cap(s.out)-len(s.out)-compressedBlockOverAlloc < int(s.maxSyncLen) { + useSafe = true + } + if cap(s.literals) < len(s.literals)+compressedBlockOverAlloc { + useSafe = true + } + + br := s.br + + maxBlockSize := maxCompressedBlockSize + if s.windowSize < maxBlockSize { + maxBlockSize = s.windowSize + } + + ctx := decodeSyncAsmContext{ + llTable: s.litLengths.fse.dt[:maxTablesize], + mlTable: s.matchLengths.fse.dt[:maxTablesize], + ofTable: s.offsets.fse.dt[:maxTablesize], + llState: uint64(s.litLengths.state.state), + mlState: uint64(s.matchLengths.state.state), + ofState: uint64(s.offsets.state.state), + iteration: s.nSeqs - 1, + litRemain: len(s.literals), + out: s.out, + outPosition: len(s.out), + literals: s.literals, + windowSize: s.windowSize, + history: hist, + } + + s.seqSize = 0 + startSize := len(s.out) + + var errCode int + if cpuinfo.HasBMI2() { + if useSafe { + errCode = sequenceDecs_decodeSync_safe_bmi2(s, br, &ctx) + } else { + errCode = sequenceDecs_decodeSync_bmi2(s, br, &ctx) + } + } else { + if useSafe { + errCode = sequenceDecs_decodeSync_safe_amd64(s, br, &ctx) + } else { + errCode = sequenceDecs_decodeSync_amd64(s, br, &ctx) + } + } + switch errCode { + case noError: + break + + case errorMatchLenOfsMismatch: + return true, fmt.Errorf("zero matchoff and matchlen (%d) > 0", ctx.ml) + + case errorMatchLenTooBig: + return true, fmt.Errorf("match len (%d) bigger than max allowed length", ctx.ml) + + case errorMatchOffTooBig: + return true, fmt.Errorf("match offset (%d) bigger than current history (%d)", + ctx.mo, ctx.outPosition+len(hist)-startSize) + + case errorNotEnoughLiterals: + return true, fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", + ctx.ll, ctx.litRemain+ctx.ll) + + case errorNotEnoughSpace: + size := ctx.outPosition + ctx.ll + ctx.ml + if debugDecoder { + println("msl:", s.maxSyncLen, "cap", cap(s.out), "bef:", startSize, "sz:", size-startSize, "mbs:", maxBlockSize, "outsz:", cap(s.out)-startSize) + } + return true, fmt.Errorf("output (%d) bigger than max block size (%d)", size-startSize, maxBlockSize) + + default: + return true, fmt.Errorf("sequenceDecs_decode returned erronous code %d", errCode) + } + + s.seqSize += ctx.litRemain + if s.seqSize > maxBlockSize { + return true, fmt.Errorf("output (%d) bigger than max block size (%d)", s.seqSize, maxBlockSize) + } + err := br.close() + if err != nil { + printf("Closing sequences: %v, %+v\n", err, *br) + return true, err + } + + s.literals = s.literals[ctx.litPosition:] + t := ctx.outPosition + s.out = s.out[:t] + + // Add final literals + s.out = append(s.out, s.literals...) + if debugDecoder { + t += len(s.literals) + if t != len(s.out) { + panic(fmt.Errorf("length mismatch, want %d, got %d", len(s.out), t)) + } + } + + return true, nil +} + +// -------------------------------------------------------------------------------- + +type decodeAsmContext struct { + llTable []decSymbol + mlTable []decSymbol + ofTable []decSymbol + llState uint64 + mlState uint64 + ofState uint64 + iteration int + seqs []seqVals + litRemain int +} + +const noError = 0 + +// error reported when mo == 0 && ml > 0 +const errorMatchLenOfsMismatch = 1 + +// error reported when ml > maxMatchLen +const errorMatchLenTooBig = 2 + +// error reported when mo > available history or mo > s.windowSize +const errorMatchOffTooBig = 3 + +// error reported when the sum of literal lengths exeeceds the literal buffer size +const errorNotEnoughLiterals = 4 + +// error reported when capacity of `out` is too small +const errorNotEnoughSpace = 5 + +// sequenceDecs_decode implements the main loop of sequenceDecs in x86 asm. +// +// Please refer to seqdec_generic.go for the reference implementation. +//go:noescape +func sequenceDecs_decode_amd64(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int + +// sequenceDecs_decode implements the main loop of sequenceDecs in x86 asm. +// +// Please refer to seqdec_generic.go for the reference implementation. +//go:noescape +func sequenceDecs_decode_56_amd64(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int + +// sequenceDecs_decode implements the main loop of sequenceDecs in x86 asm with BMI2 extensions. +//go:noescape +func sequenceDecs_decode_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int + +// sequenceDecs_decode implements the main loop of sequenceDecs in x86 asm with BMI2 extensions. +//go:noescape +func sequenceDecs_decode_56_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int + +// decode sequences from the stream without the provided history. +func (s *sequenceDecs) decode(seqs []seqVals) error { + br := s.br + + maxBlockSize := maxCompressedBlockSize + if s.windowSize < maxBlockSize { + maxBlockSize = s.windowSize + } + + ctx := decodeAsmContext{ + llTable: s.litLengths.fse.dt[:maxTablesize], + mlTable: s.matchLengths.fse.dt[:maxTablesize], + ofTable: s.offsets.fse.dt[:maxTablesize], + llState: uint64(s.litLengths.state.state), + mlState: uint64(s.matchLengths.state.state), + ofState: uint64(s.offsets.state.state), + seqs: seqs, + iteration: len(seqs) - 1, + litRemain: len(s.literals), + } + + s.seqSize = 0 + lte56bits := s.maxBits+s.offsets.fse.actualTableLog+s.matchLengths.fse.actualTableLog+s.litLengths.fse.actualTableLog <= 56 + var errCode int + if cpuinfo.HasBMI2() { + if lte56bits { + errCode = sequenceDecs_decode_56_bmi2(s, br, &ctx) + } else { + errCode = sequenceDecs_decode_bmi2(s, br, &ctx) + } + } else { + if lte56bits { + errCode = sequenceDecs_decode_56_amd64(s, br, &ctx) + } else { + errCode = sequenceDecs_decode_amd64(s, br, &ctx) + } + } + if errCode != 0 { + i := len(seqs) - ctx.iteration - 1 + switch errCode { + case errorMatchLenOfsMismatch: + ml := ctx.seqs[i].ml + return fmt.Errorf("zero matchoff and matchlen (%d) > 0", ml) + + case errorMatchLenTooBig: + ml := ctx.seqs[i].ml + return fmt.Errorf("match len (%d) bigger than max allowed length", ml) + + case errorNotEnoughLiterals: + ll := ctx.seqs[i].ll + return fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", ll, ctx.litRemain+ll) + } + + return fmt.Errorf("sequenceDecs_decode_amd64 returned erronous code %d", errCode) + } + + if ctx.litRemain < 0 { + return fmt.Errorf("literal count is too big: total available %d, total requested %d", + len(s.literals), len(s.literals)-ctx.litRemain) + } + + s.seqSize += ctx.litRemain + if s.seqSize > maxBlockSize { + return fmt.Errorf("output (%d) bigger than max block size (%d)", s.seqSize, maxBlockSize) + } + err := br.close() + if err != nil { + printf("Closing sequences: %v, %+v\n", err, *br) + } + return err +} + +// -------------------------------------------------------------------------------- + +type executeAsmContext struct { + seqs []seqVals + seqIndex int + out []byte + history []byte + literals []byte + outPosition int + litPosition int + windowSize int +} + +// sequenceDecs_executeSimple_amd64 implements the main loop of sequenceDecs.executeSimple in x86 asm. +// +// Returns false if a match offset is too big. +// +// Please refer to seqdec_generic.go for the reference implementation. +//go:noescape +func sequenceDecs_executeSimple_amd64(ctx *executeAsmContext) bool + +// Same as above, but with safe memcopies +//go:noescape +func sequenceDecs_executeSimple_safe_amd64(ctx *executeAsmContext) bool + +// executeSimple handles cases when dictionary is not used. +func (s *sequenceDecs) executeSimple(seqs []seqVals, hist []byte) error { + // Ensure we have enough output size... + if len(s.out)+s.seqSize+compressedBlockOverAlloc > cap(s.out) { + addBytes := s.seqSize + len(s.out) + compressedBlockOverAlloc + s.out = append(s.out, make([]byte, addBytes)...) + s.out = s.out[:len(s.out)-addBytes] + } + + if debugDecoder { + printf("Execute %d seqs with literals: %d into %d bytes\n", len(seqs), len(s.literals), s.seqSize) + } + + var t = len(s.out) + out := s.out[:t+s.seqSize] + + ctx := executeAsmContext{ + seqs: seqs, + seqIndex: 0, + out: out, + history: hist, + outPosition: t, + litPosition: 0, + literals: s.literals, + windowSize: s.windowSize, + } + var ok bool + if cap(s.literals) < len(s.literals)+compressedBlockOverAlloc { + ok = sequenceDecs_executeSimple_safe_amd64(&ctx) + } else { + ok = sequenceDecs_executeSimple_amd64(&ctx) + } + if !ok { + return fmt.Errorf("match offset (%d) bigger than current history (%d)", + seqs[ctx.seqIndex].mo, ctx.outPosition+len(hist)) + } + s.literals = s.literals[ctx.litPosition:] + t = ctx.outPosition + + // Add final literals + copy(out[t:], s.literals) + if debugDecoder { + t += len(s.literals) + if t != len(out) { + panic(fmt.Errorf("length mismatch, want %d, got %d, ss: %d", len(out), t, s.seqSize)) + } + } + s.out = out + + return nil +} diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s new file mode 100644 index 00000000..212c6cac --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s @@ -0,0 +1,3689 @@ +// Code generated by command: go run gen.go -out ../seqdec_amd64.s -pkg=zstd. DO NOT EDIT. + +//go:build !appengine && !noasm && gc && !noasm +// +build !appengine,!noasm,gc,!noasm + +// func sequenceDecs_decode_amd64(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int +// Requires: CMOV +TEXT ·sequenceDecs_decode_amd64(SB), $8-32 + MOVQ br+8(FP), AX + MOVQ 32(AX), DX + MOVBQZX 40(AX), BX + MOVQ 24(AX), SI + MOVQ (AX), AX + ADDQ SI, AX + MOVQ AX, (SP) + MOVQ ctx+16(FP), AX + MOVQ 72(AX), DI + MOVQ 80(AX), R8 + MOVQ 88(AX), R9 + MOVQ 104(AX), R10 + MOVQ s+0(FP), AX + MOVQ 144(AX), R11 + MOVQ 152(AX), R12 + MOVQ 160(AX), R13 + +sequenceDecs_decode_amd64_main_loop: + MOVQ (SP), R14 + + // Fill bitreader to have enough for the offset and match length. + CMPQ SI, $0x08 + JL sequenceDecs_decode_amd64_fill_byte_by_byte + MOVQ BX, AX + SHRQ $0x03, AX + SUBQ AX, R14 + MOVQ (R14), DX + SUBQ AX, SI + ANDQ $0x07, BX + JMP sequenceDecs_decode_amd64_fill_end + +sequenceDecs_decode_amd64_fill_byte_by_byte: + CMPQ SI, $0x00 + JLE sequenceDecs_decode_amd64_fill_end + CMPQ BX, $0x07 + JLE sequenceDecs_decode_amd64_fill_end + SHLQ $0x08, DX + SUBQ $0x01, R14 + SUBQ $0x01, SI + SUBQ $0x08, BX + MOVBQZX (R14), AX + ORQ AX, DX + JMP sequenceDecs_decode_amd64_fill_byte_by_byte + +sequenceDecs_decode_amd64_fill_end: + // Update offset + MOVQ R9, AX + MOVQ BX, CX + MOVQ DX, R15 + SHLQ CL, R15 + MOVB AH, CL + ADDQ CX, BX + NEGL CX + SHRQ CL, R15 + SHRQ $0x20, AX + TESTQ CX, CX + CMOVQEQ CX, R15 + ADDQ R15, AX + MOVQ AX, 16(R10) + + // Update match length + MOVQ R8, AX + MOVQ BX, CX + MOVQ DX, R15 + SHLQ CL, R15 + MOVB AH, CL + ADDQ CX, BX + NEGL CX + SHRQ CL, R15 + SHRQ $0x20, AX + TESTQ CX, CX + CMOVQEQ CX, R15 + ADDQ R15, AX + MOVQ AX, 8(R10) + + // Fill bitreader to have enough for the remaining + CMPQ SI, $0x08 + JL sequenceDecs_decode_amd64_fill_2_byte_by_byte + MOVQ BX, AX + SHRQ $0x03, AX + SUBQ AX, R14 + MOVQ (R14), DX + SUBQ AX, SI + ANDQ $0x07, BX + JMP sequenceDecs_decode_amd64_fill_2_end + +sequenceDecs_decode_amd64_fill_2_byte_by_byte: + CMPQ SI, $0x00 + JLE sequenceDecs_decode_amd64_fill_2_end + CMPQ BX, $0x07 + JLE sequenceDecs_decode_amd64_fill_2_end + SHLQ $0x08, DX + SUBQ $0x01, R14 + SUBQ $0x01, SI + SUBQ $0x08, BX + MOVBQZX (R14), AX + ORQ AX, DX + JMP sequenceDecs_decode_amd64_fill_2_byte_by_byte + +sequenceDecs_decode_amd64_fill_2_end: + // Update literal length + MOVQ DI, AX + MOVQ BX, CX + MOVQ DX, R15 + SHLQ CL, R15 + MOVB AH, CL + ADDQ CX, BX + NEGL CX + SHRQ CL, R15 + SHRQ $0x20, AX + TESTQ CX, CX + CMOVQEQ CX, R15 + ADDQ R15, AX + MOVQ AX, (R10) + + // Fill bitreader for state updates + MOVQ R14, (SP) + MOVQ R9, AX + SHRQ $0x08, AX + MOVBQZX AL, AX + MOVQ ctx+16(FP), CX + CMPQ 96(CX), $0x00 + JZ sequenceDecs_decode_amd64_skip_update + + // Update Literal Length State + MOVBQZX DI, R14 + SHRQ $0x10, DI + MOVWQZX DI, DI + CMPQ R14, $0x00 + JZ sequenceDecs_decode_amd64_llState_updateState_skip_zero + MOVQ BX, CX + ADDQ R14, BX + MOVQ DX, R15 + SHLQ CL, R15 + MOVQ R14, CX + NEGQ CX + SHRQ CL, R15 + ADDQ R15, DI + +sequenceDecs_decode_amd64_llState_updateState_skip_zero: + // Load ctx.llTable + MOVQ ctx+16(FP), CX + MOVQ (CX), CX + MOVQ (CX)(DI*8), DI + + // Update Match Length State + MOVBQZX R8, R14 + SHRQ $0x10, R8 + MOVWQZX R8, R8 + CMPQ R14, $0x00 + JZ sequenceDecs_decode_amd64_mlState_updateState_skip_zero + MOVQ BX, CX + ADDQ R14, BX + MOVQ DX, R15 + SHLQ CL, R15 + MOVQ R14, CX + NEGQ CX + SHRQ CL, R15 + ADDQ R15, R8 + +sequenceDecs_decode_amd64_mlState_updateState_skip_zero: + // Load ctx.mlTable + MOVQ ctx+16(FP), CX + MOVQ 24(CX), CX + MOVQ (CX)(R8*8), R8 + + // Update Offset State + MOVBQZX R9, R14 + SHRQ $0x10, R9 + MOVWQZX R9, R9 + CMPQ R14, $0x00 + JZ sequenceDecs_decode_amd64_ofState_updateState_skip_zero + MOVQ BX, CX + ADDQ R14, BX + MOVQ DX, R15 + SHLQ CL, R15 + MOVQ R14, CX + NEGQ CX + SHRQ CL, R15 + ADDQ R15, R9 + +sequenceDecs_decode_amd64_ofState_updateState_skip_zero: + // Load ctx.ofTable + MOVQ ctx+16(FP), CX + MOVQ 48(CX), CX + MOVQ (CX)(R9*8), R9 + +sequenceDecs_decode_amd64_skip_update: + // Adjust offset + MOVQ 16(R10), CX + CMPQ AX, $0x01 + JBE sequenceDecs_decode_amd64_adjust_offsetB_1_or_0 + MOVQ R12, R13 + MOVQ R11, R12 + MOVQ CX, R11 + JMP sequenceDecs_decode_amd64_adjust_end + +sequenceDecs_decode_amd64_adjust_offsetB_1_or_0: + CMPQ (R10), $0x00000000 + JNE sequenceDecs_decode_amd64_adjust_offset_maybezero + INCQ CX + JMP sequenceDecs_decode_amd64_adjust_offset_nonzero + +sequenceDecs_decode_amd64_adjust_offset_maybezero: + TESTQ CX, CX + JNZ sequenceDecs_decode_amd64_adjust_offset_nonzero + MOVQ R11, CX + JMP sequenceDecs_decode_amd64_adjust_end + +sequenceDecs_decode_amd64_adjust_offset_nonzero: + CMPQ CX, $0x01 + JB sequenceDecs_decode_amd64_adjust_zero + JEQ sequenceDecs_decode_amd64_adjust_one + CMPQ CX, $0x02 + JA sequenceDecs_decode_amd64_adjust_three + JMP sequenceDecs_decode_amd64_adjust_two + +sequenceDecs_decode_amd64_adjust_zero: + MOVQ R11, AX + JMP sequenceDecs_decode_amd64_adjust_test_temp_valid + +sequenceDecs_decode_amd64_adjust_one: + MOVQ R12, AX + JMP sequenceDecs_decode_amd64_adjust_test_temp_valid + +sequenceDecs_decode_amd64_adjust_two: + MOVQ R13, AX + JMP sequenceDecs_decode_amd64_adjust_test_temp_valid + +sequenceDecs_decode_amd64_adjust_three: + LEAQ -1(R11), AX + +sequenceDecs_decode_amd64_adjust_test_temp_valid: + TESTQ AX, AX + JNZ sequenceDecs_decode_amd64_adjust_temp_valid + MOVQ $0x00000001, AX + +sequenceDecs_decode_amd64_adjust_temp_valid: + CMPQ CX, $0x01 + CMOVQNE R12, R13 + MOVQ R11, R12 + MOVQ AX, R11 + MOVQ AX, CX + +sequenceDecs_decode_amd64_adjust_end: + MOVQ CX, 16(R10) + + // Check values + MOVQ 8(R10), AX + MOVQ (R10), R14 + LEAQ (AX)(R14*1), R15 + MOVQ s+0(FP), BP + ADDQ R15, 256(BP) + MOVQ ctx+16(FP), R15 + SUBQ R14, 128(R15) + JS error_not_enough_literals + CMPQ AX, $0x00020002 + JA sequenceDecs_decode_amd64_error_match_len_too_big + TESTQ CX, CX + JNZ sequenceDecs_decode_amd64_match_len_ofs_ok + TESTQ AX, AX + JNZ sequenceDecs_decode_amd64_error_match_len_ofs_mismatch + +sequenceDecs_decode_amd64_match_len_ofs_ok: + ADDQ $0x18, R10 + MOVQ ctx+16(FP), AX + DECQ 96(AX) + JNS sequenceDecs_decode_amd64_main_loop + MOVQ s+0(FP), AX + MOVQ R11, 144(AX) + MOVQ R12, 152(AX) + MOVQ R13, 160(AX) + MOVQ br+8(FP), AX + MOVQ DX, 32(AX) + MOVB BL, 40(AX) + MOVQ SI, 24(AX) + + // Return success + MOVQ $0x00000000, ret+24(FP) + RET + + // Return with match length error +sequenceDecs_decode_amd64_error_match_len_ofs_mismatch: + MOVQ $0x00000001, ret+24(FP) + RET + + // Return with match too long error +sequenceDecs_decode_amd64_error_match_len_too_big: + MOVQ $0x00000002, ret+24(FP) + RET + + // Return with match offset too long error + MOVQ $0x00000003, ret+24(FP) + RET + + // Return with not enough literals error +error_not_enough_literals: + MOVQ $0x00000004, ret+24(FP) + RET + + // Return with not enough output space error + MOVQ $0x00000005, ret+24(FP) + RET + +// func sequenceDecs_decode_56_amd64(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int +// Requires: CMOV +TEXT ·sequenceDecs_decode_56_amd64(SB), $8-32 + MOVQ br+8(FP), AX + MOVQ 32(AX), DX + MOVBQZX 40(AX), BX + MOVQ 24(AX), SI + MOVQ (AX), AX + ADDQ SI, AX + MOVQ AX, (SP) + MOVQ ctx+16(FP), AX + MOVQ 72(AX), DI + MOVQ 80(AX), R8 + MOVQ 88(AX), R9 + MOVQ 104(AX), R10 + MOVQ s+0(FP), AX + MOVQ 144(AX), R11 + MOVQ 152(AX), R12 + MOVQ 160(AX), R13 + +sequenceDecs_decode_56_amd64_main_loop: + MOVQ (SP), R14 + + // Fill bitreader to have enough for the offset and match length. + CMPQ SI, $0x08 + JL sequenceDecs_decode_56_amd64_fill_byte_by_byte + MOVQ BX, AX + SHRQ $0x03, AX + SUBQ AX, R14 + MOVQ (R14), DX + SUBQ AX, SI + ANDQ $0x07, BX + JMP sequenceDecs_decode_56_amd64_fill_end + +sequenceDecs_decode_56_amd64_fill_byte_by_byte: + CMPQ SI, $0x00 + JLE sequenceDecs_decode_56_amd64_fill_end + CMPQ BX, $0x07 + JLE sequenceDecs_decode_56_amd64_fill_end + SHLQ $0x08, DX + SUBQ $0x01, R14 + SUBQ $0x01, SI + SUBQ $0x08, BX + MOVBQZX (R14), AX + ORQ AX, DX + JMP sequenceDecs_decode_56_amd64_fill_byte_by_byte + +sequenceDecs_decode_56_amd64_fill_end: + // Update offset + MOVQ R9, AX + MOVQ BX, CX + MOVQ DX, R15 + SHLQ CL, R15 + MOVB AH, CL + ADDQ CX, BX + NEGL CX + SHRQ CL, R15 + SHRQ $0x20, AX + TESTQ CX, CX + CMOVQEQ CX, R15 + ADDQ R15, AX + MOVQ AX, 16(R10) + + // Update match length + MOVQ R8, AX + MOVQ BX, CX + MOVQ DX, R15 + SHLQ CL, R15 + MOVB AH, CL + ADDQ CX, BX + NEGL CX + SHRQ CL, R15 + SHRQ $0x20, AX + TESTQ CX, CX + CMOVQEQ CX, R15 + ADDQ R15, AX + MOVQ AX, 8(R10) + + // Update literal length + MOVQ DI, AX + MOVQ BX, CX + MOVQ DX, R15 + SHLQ CL, R15 + MOVB AH, CL + ADDQ CX, BX + NEGL CX + SHRQ CL, R15 + SHRQ $0x20, AX + TESTQ CX, CX + CMOVQEQ CX, R15 + ADDQ R15, AX + MOVQ AX, (R10) + + // Fill bitreader for state updates + MOVQ R14, (SP) + MOVQ R9, AX + SHRQ $0x08, AX + MOVBQZX AL, AX + MOVQ ctx+16(FP), CX + CMPQ 96(CX), $0x00 + JZ sequenceDecs_decode_56_amd64_skip_update + + // Update Literal Length State + MOVBQZX DI, R14 + SHRQ $0x10, DI + MOVWQZX DI, DI + CMPQ R14, $0x00 + JZ sequenceDecs_decode_56_amd64_llState_updateState_skip_zero + MOVQ BX, CX + ADDQ R14, BX + MOVQ DX, R15 + SHLQ CL, R15 + MOVQ R14, CX + NEGQ CX + SHRQ CL, R15 + ADDQ R15, DI + +sequenceDecs_decode_56_amd64_llState_updateState_skip_zero: + // Load ctx.llTable + MOVQ ctx+16(FP), CX + MOVQ (CX), CX + MOVQ (CX)(DI*8), DI + + // Update Match Length State + MOVBQZX R8, R14 + SHRQ $0x10, R8 + MOVWQZX R8, R8 + CMPQ R14, $0x00 + JZ sequenceDecs_decode_56_amd64_mlState_updateState_skip_zero + MOVQ BX, CX + ADDQ R14, BX + MOVQ DX, R15 + SHLQ CL, R15 + MOVQ R14, CX + NEGQ CX + SHRQ CL, R15 + ADDQ R15, R8 + +sequenceDecs_decode_56_amd64_mlState_updateState_skip_zero: + // Load ctx.mlTable + MOVQ ctx+16(FP), CX + MOVQ 24(CX), CX + MOVQ (CX)(R8*8), R8 + + // Update Offset State + MOVBQZX R9, R14 + SHRQ $0x10, R9 + MOVWQZX R9, R9 + CMPQ R14, $0x00 + JZ sequenceDecs_decode_56_amd64_ofState_updateState_skip_zero + MOVQ BX, CX + ADDQ R14, BX + MOVQ DX, R15 + SHLQ CL, R15 + MOVQ R14, CX + NEGQ CX + SHRQ CL, R15 + ADDQ R15, R9 + +sequenceDecs_decode_56_amd64_ofState_updateState_skip_zero: + // Load ctx.ofTable + MOVQ ctx+16(FP), CX + MOVQ 48(CX), CX + MOVQ (CX)(R9*8), R9 + +sequenceDecs_decode_56_amd64_skip_update: + // Adjust offset + MOVQ 16(R10), CX + CMPQ AX, $0x01 + JBE sequenceDecs_decode_56_amd64_adjust_offsetB_1_or_0 + MOVQ R12, R13 + MOVQ R11, R12 + MOVQ CX, R11 + JMP sequenceDecs_decode_56_amd64_adjust_end + +sequenceDecs_decode_56_amd64_adjust_offsetB_1_or_0: + CMPQ (R10), $0x00000000 + JNE sequenceDecs_decode_56_amd64_adjust_offset_maybezero + INCQ CX + JMP sequenceDecs_decode_56_amd64_adjust_offset_nonzero + +sequenceDecs_decode_56_amd64_adjust_offset_maybezero: + TESTQ CX, CX + JNZ sequenceDecs_decode_56_amd64_adjust_offset_nonzero + MOVQ R11, CX + JMP sequenceDecs_decode_56_amd64_adjust_end + +sequenceDecs_decode_56_amd64_adjust_offset_nonzero: + CMPQ CX, $0x01 + JB sequenceDecs_decode_56_amd64_adjust_zero + JEQ sequenceDecs_decode_56_amd64_adjust_one + CMPQ CX, $0x02 + JA sequenceDecs_decode_56_amd64_adjust_three + JMP sequenceDecs_decode_56_amd64_adjust_two + +sequenceDecs_decode_56_amd64_adjust_zero: + MOVQ R11, AX + JMP sequenceDecs_decode_56_amd64_adjust_test_temp_valid + +sequenceDecs_decode_56_amd64_adjust_one: + MOVQ R12, AX + JMP sequenceDecs_decode_56_amd64_adjust_test_temp_valid + +sequenceDecs_decode_56_amd64_adjust_two: + MOVQ R13, AX + JMP sequenceDecs_decode_56_amd64_adjust_test_temp_valid + +sequenceDecs_decode_56_amd64_adjust_three: + LEAQ -1(R11), AX + +sequenceDecs_decode_56_amd64_adjust_test_temp_valid: + TESTQ AX, AX + JNZ sequenceDecs_decode_56_amd64_adjust_temp_valid + MOVQ $0x00000001, AX + +sequenceDecs_decode_56_amd64_adjust_temp_valid: + CMPQ CX, $0x01 + CMOVQNE R12, R13 + MOVQ R11, R12 + MOVQ AX, R11 + MOVQ AX, CX + +sequenceDecs_decode_56_amd64_adjust_end: + MOVQ CX, 16(R10) + + // Check values + MOVQ 8(R10), AX + MOVQ (R10), R14 + LEAQ (AX)(R14*1), R15 + MOVQ s+0(FP), BP + ADDQ R15, 256(BP) + MOVQ ctx+16(FP), R15 + SUBQ R14, 128(R15) + JS error_not_enough_literals + CMPQ AX, $0x00020002 + JA sequenceDecs_decode_56_amd64_error_match_len_too_big + TESTQ CX, CX + JNZ sequenceDecs_decode_56_amd64_match_len_ofs_ok + TESTQ AX, AX + JNZ sequenceDecs_decode_56_amd64_error_match_len_ofs_mismatch + +sequenceDecs_decode_56_amd64_match_len_ofs_ok: + ADDQ $0x18, R10 + MOVQ ctx+16(FP), AX + DECQ 96(AX) + JNS sequenceDecs_decode_56_amd64_main_loop + MOVQ s+0(FP), AX + MOVQ R11, 144(AX) + MOVQ R12, 152(AX) + MOVQ R13, 160(AX) + MOVQ br+8(FP), AX + MOVQ DX, 32(AX) + MOVB BL, 40(AX) + MOVQ SI, 24(AX) + + // Return success + MOVQ $0x00000000, ret+24(FP) + RET + + // Return with match length error +sequenceDecs_decode_56_amd64_error_match_len_ofs_mismatch: + MOVQ $0x00000001, ret+24(FP) + RET + + // Return with match too long error +sequenceDecs_decode_56_amd64_error_match_len_too_big: + MOVQ $0x00000002, ret+24(FP) + RET + + // Return with match offset too long error + MOVQ $0x00000003, ret+24(FP) + RET + + // Return with not enough literals error +error_not_enough_literals: + MOVQ $0x00000004, ret+24(FP) + RET + + // Return with not enough output space error + MOVQ $0x00000005, ret+24(FP) + RET + +// func sequenceDecs_decode_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int +// Requires: BMI, BMI2, CMOV +TEXT ·sequenceDecs_decode_bmi2(SB), $8-32 + MOVQ br+8(FP), CX + MOVQ 32(CX), AX + MOVBQZX 40(CX), DX + MOVQ 24(CX), BX + MOVQ (CX), CX + ADDQ BX, CX + MOVQ CX, (SP) + MOVQ ctx+16(FP), CX + MOVQ 72(CX), SI + MOVQ 80(CX), DI + MOVQ 88(CX), R8 + MOVQ 104(CX), R9 + MOVQ s+0(FP), CX + MOVQ 144(CX), R10 + MOVQ 152(CX), R11 + MOVQ 160(CX), R12 + +sequenceDecs_decode_bmi2_main_loop: + MOVQ (SP), R13 + + // Fill bitreader to have enough for the offset and match length. + CMPQ BX, $0x08 + JL sequenceDecs_decode_bmi2_fill_byte_by_byte + MOVQ DX, CX + SHRQ $0x03, CX + SUBQ CX, R13 + MOVQ (R13), AX + SUBQ CX, BX + ANDQ $0x07, DX + JMP sequenceDecs_decode_bmi2_fill_end + +sequenceDecs_decode_bmi2_fill_byte_by_byte: + CMPQ BX, $0x00 + JLE sequenceDecs_decode_bmi2_fill_end + CMPQ DX, $0x07 + JLE sequenceDecs_decode_bmi2_fill_end + SHLQ $0x08, AX + SUBQ $0x01, R13 + SUBQ $0x01, BX + SUBQ $0x08, DX + MOVBQZX (R13), CX + ORQ CX, AX + JMP sequenceDecs_decode_bmi2_fill_byte_by_byte + +sequenceDecs_decode_bmi2_fill_end: + // Update offset + MOVQ $0x00000808, CX + BEXTRQ CX, R8, R14 + MOVQ AX, R15 + LEAQ (DX)(R14*1), CX + ROLQ CL, R15 + BZHIQ R14, R15, R15 + MOVQ CX, DX + MOVQ R8, CX + SHRQ $0x20, CX + ADDQ R15, CX + MOVQ CX, 16(R9) + + // Update match length + MOVQ $0x00000808, CX + BEXTRQ CX, DI, R14 + MOVQ AX, R15 + LEAQ (DX)(R14*1), CX + ROLQ CL, R15 + BZHIQ R14, R15, R15 + MOVQ CX, DX + MOVQ DI, CX + SHRQ $0x20, CX + ADDQ R15, CX + MOVQ CX, 8(R9) + + // Fill bitreader to have enough for the remaining + CMPQ BX, $0x08 + JL sequenceDecs_decode_bmi2_fill_2_byte_by_byte + MOVQ DX, CX + SHRQ $0x03, CX + SUBQ CX, R13 + MOVQ (R13), AX + SUBQ CX, BX + ANDQ $0x07, DX + JMP sequenceDecs_decode_bmi2_fill_2_end + +sequenceDecs_decode_bmi2_fill_2_byte_by_byte: + CMPQ BX, $0x00 + JLE sequenceDecs_decode_bmi2_fill_2_end + CMPQ DX, $0x07 + JLE sequenceDecs_decode_bmi2_fill_2_end + SHLQ $0x08, AX + SUBQ $0x01, R13 + SUBQ $0x01, BX + SUBQ $0x08, DX + MOVBQZX (R13), CX + ORQ CX, AX + JMP sequenceDecs_decode_bmi2_fill_2_byte_by_byte + +sequenceDecs_decode_bmi2_fill_2_end: + // Update literal length + MOVQ $0x00000808, CX + BEXTRQ CX, SI, R14 + MOVQ AX, R15 + LEAQ (DX)(R14*1), CX + ROLQ CL, R15 + BZHIQ R14, R15, R15 + MOVQ CX, DX + MOVQ SI, CX + SHRQ $0x20, CX + ADDQ R15, CX + MOVQ CX, (R9) + + // Fill bitreader for state updates + MOVQ R13, (SP) + MOVQ $0x00000808, CX + BEXTRQ CX, R8, R13 + MOVQ ctx+16(FP), CX + CMPQ 96(CX), $0x00 + JZ sequenceDecs_decode_bmi2_skip_update + LEAQ (SI)(DI*1), R14 + ADDQ R8, R14 + MOVBQZX R14, R14 + LEAQ (DX)(R14*1), CX + MOVQ AX, R15 + MOVQ CX, DX + ROLQ CL, R15 + BZHIQ R14, R15, R15 + + // Update Offset State + BZHIQ R8, R15, CX + SHRXQ R8, R15, R15 + MOVQ $0x00001010, R14 + BEXTRQ R14, R8, R8 + ADDQ CX, R8 + + // Load ctx.ofTable + MOVQ ctx+16(FP), CX + MOVQ 48(CX), CX + MOVQ (CX)(R8*8), R8 + + // Update Match Length State + BZHIQ DI, R15, CX + SHRXQ DI, R15, R15 + MOVQ $0x00001010, R14 + BEXTRQ R14, DI, DI + ADDQ CX, DI + + // Load ctx.mlTable + MOVQ ctx+16(FP), CX + MOVQ 24(CX), CX + MOVQ (CX)(DI*8), DI + + // Update Literal Length State + BZHIQ SI, R15, CX + MOVQ $0x00001010, R14 + BEXTRQ R14, SI, SI + ADDQ CX, SI + + // Load ctx.llTable + MOVQ ctx+16(FP), CX + MOVQ (CX), CX + MOVQ (CX)(SI*8), SI + +sequenceDecs_decode_bmi2_skip_update: + // Adjust offset + MOVQ 16(R9), CX + CMPQ R13, $0x01 + JBE sequenceDecs_decode_bmi2_adjust_offsetB_1_or_0 + MOVQ R11, R12 + MOVQ R10, R11 + MOVQ CX, R10 + JMP sequenceDecs_decode_bmi2_adjust_end + +sequenceDecs_decode_bmi2_adjust_offsetB_1_or_0: + CMPQ (R9), $0x00000000 + JNE sequenceDecs_decode_bmi2_adjust_offset_maybezero + INCQ CX + JMP sequenceDecs_decode_bmi2_adjust_offset_nonzero + +sequenceDecs_decode_bmi2_adjust_offset_maybezero: + TESTQ CX, CX + JNZ sequenceDecs_decode_bmi2_adjust_offset_nonzero + MOVQ R10, CX + JMP sequenceDecs_decode_bmi2_adjust_end + +sequenceDecs_decode_bmi2_adjust_offset_nonzero: + CMPQ CX, $0x01 + JB sequenceDecs_decode_bmi2_adjust_zero + JEQ sequenceDecs_decode_bmi2_adjust_one + CMPQ CX, $0x02 + JA sequenceDecs_decode_bmi2_adjust_three + JMP sequenceDecs_decode_bmi2_adjust_two + +sequenceDecs_decode_bmi2_adjust_zero: + MOVQ R10, R13 + JMP sequenceDecs_decode_bmi2_adjust_test_temp_valid + +sequenceDecs_decode_bmi2_adjust_one: + MOVQ R11, R13 + JMP sequenceDecs_decode_bmi2_adjust_test_temp_valid + +sequenceDecs_decode_bmi2_adjust_two: + MOVQ R12, R13 + JMP sequenceDecs_decode_bmi2_adjust_test_temp_valid + +sequenceDecs_decode_bmi2_adjust_three: + LEAQ -1(R10), R13 + +sequenceDecs_decode_bmi2_adjust_test_temp_valid: + TESTQ R13, R13 + JNZ sequenceDecs_decode_bmi2_adjust_temp_valid + MOVQ $0x00000001, R13 + +sequenceDecs_decode_bmi2_adjust_temp_valid: + CMPQ CX, $0x01 + CMOVQNE R11, R12 + MOVQ R10, R11 + MOVQ R13, R10 + MOVQ R13, CX + +sequenceDecs_decode_bmi2_adjust_end: + MOVQ CX, 16(R9) + + // Check values + MOVQ 8(R9), R13 + MOVQ (R9), R14 + LEAQ (R13)(R14*1), R15 + MOVQ s+0(FP), BP + ADDQ R15, 256(BP) + MOVQ ctx+16(FP), R15 + SUBQ R14, 128(R15) + JS error_not_enough_literals + CMPQ R13, $0x00020002 + JA sequenceDecs_decode_bmi2_error_match_len_too_big + TESTQ CX, CX + JNZ sequenceDecs_decode_bmi2_match_len_ofs_ok + TESTQ R13, R13 + JNZ sequenceDecs_decode_bmi2_error_match_len_ofs_mismatch + +sequenceDecs_decode_bmi2_match_len_ofs_ok: + ADDQ $0x18, R9 + MOVQ ctx+16(FP), CX + DECQ 96(CX) + JNS sequenceDecs_decode_bmi2_main_loop + MOVQ s+0(FP), CX + MOVQ R10, 144(CX) + MOVQ R11, 152(CX) + MOVQ R12, 160(CX) + MOVQ br+8(FP), CX + MOVQ AX, 32(CX) + MOVB DL, 40(CX) + MOVQ BX, 24(CX) + + // Return success + MOVQ $0x00000000, ret+24(FP) + RET + + // Return with match length error +sequenceDecs_decode_bmi2_error_match_len_ofs_mismatch: + MOVQ $0x00000001, ret+24(FP) + RET + + // Return with match too long error +sequenceDecs_decode_bmi2_error_match_len_too_big: + MOVQ $0x00000002, ret+24(FP) + RET + + // Return with match offset too long error + MOVQ $0x00000003, ret+24(FP) + RET + + // Return with not enough literals error +error_not_enough_literals: + MOVQ $0x00000004, ret+24(FP) + RET + + // Return with not enough output space error + MOVQ $0x00000005, ret+24(FP) + RET + +// func sequenceDecs_decode_56_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int +// Requires: BMI, BMI2, CMOV +TEXT ·sequenceDecs_decode_56_bmi2(SB), $8-32 + MOVQ br+8(FP), CX + MOVQ 32(CX), AX + MOVBQZX 40(CX), DX + MOVQ 24(CX), BX + MOVQ (CX), CX + ADDQ BX, CX + MOVQ CX, (SP) + MOVQ ctx+16(FP), CX + MOVQ 72(CX), SI + MOVQ 80(CX), DI + MOVQ 88(CX), R8 + MOVQ 104(CX), R9 + MOVQ s+0(FP), CX + MOVQ 144(CX), R10 + MOVQ 152(CX), R11 + MOVQ 160(CX), R12 + +sequenceDecs_decode_56_bmi2_main_loop: + MOVQ (SP), R13 + + // Fill bitreader to have enough for the offset and match length. + CMPQ BX, $0x08 + JL sequenceDecs_decode_56_bmi2_fill_byte_by_byte + MOVQ DX, CX + SHRQ $0x03, CX + SUBQ CX, R13 + MOVQ (R13), AX + SUBQ CX, BX + ANDQ $0x07, DX + JMP sequenceDecs_decode_56_bmi2_fill_end + +sequenceDecs_decode_56_bmi2_fill_byte_by_byte: + CMPQ BX, $0x00 + JLE sequenceDecs_decode_56_bmi2_fill_end + CMPQ DX, $0x07 + JLE sequenceDecs_decode_56_bmi2_fill_end + SHLQ $0x08, AX + SUBQ $0x01, R13 + SUBQ $0x01, BX + SUBQ $0x08, DX + MOVBQZX (R13), CX + ORQ CX, AX + JMP sequenceDecs_decode_56_bmi2_fill_byte_by_byte + +sequenceDecs_decode_56_bmi2_fill_end: + // Update offset + MOVQ $0x00000808, CX + BEXTRQ CX, R8, R14 + MOVQ AX, R15 + LEAQ (DX)(R14*1), CX + ROLQ CL, R15 + BZHIQ R14, R15, R15 + MOVQ CX, DX + MOVQ R8, CX + SHRQ $0x20, CX + ADDQ R15, CX + MOVQ CX, 16(R9) + + // Update match length + MOVQ $0x00000808, CX + BEXTRQ CX, DI, R14 + MOVQ AX, R15 + LEAQ (DX)(R14*1), CX + ROLQ CL, R15 + BZHIQ R14, R15, R15 + MOVQ CX, DX + MOVQ DI, CX + SHRQ $0x20, CX + ADDQ R15, CX + MOVQ CX, 8(R9) + + // Update literal length + MOVQ $0x00000808, CX + BEXTRQ CX, SI, R14 + MOVQ AX, R15 + LEAQ (DX)(R14*1), CX + ROLQ CL, R15 + BZHIQ R14, R15, R15 + MOVQ CX, DX + MOVQ SI, CX + SHRQ $0x20, CX + ADDQ R15, CX + MOVQ CX, (R9) + + // Fill bitreader for state updates + MOVQ R13, (SP) + MOVQ $0x00000808, CX + BEXTRQ CX, R8, R13 + MOVQ ctx+16(FP), CX + CMPQ 96(CX), $0x00 + JZ sequenceDecs_decode_56_bmi2_skip_update + LEAQ (SI)(DI*1), R14 + ADDQ R8, R14 + MOVBQZX R14, R14 + LEAQ (DX)(R14*1), CX + MOVQ AX, R15 + MOVQ CX, DX + ROLQ CL, R15 + BZHIQ R14, R15, R15 + + // Update Offset State + BZHIQ R8, R15, CX + SHRXQ R8, R15, R15 + MOVQ $0x00001010, R14 + BEXTRQ R14, R8, R8 + ADDQ CX, R8 + + // Load ctx.ofTable + MOVQ ctx+16(FP), CX + MOVQ 48(CX), CX + MOVQ (CX)(R8*8), R8 + + // Update Match Length State + BZHIQ DI, R15, CX + SHRXQ DI, R15, R15 + MOVQ $0x00001010, R14 + BEXTRQ R14, DI, DI + ADDQ CX, DI + + // Load ctx.mlTable + MOVQ ctx+16(FP), CX + MOVQ 24(CX), CX + MOVQ (CX)(DI*8), DI + + // Update Literal Length State + BZHIQ SI, R15, CX + MOVQ $0x00001010, R14 + BEXTRQ R14, SI, SI + ADDQ CX, SI + + // Load ctx.llTable + MOVQ ctx+16(FP), CX + MOVQ (CX), CX + MOVQ (CX)(SI*8), SI + +sequenceDecs_decode_56_bmi2_skip_update: + // Adjust offset + MOVQ 16(R9), CX + CMPQ R13, $0x01 + JBE sequenceDecs_decode_56_bmi2_adjust_offsetB_1_or_0 + MOVQ R11, R12 + MOVQ R10, R11 + MOVQ CX, R10 + JMP sequenceDecs_decode_56_bmi2_adjust_end + +sequenceDecs_decode_56_bmi2_adjust_offsetB_1_or_0: + CMPQ (R9), $0x00000000 + JNE sequenceDecs_decode_56_bmi2_adjust_offset_maybezero + INCQ CX + JMP sequenceDecs_decode_56_bmi2_adjust_offset_nonzero + +sequenceDecs_decode_56_bmi2_adjust_offset_maybezero: + TESTQ CX, CX + JNZ sequenceDecs_decode_56_bmi2_adjust_offset_nonzero + MOVQ R10, CX + JMP sequenceDecs_decode_56_bmi2_adjust_end + +sequenceDecs_decode_56_bmi2_adjust_offset_nonzero: + CMPQ CX, $0x01 + JB sequenceDecs_decode_56_bmi2_adjust_zero + JEQ sequenceDecs_decode_56_bmi2_adjust_one + CMPQ CX, $0x02 + JA sequenceDecs_decode_56_bmi2_adjust_three + JMP sequenceDecs_decode_56_bmi2_adjust_two + +sequenceDecs_decode_56_bmi2_adjust_zero: + MOVQ R10, R13 + JMP sequenceDecs_decode_56_bmi2_adjust_test_temp_valid + +sequenceDecs_decode_56_bmi2_adjust_one: + MOVQ R11, R13 + JMP sequenceDecs_decode_56_bmi2_adjust_test_temp_valid + +sequenceDecs_decode_56_bmi2_adjust_two: + MOVQ R12, R13 + JMP sequenceDecs_decode_56_bmi2_adjust_test_temp_valid + +sequenceDecs_decode_56_bmi2_adjust_three: + LEAQ -1(R10), R13 + +sequenceDecs_decode_56_bmi2_adjust_test_temp_valid: + TESTQ R13, R13 + JNZ sequenceDecs_decode_56_bmi2_adjust_temp_valid + MOVQ $0x00000001, R13 + +sequenceDecs_decode_56_bmi2_adjust_temp_valid: + CMPQ CX, $0x01 + CMOVQNE R11, R12 + MOVQ R10, R11 + MOVQ R13, R10 + MOVQ R13, CX + +sequenceDecs_decode_56_bmi2_adjust_end: + MOVQ CX, 16(R9) + + // Check values + MOVQ 8(R9), R13 + MOVQ (R9), R14 + LEAQ (R13)(R14*1), R15 + MOVQ s+0(FP), BP + ADDQ R15, 256(BP) + MOVQ ctx+16(FP), R15 + SUBQ R14, 128(R15) + JS error_not_enough_literals + CMPQ R13, $0x00020002 + JA sequenceDecs_decode_56_bmi2_error_match_len_too_big + TESTQ CX, CX + JNZ sequenceDecs_decode_56_bmi2_match_len_ofs_ok + TESTQ R13, R13 + JNZ sequenceDecs_decode_56_bmi2_error_match_len_ofs_mismatch + +sequenceDecs_decode_56_bmi2_match_len_ofs_ok: + ADDQ $0x18, R9 + MOVQ ctx+16(FP), CX + DECQ 96(CX) + JNS sequenceDecs_decode_56_bmi2_main_loop + MOVQ s+0(FP), CX + MOVQ R10, 144(CX) + MOVQ R11, 152(CX) + MOVQ R12, 160(CX) + MOVQ br+8(FP), CX + MOVQ AX, 32(CX) + MOVB DL, 40(CX) + MOVQ BX, 24(CX) + + // Return success + MOVQ $0x00000000, ret+24(FP) + RET + + // Return with match length error +sequenceDecs_decode_56_bmi2_error_match_len_ofs_mismatch: + MOVQ $0x00000001, ret+24(FP) + RET + + // Return with match too long error +sequenceDecs_decode_56_bmi2_error_match_len_too_big: + MOVQ $0x00000002, ret+24(FP) + RET + + // Return with match offset too long error + MOVQ $0x00000003, ret+24(FP) + RET + + // Return with not enough literals error +error_not_enough_literals: + MOVQ $0x00000004, ret+24(FP) + RET + + // Return with not enough output space error + MOVQ $0x00000005, ret+24(FP) + RET + +// func sequenceDecs_executeSimple_amd64(ctx *executeAsmContext) bool +// Requires: SSE +TEXT ·sequenceDecs_executeSimple_amd64(SB), $8-9 + MOVQ ctx+0(FP), R10 + MOVQ 8(R10), CX + TESTQ CX, CX + JZ empty_seqs + MOVQ (R10), AX + MOVQ 24(R10), DX + MOVQ 32(R10), BX + MOVQ 80(R10), SI + MOVQ 104(R10), DI + MOVQ 120(R10), R8 + MOVQ 56(R10), R9 + MOVQ 64(R10), R10 + ADDQ R10, R9 + + // seqsBase += 24 * seqIndex + LEAQ (DX)(DX*2), R11 + SHLQ $0x03, R11 + ADDQ R11, AX + + // outBase += outPosition + ADDQ DI, BX + +main_loop: + MOVQ (AX), R11 + MOVQ 16(AX), R12 + MOVQ 8(AX), R13 + + // Copy literals + TESTQ R11, R11 + JZ check_offset + XORQ R14, R14 + +copy_1: + MOVUPS (SI)(R14*1), X0 + MOVUPS X0, (BX)(R14*1) + ADDQ $0x10, R14 + CMPQ R14, R11 + JB copy_1 + ADDQ R11, SI + ADDQ R11, BX + ADDQ R11, DI + + // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize) +check_offset: + LEAQ (DI)(R10*1), R11 + CMPQ R12, R11 + JG error_match_off_too_big + CMPQ R12, R8 + JG error_match_off_too_big + + // Copy match from history + MOVQ R12, R11 + SUBQ DI, R11 + JLS copy_match + MOVQ R9, R14 + SUBQ R11, R14 + CMPQ R13, R11 + JGE copy_all_from_history + XORQ R11, R11 + TESTQ $0x00000001, R13 + JZ copy_4_word + MOVB (R14)(R11*1), R12 + MOVB R12, (BX)(R11*1) + ADDQ $0x01, R11 + +copy_4_word: + TESTQ $0x00000002, R13 + JZ copy_4_dword + MOVW (R14)(R11*1), R12 + MOVW R12, (BX)(R11*1) + ADDQ $0x02, R11 + +copy_4_dword: + TESTQ $0x00000004, R13 + JZ copy_4_qword + MOVL (R14)(R11*1), R12 + MOVL R12, (BX)(R11*1) + ADDQ $0x04, R11 + +copy_4_qword: + TESTQ $0x00000008, R13 + JZ copy_4_test + MOVQ (R14)(R11*1), R12 + MOVQ R12, (BX)(R11*1) + ADDQ $0x08, R11 + JMP copy_4_test + +copy_4: + MOVUPS (R14)(R11*1), X0 + MOVUPS X0, (BX)(R11*1) + ADDQ $0x10, R11 + +copy_4_test: + CMPQ R11, R13 + JB copy_4 + ADDQ R13, DI + ADDQ R13, BX + ADDQ $0x18, AX + INCQ DX + CMPQ DX, CX + JB main_loop + JMP loop_finished + +copy_all_from_history: + XORQ R15, R15 + TESTQ $0x00000001, R11 + JZ copy_5_word + MOVB (R14)(R15*1), BP + MOVB BP, (BX)(R15*1) + ADDQ $0x01, R15 + +copy_5_word: + TESTQ $0x00000002, R11 + JZ copy_5_dword + MOVW (R14)(R15*1), BP + MOVW BP, (BX)(R15*1) + ADDQ $0x02, R15 + +copy_5_dword: + TESTQ $0x00000004, R11 + JZ copy_5_qword + MOVL (R14)(R15*1), BP + MOVL BP, (BX)(R15*1) + ADDQ $0x04, R15 + +copy_5_qword: + TESTQ $0x00000008, R11 + JZ copy_5_test + MOVQ (R14)(R15*1), BP + MOVQ BP, (BX)(R15*1) + ADDQ $0x08, R15 + JMP copy_5_test + +copy_5: + MOVUPS (R14)(R15*1), X0 + MOVUPS X0, (BX)(R15*1) + ADDQ $0x10, R15 + +copy_5_test: + CMPQ R15, R11 + JB copy_5 + ADDQ R11, BX + ADDQ R11, DI + SUBQ R11, R13 + + // Copy match from the current buffer +copy_match: + TESTQ R13, R13 + JZ handle_loop + MOVQ BX, R11 + SUBQ R12, R11 + + // ml <= mo + CMPQ R13, R12 + JA copy_overlapping_match + + // Copy non-overlapping match + ADDQ R13, DI + MOVQ BX, R12 + ADDQ R13, BX + +copy_2: + MOVUPS (R11), X0 + MOVUPS X0, (R12) + ADDQ $0x10, R11 + ADDQ $0x10, R12 + SUBQ $0x10, R13 + JHI copy_2 + JMP handle_loop + + // Copy overlapping match +copy_overlapping_match: + ADDQ R13, DI + +copy_slow_3: + MOVB (R11), R12 + MOVB R12, (BX) + INCQ R11 + INCQ BX + DECQ R13 + JNZ copy_slow_3 + +handle_loop: + ADDQ $0x18, AX + INCQ DX + CMPQ DX, CX + JB main_loop + +loop_finished: + // Return value + MOVB $0x01, ret+8(FP) + + // Update the context + MOVQ ctx+0(FP), AX + MOVQ DX, 24(AX) + MOVQ DI, 104(AX) + MOVQ 80(AX), CX + SUBQ CX, SI + MOVQ SI, 112(AX) + RET + +error_match_off_too_big: + // Return value + MOVB $0x00, ret+8(FP) + + // Update the context + MOVQ ctx+0(FP), AX + MOVQ DX, 24(AX) + MOVQ DI, 104(AX) + MOVQ 80(AX), CX + SUBQ CX, SI + MOVQ SI, 112(AX) + RET + +empty_seqs: + // Return value + MOVB $0x01, ret+8(FP) + RET + +// func sequenceDecs_executeSimple_safe_amd64(ctx *executeAsmContext) bool +// Requires: SSE +TEXT ·sequenceDecs_executeSimple_safe_amd64(SB), $8-9 + MOVQ ctx+0(FP), R10 + MOVQ 8(R10), CX + TESTQ CX, CX + JZ empty_seqs + MOVQ (R10), AX + MOVQ 24(R10), DX + MOVQ 32(R10), BX + MOVQ 80(R10), SI + MOVQ 104(R10), DI + MOVQ 120(R10), R8 + MOVQ 56(R10), R9 + MOVQ 64(R10), R10 + ADDQ R10, R9 + + // seqsBase += 24 * seqIndex + LEAQ (DX)(DX*2), R11 + SHLQ $0x03, R11 + ADDQ R11, AX + + // outBase += outPosition + ADDQ DI, BX + +main_loop: + MOVQ (AX), R11 + MOVQ 16(AX), R12 + MOVQ 8(AX), R13 + + // Copy literals + TESTQ R11, R11 + JZ check_offset + XORQ R14, R14 + TESTQ $0x00000001, R11 + JZ copy_1_word + MOVB (SI)(R14*1), R15 + MOVB R15, (BX)(R14*1) + ADDQ $0x01, R14 + +copy_1_word: + TESTQ $0x00000002, R11 + JZ copy_1_dword + MOVW (SI)(R14*1), R15 + MOVW R15, (BX)(R14*1) + ADDQ $0x02, R14 + +copy_1_dword: + TESTQ $0x00000004, R11 + JZ copy_1_qword + MOVL (SI)(R14*1), R15 + MOVL R15, (BX)(R14*1) + ADDQ $0x04, R14 + +copy_1_qword: + TESTQ $0x00000008, R11 + JZ copy_1_test + MOVQ (SI)(R14*1), R15 + MOVQ R15, (BX)(R14*1) + ADDQ $0x08, R14 + JMP copy_1_test + +copy_1: + MOVUPS (SI)(R14*1), X0 + MOVUPS X0, (BX)(R14*1) + ADDQ $0x10, R14 + +copy_1_test: + CMPQ R14, R11 + JB copy_1 + ADDQ R11, SI + ADDQ R11, BX + ADDQ R11, DI + + // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize) +check_offset: + LEAQ (DI)(R10*1), R11 + CMPQ R12, R11 + JG error_match_off_too_big + CMPQ R12, R8 + JG error_match_off_too_big + + // Copy match from history + MOVQ R12, R11 + SUBQ DI, R11 + JLS copy_match + MOVQ R9, R14 + SUBQ R11, R14 + CMPQ R13, R11 + JGE copy_all_from_history + XORQ R11, R11 + TESTQ $0x00000001, R13 + JZ copy_4_word + MOVB (R14)(R11*1), R12 + MOVB R12, (BX)(R11*1) + ADDQ $0x01, R11 + +copy_4_word: + TESTQ $0x00000002, R13 + JZ copy_4_dword + MOVW (R14)(R11*1), R12 + MOVW R12, (BX)(R11*1) + ADDQ $0x02, R11 + +copy_4_dword: + TESTQ $0x00000004, R13 + JZ copy_4_qword + MOVL (R14)(R11*1), R12 + MOVL R12, (BX)(R11*1) + ADDQ $0x04, R11 + +copy_4_qword: + TESTQ $0x00000008, R13 + JZ copy_4_test + MOVQ (R14)(R11*1), R12 + MOVQ R12, (BX)(R11*1) + ADDQ $0x08, R11 + JMP copy_4_test + +copy_4: + MOVUPS (R14)(R11*1), X0 + MOVUPS X0, (BX)(R11*1) + ADDQ $0x10, R11 + +copy_4_test: + CMPQ R11, R13 + JB copy_4 + ADDQ R13, DI + ADDQ R13, BX + ADDQ $0x18, AX + INCQ DX + CMPQ DX, CX + JB main_loop + JMP loop_finished + +copy_all_from_history: + XORQ R15, R15 + TESTQ $0x00000001, R11 + JZ copy_5_word + MOVB (R14)(R15*1), BP + MOVB BP, (BX)(R15*1) + ADDQ $0x01, R15 + +copy_5_word: + TESTQ $0x00000002, R11 + JZ copy_5_dword + MOVW (R14)(R15*1), BP + MOVW BP, (BX)(R15*1) + ADDQ $0x02, R15 + +copy_5_dword: + TESTQ $0x00000004, R11 + JZ copy_5_qword + MOVL (R14)(R15*1), BP + MOVL BP, (BX)(R15*1) + ADDQ $0x04, R15 + +copy_5_qword: + TESTQ $0x00000008, R11 + JZ copy_5_test + MOVQ (R14)(R15*1), BP + MOVQ BP, (BX)(R15*1) + ADDQ $0x08, R15 + JMP copy_5_test + +copy_5: + MOVUPS (R14)(R15*1), X0 + MOVUPS X0, (BX)(R15*1) + ADDQ $0x10, R15 + +copy_5_test: + CMPQ R15, R11 + JB copy_5 + ADDQ R11, BX + ADDQ R11, DI + SUBQ R11, R13 + + // Copy match from the current buffer +copy_match: + TESTQ R13, R13 + JZ handle_loop + MOVQ BX, R11 + SUBQ R12, R11 + + // ml <= mo + CMPQ R13, R12 + JA copy_overlapping_match + + // Copy non-overlapping match + ADDQ R13, DI + XORQ R12, R12 + TESTQ $0x00000001, R13 + JZ copy_2_word + MOVB (R11)(R12*1), R14 + MOVB R14, (BX)(R12*1) + ADDQ $0x01, R12 + +copy_2_word: + TESTQ $0x00000002, R13 + JZ copy_2_dword + MOVW (R11)(R12*1), R14 + MOVW R14, (BX)(R12*1) + ADDQ $0x02, R12 + +copy_2_dword: + TESTQ $0x00000004, R13 + JZ copy_2_qword + MOVL (R11)(R12*1), R14 + MOVL R14, (BX)(R12*1) + ADDQ $0x04, R12 + +copy_2_qword: + TESTQ $0x00000008, R13 + JZ copy_2_test + MOVQ (R11)(R12*1), R14 + MOVQ R14, (BX)(R12*1) + ADDQ $0x08, R12 + JMP copy_2_test + +copy_2: + MOVUPS (R11)(R12*1), X0 + MOVUPS X0, (BX)(R12*1) + ADDQ $0x10, R12 + +copy_2_test: + CMPQ R12, R13 + JB copy_2 + ADDQ R13, BX + JMP handle_loop + + // Copy overlapping match +copy_overlapping_match: + ADDQ R13, DI + +copy_slow_3: + MOVB (R11), R12 + MOVB R12, (BX) + INCQ R11 + INCQ BX + DECQ R13 + JNZ copy_slow_3 + +handle_loop: + ADDQ $0x18, AX + INCQ DX + CMPQ DX, CX + JB main_loop + +loop_finished: + // Return value + MOVB $0x01, ret+8(FP) + + // Update the context + MOVQ ctx+0(FP), AX + MOVQ DX, 24(AX) + MOVQ DI, 104(AX) + MOVQ 80(AX), CX + SUBQ CX, SI + MOVQ SI, 112(AX) + RET + +error_match_off_too_big: + // Return value + MOVB $0x00, ret+8(FP) + + // Update the context + MOVQ ctx+0(FP), AX + MOVQ DX, 24(AX) + MOVQ DI, 104(AX) + MOVQ 80(AX), CX + SUBQ CX, SI + MOVQ SI, 112(AX) + RET + +empty_seqs: + // Return value + MOVB $0x01, ret+8(FP) + RET + +// func sequenceDecs_decodeSync_amd64(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int +// Requires: CMOV, SSE +TEXT ·sequenceDecs_decodeSync_amd64(SB), $64-32 + MOVQ br+8(FP), AX + MOVQ 32(AX), DX + MOVBQZX 40(AX), BX + MOVQ 24(AX), SI + MOVQ (AX), AX + ADDQ SI, AX + MOVQ AX, (SP) + MOVQ ctx+16(FP), AX + MOVQ 72(AX), DI + MOVQ 80(AX), R8 + MOVQ 88(AX), R9 + MOVQ 112(AX), R10 + MOVQ 128(AX), CX + MOVQ CX, 32(SP) + MOVQ 144(AX), R11 + MOVQ 136(AX), R12 + MOVQ 200(AX), CX + MOVQ CX, 56(SP) + MOVQ 176(AX), CX + MOVQ CX, 48(SP) + MOVQ 184(AX), AX + MOVQ AX, 40(SP) + MOVQ 40(SP), AX + ADDQ AX, 48(SP) + + // Calculate poiter to s.out[cap(s.out)] (a past-end pointer) + ADDQ R10, 32(SP) + + // outBase += outPosition + ADDQ R12, R10 + +sequenceDecs_decodeSync_amd64_main_loop: + MOVQ (SP), R13 + + // Fill bitreader to have enough for the offset and match length. + CMPQ SI, $0x08 + JL sequenceDecs_decodeSync_amd64_fill_byte_by_byte + MOVQ BX, AX + SHRQ $0x03, AX + SUBQ AX, R13 + MOVQ (R13), DX + SUBQ AX, SI + ANDQ $0x07, BX + JMP sequenceDecs_decodeSync_amd64_fill_end + +sequenceDecs_decodeSync_amd64_fill_byte_by_byte: + CMPQ SI, $0x00 + JLE sequenceDecs_decodeSync_amd64_fill_end + CMPQ BX, $0x07 + JLE sequenceDecs_decodeSync_amd64_fill_end + SHLQ $0x08, DX + SUBQ $0x01, R13 + SUBQ $0x01, SI + SUBQ $0x08, BX + MOVBQZX (R13), AX + ORQ AX, DX + JMP sequenceDecs_decodeSync_amd64_fill_byte_by_byte + +sequenceDecs_decodeSync_amd64_fill_end: + // Update offset + MOVQ R9, AX + MOVQ BX, CX + MOVQ DX, R14 + SHLQ CL, R14 + MOVB AH, CL + ADDQ CX, BX + NEGL CX + SHRQ CL, R14 + SHRQ $0x20, AX + TESTQ CX, CX + CMOVQEQ CX, R14 + ADDQ R14, AX + MOVQ AX, 8(SP) + + // Update match length + MOVQ R8, AX + MOVQ BX, CX + MOVQ DX, R14 + SHLQ CL, R14 + MOVB AH, CL + ADDQ CX, BX + NEGL CX + SHRQ CL, R14 + SHRQ $0x20, AX + TESTQ CX, CX + CMOVQEQ CX, R14 + ADDQ R14, AX + MOVQ AX, 16(SP) + + // Fill bitreader to have enough for the remaining + CMPQ SI, $0x08 + JL sequenceDecs_decodeSync_amd64_fill_2_byte_by_byte + MOVQ BX, AX + SHRQ $0x03, AX + SUBQ AX, R13 + MOVQ (R13), DX + SUBQ AX, SI + ANDQ $0x07, BX + JMP sequenceDecs_decodeSync_amd64_fill_2_end + +sequenceDecs_decodeSync_amd64_fill_2_byte_by_byte: + CMPQ SI, $0x00 + JLE sequenceDecs_decodeSync_amd64_fill_2_end + CMPQ BX, $0x07 + JLE sequenceDecs_decodeSync_amd64_fill_2_end + SHLQ $0x08, DX + SUBQ $0x01, R13 + SUBQ $0x01, SI + SUBQ $0x08, BX + MOVBQZX (R13), AX + ORQ AX, DX + JMP sequenceDecs_decodeSync_amd64_fill_2_byte_by_byte + +sequenceDecs_decodeSync_amd64_fill_2_end: + // Update literal length + MOVQ DI, AX + MOVQ BX, CX + MOVQ DX, R14 + SHLQ CL, R14 + MOVB AH, CL + ADDQ CX, BX + NEGL CX + SHRQ CL, R14 + SHRQ $0x20, AX + TESTQ CX, CX + CMOVQEQ CX, R14 + ADDQ R14, AX + MOVQ AX, 24(SP) + + // Fill bitreader for state updates + MOVQ R13, (SP) + MOVQ R9, AX + SHRQ $0x08, AX + MOVBQZX AL, AX + MOVQ ctx+16(FP), CX + CMPQ 96(CX), $0x00 + JZ sequenceDecs_decodeSync_amd64_skip_update + + // Update Literal Length State + MOVBQZX DI, R13 + SHRQ $0x10, DI + MOVWQZX DI, DI + CMPQ R13, $0x00 + JZ sequenceDecs_decodeSync_amd64_llState_updateState_skip_zero + MOVQ BX, CX + ADDQ R13, BX + MOVQ DX, R14 + SHLQ CL, R14 + MOVQ R13, CX + NEGQ CX + SHRQ CL, R14 + ADDQ R14, DI + +sequenceDecs_decodeSync_amd64_llState_updateState_skip_zero: + // Load ctx.llTable + MOVQ ctx+16(FP), CX + MOVQ (CX), CX + MOVQ (CX)(DI*8), DI + + // Update Match Length State + MOVBQZX R8, R13 + SHRQ $0x10, R8 + MOVWQZX R8, R8 + CMPQ R13, $0x00 + JZ sequenceDecs_decodeSync_amd64_mlState_updateState_skip_zero + MOVQ BX, CX + ADDQ R13, BX + MOVQ DX, R14 + SHLQ CL, R14 + MOVQ R13, CX + NEGQ CX + SHRQ CL, R14 + ADDQ R14, R8 + +sequenceDecs_decodeSync_amd64_mlState_updateState_skip_zero: + // Load ctx.mlTable + MOVQ ctx+16(FP), CX + MOVQ 24(CX), CX + MOVQ (CX)(R8*8), R8 + + // Update Offset State + MOVBQZX R9, R13 + SHRQ $0x10, R9 + MOVWQZX R9, R9 + CMPQ R13, $0x00 + JZ sequenceDecs_decodeSync_amd64_ofState_updateState_skip_zero + MOVQ BX, CX + ADDQ R13, BX + MOVQ DX, R14 + SHLQ CL, R14 + MOVQ R13, CX + NEGQ CX + SHRQ CL, R14 + ADDQ R14, R9 + +sequenceDecs_decodeSync_amd64_ofState_updateState_skip_zero: + // Load ctx.ofTable + MOVQ ctx+16(FP), CX + MOVQ 48(CX), CX + MOVQ (CX)(R9*8), R9 + +sequenceDecs_decodeSync_amd64_skip_update: + // Adjust offset + MOVQ s+0(FP), CX + MOVQ 8(SP), R13 + CMPQ AX, $0x01 + JBE sequenceDecs_decodeSync_amd64_adjust_offsetB_1_or_0 + MOVUPS 144(CX), X0 + MOVQ R13, 144(CX) + MOVUPS X0, 152(CX) + JMP sequenceDecs_decodeSync_amd64_adjust_end + +sequenceDecs_decodeSync_amd64_adjust_offsetB_1_or_0: + CMPQ 24(SP), $0x00000000 + JNE sequenceDecs_decodeSync_amd64_adjust_offset_maybezero + INCQ R13 + JMP sequenceDecs_decodeSync_amd64_adjust_offset_nonzero + +sequenceDecs_decodeSync_amd64_adjust_offset_maybezero: + TESTQ R13, R13 + JNZ sequenceDecs_decodeSync_amd64_adjust_offset_nonzero + MOVQ 144(CX), R13 + JMP sequenceDecs_decodeSync_amd64_adjust_end + +sequenceDecs_decodeSync_amd64_adjust_offset_nonzero: + MOVQ R13, AX + XORQ R14, R14 + MOVQ $-1, R15 + CMPQ R13, $0x03 + CMOVQEQ R14, AX + CMOVQEQ R15, R14 + LEAQ 144(CX), R15 + ADDQ (R15)(AX*8), R14 + JNZ sequenceDecs_decodeSync_amd64_adjust_temp_valid + MOVQ $0x00000001, R14 + +sequenceDecs_decodeSync_amd64_adjust_temp_valid: + CMPQ R13, $0x01 + JZ sequenceDecs_decodeSync_amd64_adjust_skip + MOVQ 152(CX), AX + MOVQ AX, 160(CX) + +sequenceDecs_decodeSync_amd64_adjust_skip: + MOVQ 144(CX), AX + MOVQ AX, 152(CX) + MOVQ R14, 144(CX) + MOVQ R14, R13 + +sequenceDecs_decodeSync_amd64_adjust_end: + MOVQ R13, 8(SP) + + // Check values + MOVQ 16(SP), AX + MOVQ 24(SP), CX + LEAQ (AX)(CX*1), R14 + MOVQ s+0(FP), R15 + ADDQ R14, 256(R15) + MOVQ ctx+16(FP), R14 + SUBQ CX, 104(R14) + JS error_not_enough_literals + CMPQ AX, $0x00020002 + JA sequenceDecs_decodeSync_amd64_error_match_len_too_big + TESTQ R13, R13 + JNZ sequenceDecs_decodeSync_amd64_match_len_ofs_ok + TESTQ AX, AX + JNZ sequenceDecs_decodeSync_amd64_error_match_len_ofs_mismatch + +sequenceDecs_decodeSync_amd64_match_len_ofs_ok: + MOVQ 24(SP), AX + MOVQ 8(SP), CX + MOVQ 16(SP), R13 + + // Check if we have enough space in s.out + LEAQ (AX)(R13*1), R14 + ADDQ R10, R14 + CMPQ R14, 32(SP) + JA error_not_enough_space + + // Copy literals + TESTQ AX, AX + JZ check_offset + XORQ R14, R14 + +copy_1: + MOVUPS (R11)(R14*1), X0 + MOVUPS X0, (R10)(R14*1) + ADDQ $0x10, R14 + CMPQ R14, AX + JB copy_1 + ADDQ AX, R11 + ADDQ AX, R10 + ADDQ AX, R12 + + // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize) +check_offset: + MOVQ R12, AX + ADDQ 40(SP), AX + CMPQ CX, AX + JG error_match_off_too_big + CMPQ CX, 56(SP) + JG error_match_off_too_big + + // Copy match from history + MOVQ CX, AX + SUBQ R12, AX + JLS copy_match + MOVQ 48(SP), R14 + SUBQ AX, R14 + CMPQ R13, AX + JGE copy_all_from_history + XORQ AX, AX + TESTQ $0x00000001, R13 + JZ copy_4_word + MOVB (R14)(AX*1), CL + MOVB CL, (R10)(AX*1) + ADDQ $0x01, AX + +copy_4_word: + TESTQ $0x00000002, R13 + JZ copy_4_dword + MOVW (R14)(AX*1), CX + MOVW CX, (R10)(AX*1) + ADDQ $0x02, AX + +copy_4_dword: + TESTQ $0x00000004, R13 + JZ copy_4_qword + MOVL (R14)(AX*1), CX + MOVL CX, (R10)(AX*1) + ADDQ $0x04, AX + +copy_4_qword: + TESTQ $0x00000008, R13 + JZ copy_4_test + MOVQ (R14)(AX*1), CX + MOVQ CX, (R10)(AX*1) + ADDQ $0x08, AX + JMP copy_4_test + +copy_4: + MOVUPS (R14)(AX*1), X0 + MOVUPS X0, (R10)(AX*1) + ADDQ $0x10, AX + +copy_4_test: + CMPQ AX, R13 + JB copy_4 + ADDQ R13, R12 + ADDQ R13, R10 + JMP handle_loop + JMP loop_finished + +copy_all_from_history: + XORQ R15, R15 + TESTQ $0x00000001, AX + JZ copy_5_word + MOVB (R14)(R15*1), BP + MOVB BP, (R10)(R15*1) + ADDQ $0x01, R15 + +copy_5_word: + TESTQ $0x00000002, AX + JZ copy_5_dword + MOVW (R14)(R15*1), BP + MOVW BP, (R10)(R15*1) + ADDQ $0x02, R15 + +copy_5_dword: + TESTQ $0x00000004, AX + JZ copy_5_qword + MOVL (R14)(R15*1), BP + MOVL BP, (R10)(R15*1) + ADDQ $0x04, R15 + +copy_5_qword: + TESTQ $0x00000008, AX + JZ copy_5_test + MOVQ (R14)(R15*1), BP + MOVQ BP, (R10)(R15*1) + ADDQ $0x08, R15 + JMP copy_5_test + +copy_5: + MOVUPS (R14)(R15*1), X0 + MOVUPS X0, (R10)(R15*1) + ADDQ $0x10, R15 + +copy_5_test: + CMPQ R15, AX + JB copy_5 + ADDQ AX, R10 + ADDQ AX, R12 + SUBQ AX, R13 + + // Copy match from the current buffer +copy_match: + TESTQ R13, R13 + JZ handle_loop + MOVQ R10, AX + SUBQ CX, AX + + // ml <= mo + CMPQ R13, CX + JA copy_overlapping_match + + // Copy non-overlapping match + ADDQ R13, R12 + MOVQ R10, CX + ADDQ R13, R10 + +copy_2: + MOVUPS (AX), X0 + MOVUPS X0, (CX) + ADDQ $0x10, AX + ADDQ $0x10, CX + SUBQ $0x10, R13 + JHI copy_2 + JMP handle_loop + + // Copy overlapping match +copy_overlapping_match: + ADDQ R13, R12 + +copy_slow_3: + MOVB (AX), CL + MOVB CL, (R10) + INCQ AX + INCQ R10 + DECQ R13 + JNZ copy_slow_3 + +handle_loop: + MOVQ ctx+16(FP), AX + DECQ 96(AX) + JNS sequenceDecs_decodeSync_amd64_main_loop + +loop_finished: + MOVQ br+8(FP), AX + MOVQ DX, 32(AX) + MOVB BL, 40(AX) + MOVQ SI, 24(AX) + + // Update the context + MOVQ ctx+16(FP), AX + MOVQ R12, 136(AX) + MOVQ 144(AX), CX + SUBQ CX, R11 + MOVQ R11, 168(AX) + + // Return success + MOVQ $0x00000000, ret+24(FP) + RET + + // Return with match length error +sequenceDecs_decodeSync_amd64_error_match_len_ofs_mismatch: + MOVQ 16(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 216(CX) + MOVQ $0x00000001, ret+24(FP) + RET + + // Return with match too long error +sequenceDecs_decodeSync_amd64_error_match_len_too_big: + MOVQ ctx+16(FP), AX + MOVQ 16(SP), CX + MOVQ CX, 216(AX) + MOVQ $0x00000002, ret+24(FP) + RET + + // Return with match offset too long error +error_match_off_too_big: + MOVQ ctx+16(FP), AX + MOVQ 8(SP), CX + MOVQ CX, 224(AX) + MOVQ R12, 136(AX) + MOVQ $0x00000003, ret+24(FP) + RET + + // Return with not enough literals error +error_not_enough_literals: + MOVQ ctx+16(FP), AX + MOVQ 24(SP), CX + MOVQ CX, 208(AX) + MOVQ $0x00000004, ret+24(FP) + RET + + // Return with not enough output space error +error_not_enough_space: + MOVQ ctx+16(FP), AX + MOVQ 24(SP), CX + MOVQ CX, 208(AX) + MOVQ 16(SP), CX + MOVQ CX, 216(AX) + MOVQ R12, 136(AX) + MOVQ $0x00000005, ret+24(FP) + RET + +// func sequenceDecs_decodeSync_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int +// Requires: BMI, BMI2, CMOV, SSE +TEXT ·sequenceDecs_decodeSync_bmi2(SB), $64-32 + MOVQ br+8(FP), CX + MOVQ 32(CX), AX + MOVBQZX 40(CX), DX + MOVQ 24(CX), BX + MOVQ (CX), CX + ADDQ BX, CX + MOVQ CX, (SP) + MOVQ ctx+16(FP), CX + MOVQ 72(CX), SI + MOVQ 80(CX), DI + MOVQ 88(CX), R8 + MOVQ 112(CX), R9 + MOVQ 128(CX), R10 + MOVQ R10, 32(SP) + MOVQ 144(CX), R10 + MOVQ 136(CX), R11 + MOVQ 200(CX), R12 + MOVQ R12, 56(SP) + MOVQ 176(CX), R12 + MOVQ R12, 48(SP) + MOVQ 184(CX), CX + MOVQ CX, 40(SP) + MOVQ 40(SP), CX + ADDQ CX, 48(SP) + + // Calculate poiter to s.out[cap(s.out)] (a past-end pointer) + ADDQ R9, 32(SP) + + // outBase += outPosition + ADDQ R11, R9 + +sequenceDecs_decodeSync_bmi2_main_loop: + MOVQ (SP), R12 + + // Fill bitreader to have enough for the offset and match length. + CMPQ BX, $0x08 + JL sequenceDecs_decodeSync_bmi2_fill_byte_by_byte + MOVQ DX, CX + SHRQ $0x03, CX + SUBQ CX, R12 + MOVQ (R12), AX + SUBQ CX, BX + ANDQ $0x07, DX + JMP sequenceDecs_decodeSync_bmi2_fill_end + +sequenceDecs_decodeSync_bmi2_fill_byte_by_byte: + CMPQ BX, $0x00 + JLE sequenceDecs_decodeSync_bmi2_fill_end + CMPQ DX, $0x07 + JLE sequenceDecs_decodeSync_bmi2_fill_end + SHLQ $0x08, AX + SUBQ $0x01, R12 + SUBQ $0x01, BX + SUBQ $0x08, DX + MOVBQZX (R12), CX + ORQ CX, AX + JMP sequenceDecs_decodeSync_bmi2_fill_byte_by_byte + +sequenceDecs_decodeSync_bmi2_fill_end: + // Update offset + MOVQ $0x00000808, CX + BEXTRQ CX, R8, R13 + MOVQ AX, R14 + LEAQ (DX)(R13*1), CX + ROLQ CL, R14 + BZHIQ R13, R14, R14 + MOVQ CX, DX + MOVQ R8, CX + SHRQ $0x20, CX + ADDQ R14, CX + MOVQ CX, 8(SP) + + // Update match length + MOVQ $0x00000808, CX + BEXTRQ CX, DI, R13 + MOVQ AX, R14 + LEAQ (DX)(R13*1), CX + ROLQ CL, R14 + BZHIQ R13, R14, R14 + MOVQ CX, DX + MOVQ DI, CX + SHRQ $0x20, CX + ADDQ R14, CX + MOVQ CX, 16(SP) + + // Fill bitreader to have enough for the remaining + CMPQ BX, $0x08 + JL sequenceDecs_decodeSync_bmi2_fill_2_byte_by_byte + MOVQ DX, CX + SHRQ $0x03, CX + SUBQ CX, R12 + MOVQ (R12), AX + SUBQ CX, BX + ANDQ $0x07, DX + JMP sequenceDecs_decodeSync_bmi2_fill_2_end + +sequenceDecs_decodeSync_bmi2_fill_2_byte_by_byte: + CMPQ BX, $0x00 + JLE sequenceDecs_decodeSync_bmi2_fill_2_end + CMPQ DX, $0x07 + JLE sequenceDecs_decodeSync_bmi2_fill_2_end + SHLQ $0x08, AX + SUBQ $0x01, R12 + SUBQ $0x01, BX + SUBQ $0x08, DX + MOVBQZX (R12), CX + ORQ CX, AX + JMP sequenceDecs_decodeSync_bmi2_fill_2_byte_by_byte + +sequenceDecs_decodeSync_bmi2_fill_2_end: + // Update literal length + MOVQ $0x00000808, CX + BEXTRQ CX, SI, R13 + MOVQ AX, R14 + LEAQ (DX)(R13*1), CX + ROLQ CL, R14 + BZHIQ R13, R14, R14 + MOVQ CX, DX + MOVQ SI, CX + SHRQ $0x20, CX + ADDQ R14, CX + MOVQ CX, 24(SP) + + // Fill bitreader for state updates + MOVQ R12, (SP) + MOVQ $0x00000808, CX + BEXTRQ CX, R8, R12 + MOVQ ctx+16(FP), CX + CMPQ 96(CX), $0x00 + JZ sequenceDecs_decodeSync_bmi2_skip_update + LEAQ (SI)(DI*1), R13 + ADDQ R8, R13 + MOVBQZX R13, R13 + LEAQ (DX)(R13*1), CX + MOVQ AX, R14 + MOVQ CX, DX + ROLQ CL, R14 + BZHIQ R13, R14, R14 + + // Update Offset State + BZHIQ R8, R14, CX + SHRXQ R8, R14, R14 + MOVQ $0x00001010, R13 + BEXTRQ R13, R8, R8 + ADDQ CX, R8 + + // Load ctx.ofTable + MOVQ ctx+16(FP), CX + MOVQ 48(CX), CX + MOVQ (CX)(R8*8), R8 + + // Update Match Length State + BZHIQ DI, R14, CX + SHRXQ DI, R14, R14 + MOVQ $0x00001010, R13 + BEXTRQ R13, DI, DI + ADDQ CX, DI + + // Load ctx.mlTable + MOVQ ctx+16(FP), CX + MOVQ 24(CX), CX + MOVQ (CX)(DI*8), DI + + // Update Literal Length State + BZHIQ SI, R14, CX + MOVQ $0x00001010, R13 + BEXTRQ R13, SI, SI + ADDQ CX, SI + + // Load ctx.llTable + MOVQ ctx+16(FP), CX + MOVQ (CX), CX + MOVQ (CX)(SI*8), SI + +sequenceDecs_decodeSync_bmi2_skip_update: + // Adjust offset + MOVQ s+0(FP), CX + MOVQ 8(SP), R13 + CMPQ R12, $0x01 + JBE sequenceDecs_decodeSync_bmi2_adjust_offsetB_1_or_0 + MOVUPS 144(CX), X0 + MOVQ R13, 144(CX) + MOVUPS X0, 152(CX) + JMP sequenceDecs_decodeSync_bmi2_adjust_end + +sequenceDecs_decodeSync_bmi2_adjust_offsetB_1_or_0: + CMPQ 24(SP), $0x00000000 + JNE sequenceDecs_decodeSync_bmi2_adjust_offset_maybezero + INCQ R13 + JMP sequenceDecs_decodeSync_bmi2_adjust_offset_nonzero + +sequenceDecs_decodeSync_bmi2_adjust_offset_maybezero: + TESTQ R13, R13 + JNZ sequenceDecs_decodeSync_bmi2_adjust_offset_nonzero + MOVQ 144(CX), R13 + JMP sequenceDecs_decodeSync_bmi2_adjust_end + +sequenceDecs_decodeSync_bmi2_adjust_offset_nonzero: + MOVQ R13, R12 + XORQ R14, R14 + MOVQ $-1, R15 + CMPQ R13, $0x03 + CMOVQEQ R14, R12 + CMOVQEQ R15, R14 + LEAQ 144(CX), R15 + ADDQ (R15)(R12*8), R14 + JNZ sequenceDecs_decodeSync_bmi2_adjust_temp_valid + MOVQ $0x00000001, R14 + +sequenceDecs_decodeSync_bmi2_adjust_temp_valid: + CMPQ R13, $0x01 + JZ sequenceDecs_decodeSync_bmi2_adjust_skip + MOVQ 152(CX), R12 + MOVQ R12, 160(CX) + +sequenceDecs_decodeSync_bmi2_adjust_skip: + MOVQ 144(CX), R12 + MOVQ R12, 152(CX) + MOVQ R14, 144(CX) + MOVQ R14, R13 + +sequenceDecs_decodeSync_bmi2_adjust_end: + MOVQ R13, 8(SP) + + // Check values + MOVQ 16(SP), CX + MOVQ 24(SP), R12 + LEAQ (CX)(R12*1), R14 + MOVQ s+0(FP), R15 + ADDQ R14, 256(R15) + MOVQ ctx+16(FP), R14 + SUBQ R12, 104(R14) + JS error_not_enough_literals + CMPQ CX, $0x00020002 + JA sequenceDecs_decodeSync_bmi2_error_match_len_too_big + TESTQ R13, R13 + JNZ sequenceDecs_decodeSync_bmi2_match_len_ofs_ok + TESTQ CX, CX + JNZ sequenceDecs_decodeSync_bmi2_error_match_len_ofs_mismatch + +sequenceDecs_decodeSync_bmi2_match_len_ofs_ok: + MOVQ 24(SP), CX + MOVQ 8(SP), R12 + MOVQ 16(SP), R13 + + // Check if we have enough space in s.out + LEAQ (CX)(R13*1), R14 + ADDQ R9, R14 + CMPQ R14, 32(SP) + JA error_not_enough_space + + // Copy literals + TESTQ CX, CX + JZ check_offset + XORQ R14, R14 + +copy_1: + MOVUPS (R10)(R14*1), X0 + MOVUPS X0, (R9)(R14*1) + ADDQ $0x10, R14 + CMPQ R14, CX + JB copy_1 + ADDQ CX, R10 + ADDQ CX, R9 + ADDQ CX, R11 + + // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize) +check_offset: + MOVQ R11, CX + ADDQ 40(SP), CX + CMPQ R12, CX + JG error_match_off_too_big + CMPQ R12, 56(SP) + JG error_match_off_too_big + + // Copy match from history + MOVQ R12, CX + SUBQ R11, CX + JLS copy_match + MOVQ 48(SP), R14 + SUBQ CX, R14 + CMPQ R13, CX + JGE copy_all_from_history + XORQ CX, CX + TESTQ $0x00000001, R13 + JZ copy_4_word + MOVB (R14)(CX*1), R12 + MOVB R12, (R9)(CX*1) + ADDQ $0x01, CX + +copy_4_word: + TESTQ $0x00000002, R13 + JZ copy_4_dword + MOVW (R14)(CX*1), R12 + MOVW R12, (R9)(CX*1) + ADDQ $0x02, CX + +copy_4_dword: + TESTQ $0x00000004, R13 + JZ copy_4_qword + MOVL (R14)(CX*1), R12 + MOVL R12, (R9)(CX*1) + ADDQ $0x04, CX + +copy_4_qword: + TESTQ $0x00000008, R13 + JZ copy_4_test + MOVQ (R14)(CX*1), R12 + MOVQ R12, (R9)(CX*1) + ADDQ $0x08, CX + JMP copy_4_test + +copy_4: + MOVUPS (R14)(CX*1), X0 + MOVUPS X0, (R9)(CX*1) + ADDQ $0x10, CX + +copy_4_test: + CMPQ CX, R13 + JB copy_4 + ADDQ R13, R11 + ADDQ R13, R9 + JMP handle_loop + JMP loop_finished + +copy_all_from_history: + XORQ R15, R15 + TESTQ $0x00000001, CX + JZ copy_5_word + MOVB (R14)(R15*1), BP + MOVB BP, (R9)(R15*1) + ADDQ $0x01, R15 + +copy_5_word: + TESTQ $0x00000002, CX + JZ copy_5_dword + MOVW (R14)(R15*1), BP + MOVW BP, (R9)(R15*1) + ADDQ $0x02, R15 + +copy_5_dword: + TESTQ $0x00000004, CX + JZ copy_5_qword + MOVL (R14)(R15*1), BP + MOVL BP, (R9)(R15*1) + ADDQ $0x04, R15 + +copy_5_qword: + TESTQ $0x00000008, CX + JZ copy_5_test + MOVQ (R14)(R15*1), BP + MOVQ BP, (R9)(R15*1) + ADDQ $0x08, R15 + JMP copy_5_test + +copy_5: + MOVUPS (R14)(R15*1), X0 + MOVUPS X0, (R9)(R15*1) + ADDQ $0x10, R15 + +copy_5_test: + CMPQ R15, CX + JB copy_5 + ADDQ CX, R9 + ADDQ CX, R11 + SUBQ CX, R13 + + // Copy match from the current buffer +copy_match: + TESTQ R13, R13 + JZ handle_loop + MOVQ R9, CX + SUBQ R12, CX + + // ml <= mo + CMPQ R13, R12 + JA copy_overlapping_match + + // Copy non-overlapping match + ADDQ R13, R11 + MOVQ R9, R12 + ADDQ R13, R9 + +copy_2: + MOVUPS (CX), X0 + MOVUPS X0, (R12) + ADDQ $0x10, CX + ADDQ $0x10, R12 + SUBQ $0x10, R13 + JHI copy_2 + JMP handle_loop + + // Copy overlapping match +copy_overlapping_match: + ADDQ R13, R11 + +copy_slow_3: + MOVB (CX), R12 + MOVB R12, (R9) + INCQ CX + INCQ R9 + DECQ R13 + JNZ copy_slow_3 + +handle_loop: + MOVQ ctx+16(FP), CX + DECQ 96(CX) + JNS sequenceDecs_decodeSync_bmi2_main_loop + +loop_finished: + MOVQ br+8(FP), CX + MOVQ AX, 32(CX) + MOVB DL, 40(CX) + MOVQ BX, 24(CX) + + // Update the context + MOVQ ctx+16(FP), AX + MOVQ R11, 136(AX) + MOVQ 144(AX), CX + SUBQ CX, R10 + MOVQ R10, 168(AX) + + // Return success + MOVQ $0x00000000, ret+24(FP) + RET + + // Return with match length error +sequenceDecs_decodeSync_bmi2_error_match_len_ofs_mismatch: + MOVQ 16(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 216(CX) + MOVQ $0x00000001, ret+24(FP) + RET + + // Return with match too long error +sequenceDecs_decodeSync_bmi2_error_match_len_too_big: + MOVQ ctx+16(FP), AX + MOVQ 16(SP), CX + MOVQ CX, 216(AX) + MOVQ $0x00000002, ret+24(FP) + RET + + // Return with match offset too long error +error_match_off_too_big: + MOVQ ctx+16(FP), AX + MOVQ 8(SP), CX + MOVQ CX, 224(AX) + MOVQ R11, 136(AX) + MOVQ $0x00000003, ret+24(FP) + RET + + // Return with not enough literals error +error_not_enough_literals: + MOVQ ctx+16(FP), AX + MOVQ 24(SP), CX + MOVQ CX, 208(AX) + MOVQ $0x00000004, ret+24(FP) + RET + + // Return with not enough output space error +error_not_enough_space: + MOVQ ctx+16(FP), AX + MOVQ 24(SP), CX + MOVQ CX, 208(AX) + MOVQ 16(SP), CX + MOVQ CX, 216(AX) + MOVQ R11, 136(AX) + MOVQ $0x00000005, ret+24(FP) + RET + +// func sequenceDecs_decodeSync_safe_amd64(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int +// Requires: CMOV, SSE +TEXT ·sequenceDecs_decodeSync_safe_amd64(SB), $64-32 + MOVQ br+8(FP), AX + MOVQ 32(AX), DX + MOVBQZX 40(AX), BX + MOVQ 24(AX), SI + MOVQ (AX), AX + ADDQ SI, AX + MOVQ AX, (SP) + MOVQ ctx+16(FP), AX + MOVQ 72(AX), DI + MOVQ 80(AX), R8 + MOVQ 88(AX), R9 + MOVQ 112(AX), R10 + MOVQ 128(AX), CX + MOVQ CX, 32(SP) + MOVQ 144(AX), R11 + MOVQ 136(AX), R12 + MOVQ 200(AX), CX + MOVQ CX, 56(SP) + MOVQ 176(AX), CX + MOVQ CX, 48(SP) + MOVQ 184(AX), AX + MOVQ AX, 40(SP) + MOVQ 40(SP), AX + ADDQ AX, 48(SP) + + // Calculate poiter to s.out[cap(s.out)] (a past-end pointer) + ADDQ R10, 32(SP) + + // outBase += outPosition + ADDQ R12, R10 + +sequenceDecs_decodeSync_safe_amd64_main_loop: + MOVQ (SP), R13 + + // Fill bitreader to have enough for the offset and match length. + CMPQ SI, $0x08 + JL sequenceDecs_decodeSync_safe_amd64_fill_byte_by_byte + MOVQ BX, AX + SHRQ $0x03, AX + SUBQ AX, R13 + MOVQ (R13), DX + SUBQ AX, SI + ANDQ $0x07, BX + JMP sequenceDecs_decodeSync_safe_amd64_fill_end + +sequenceDecs_decodeSync_safe_amd64_fill_byte_by_byte: + CMPQ SI, $0x00 + JLE sequenceDecs_decodeSync_safe_amd64_fill_end + CMPQ BX, $0x07 + JLE sequenceDecs_decodeSync_safe_amd64_fill_end + SHLQ $0x08, DX + SUBQ $0x01, R13 + SUBQ $0x01, SI + SUBQ $0x08, BX + MOVBQZX (R13), AX + ORQ AX, DX + JMP sequenceDecs_decodeSync_safe_amd64_fill_byte_by_byte + +sequenceDecs_decodeSync_safe_amd64_fill_end: + // Update offset + MOVQ R9, AX + MOVQ BX, CX + MOVQ DX, R14 + SHLQ CL, R14 + MOVB AH, CL + ADDQ CX, BX + NEGL CX + SHRQ CL, R14 + SHRQ $0x20, AX + TESTQ CX, CX + CMOVQEQ CX, R14 + ADDQ R14, AX + MOVQ AX, 8(SP) + + // Update match length + MOVQ R8, AX + MOVQ BX, CX + MOVQ DX, R14 + SHLQ CL, R14 + MOVB AH, CL + ADDQ CX, BX + NEGL CX + SHRQ CL, R14 + SHRQ $0x20, AX + TESTQ CX, CX + CMOVQEQ CX, R14 + ADDQ R14, AX + MOVQ AX, 16(SP) + + // Fill bitreader to have enough for the remaining + CMPQ SI, $0x08 + JL sequenceDecs_decodeSync_safe_amd64_fill_2_byte_by_byte + MOVQ BX, AX + SHRQ $0x03, AX + SUBQ AX, R13 + MOVQ (R13), DX + SUBQ AX, SI + ANDQ $0x07, BX + JMP sequenceDecs_decodeSync_safe_amd64_fill_2_end + +sequenceDecs_decodeSync_safe_amd64_fill_2_byte_by_byte: + CMPQ SI, $0x00 + JLE sequenceDecs_decodeSync_safe_amd64_fill_2_end + CMPQ BX, $0x07 + JLE sequenceDecs_decodeSync_safe_amd64_fill_2_end + SHLQ $0x08, DX + SUBQ $0x01, R13 + SUBQ $0x01, SI + SUBQ $0x08, BX + MOVBQZX (R13), AX + ORQ AX, DX + JMP sequenceDecs_decodeSync_safe_amd64_fill_2_byte_by_byte + +sequenceDecs_decodeSync_safe_amd64_fill_2_end: + // Update literal length + MOVQ DI, AX + MOVQ BX, CX + MOVQ DX, R14 + SHLQ CL, R14 + MOVB AH, CL + ADDQ CX, BX + NEGL CX + SHRQ CL, R14 + SHRQ $0x20, AX + TESTQ CX, CX + CMOVQEQ CX, R14 + ADDQ R14, AX + MOVQ AX, 24(SP) + + // Fill bitreader for state updates + MOVQ R13, (SP) + MOVQ R9, AX + SHRQ $0x08, AX + MOVBQZX AL, AX + MOVQ ctx+16(FP), CX + CMPQ 96(CX), $0x00 + JZ sequenceDecs_decodeSync_safe_amd64_skip_update + + // Update Literal Length State + MOVBQZX DI, R13 + SHRQ $0x10, DI + MOVWQZX DI, DI + CMPQ R13, $0x00 + JZ sequenceDecs_decodeSync_safe_amd64_llState_updateState_skip_zero + MOVQ BX, CX + ADDQ R13, BX + MOVQ DX, R14 + SHLQ CL, R14 + MOVQ R13, CX + NEGQ CX + SHRQ CL, R14 + ADDQ R14, DI + +sequenceDecs_decodeSync_safe_amd64_llState_updateState_skip_zero: + // Load ctx.llTable + MOVQ ctx+16(FP), CX + MOVQ (CX), CX + MOVQ (CX)(DI*8), DI + + // Update Match Length State + MOVBQZX R8, R13 + SHRQ $0x10, R8 + MOVWQZX R8, R8 + CMPQ R13, $0x00 + JZ sequenceDecs_decodeSync_safe_amd64_mlState_updateState_skip_zero + MOVQ BX, CX + ADDQ R13, BX + MOVQ DX, R14 + SHLQ CL, R14 + MOVQ R13, CX + NEGQ CX + SHRQ CL, R14 + ADDQ R14, R8 + +sequenceDecs_decodeSync_safe_amd64_mlState_updateState_skip_zero: + // Load ctx.mlTable + MOVQ ctx+16(FP), CX + MOVQ 24(CX), CX + MOVQ (CX)(R8*8), R8 + + // Update Offset State + MOVBQZX R9, R13 + SHRQ $0x10, R9 + MOVWQZX R9, R9 + CMPQ R13, $0x00 + JZ sequenceDecs_decodeSync_safe_amd64_ofState_updateState_skip_zero + MOVQ BX, CX + ADDQ R13, BX + MOVQ DX, R14 + SHLQ CL, R14 + MOVQ R13, CX + NEGQ CX + SHRQ CL, R14 + ADDQ R14, R9 + +sequenceDecs_decodeSync_safe_amd64_ofState_updateState_skip_zero: + // Load ctx.ofTable + MOVQ ctx+16(FP), CX + MOVQ 48(CX), CX + MOVQ (CX)(R9*8), R9 + +sequenceDecs_decodeSync_safe_amd64_skip_update: + // Adjust offset + MOVQ s+0(FP), CX + MOVQ 8(SP), R13 + CMPQ AX, $0x01 + JBE sequenceDecs_decodeSync_safe_amd64_adjust_offsetB_1_or_0 + MOVUPS 144(CX), X0 + MOVQ R13, 144(CX) + MOVUPS X0, 152(CX) + JMP sequenceDecs_decodeSync_safe_amd64_adjust_end + +sequenceDecs_decodeSync_safe_amd64_adjust_offsetB_1_or_0: + CMPQ 24(SP), $0x00000000 + JNE sequenceDecs_decodeSync_safe_amd64_adjust_offset_maybezero + INCQ R13 + JMP sequenceDecs_decodeSync_safe_amd64_adjust_offset_nonzero + +sequenceDecs_decodeSync_safe_amd64_adjust_offset_maybezero: + TESTQ R13, R13 + JNZ sequenceDecs_decodeSync_safe_amd64_adjust_offset_nonzero + MOVQ 144(CX), R13 + JMP sequenceDecs_decodeSync_safe_amd64_adjust_end + +sequenceDecs_decodeSync_safe_amd64_adjust_offset_nonzero: + MOVQ R13, AX + XORQ R14, R14 + MOVQ $-1, R15 + CMPQ R13, $0x03 + CMOVQEQ R14, AX + CMOVQEQ R15, R14 + LEAQ 144(CX), R15 + ADDQ (R15)(AX*8), R14 + JNZ sequenceDecs_decodeSync_safe_amd64_adjust_temp_valid + MOVQ $0x00000001, R14 + +sequenceDecs_decodeSync_safe_amd64_adjust_temp_valid: + CMPQ R13, $0x01 + JZ sequenceDecs_decodeSync_safe_amd64_adjust_skip + MOVQ 152(CX), AX + MOVQ AX, 160(CX) + +sequenceDecs_decodeSync_safe_amd64_adjust_skip: + MOVQ 144(CX), AX + MOVQ AX, 152(CX) + MOVQ R14, 144(CX) + MOVQ R14, R13 + +sequenceDecs_decodeSync_safe_amd64_adjust_end: + MOVQ R13, 8(SP) + + // Check values + MOVQ 16(SP), AX + MOVQ 24(SP), CX + LEAQ (AX)(CX*1), R14 + MOVQ s+0(FP), R15 + ADDQ R14, 256(R15) + MOVQ ctx+16(FP), R14 + SUBQ CX, 104(R14) + JS error_not_enough_literals + CMPQ AX, $0x00020002 + JA sequenceDecs_decodeSync_safe_amd64_error_match_len_too_big + TESTQ R13, R13 + JNZ sequenceDecs_decodeSync_safe_amd64_match_len_ofs_ok + TESTQ AX, AX + JNZ sequenceDecs_decodeSync_safe_amd64_error_match_len_ofs_mismatch + +sequenceDecs_decodeSync_safe_amd64_match_len_ofs_ok: + MOVQ 24(SP), AX + MOVQ 8(SP), CX + MOVQ 16(SP), R13 + + // Check if we have enough space in s.out + LEAQ (AX)(R13*1), R14 + ADDQ R10, R14 + CMPQ R14, 32(SP) + JA error_not_enough_space + + // Copy literals + TESTQ AX, AX + JZ check_offset + XORQ R14, R14 + TESTQ $0x00000001, AX + JZ copy_1_word + MOVB (R11)(R14*1), R15 + MOVB R15, (R10)(R14*1) + ADDQ $0x01, R14 + +copy_1_word: + TESTQ $0x00000002, AX + JZ copy_1_dword + MOVW (R11)(R14*1), R15 + MOVW R15, (R10)(R14*1) + ADDQ $0x02, R14 + +copy_1_dword: + TESTQ $0x00000004, AX + JZ copy_1_qword + MOVL (R11)(R14*1), R15 + MOVL R15, (R10)(R14*1) + ADDQ $0x04, R14 + +copy_1_qword: + TESTQ $0x00000008, AX + JZ copy_1_test + MOVQ (R11)(R14*1), R15 + MOVQ R15, (R10)(R14*1) + ADDQ $0x08, R14 + JMP copy_1_test + +copy_1: + MOVUPS (R11)(R14*1), X0 + MOVUPS X0, (R10)(R14*1) + ADDQ $0x10, R14 + +copy_1_test: + CMPQ R14, AX + JB copy_1 + ADDQ AX, R11 + ADDQ AX, R10 + ADDQ AX, R12 + + // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize) +check_offset: + MOVQ R12, AX + ADDQ 40(SP), AX + CMPQ CX, AX + JG error_match_off_too_big + CMPQ CX, 56(SP) + JG error_match_off_too_big + + // Copy match from history + MOVQ CX, AX + SUBQ R12, AX + JLS copy_match + MOVQ 48(SP), R14 + SUBQ AX, R14 + CMPQ R13, AX + JGE copy_all_from_history + XORQ AX, AX + TESTQ $0x00000001, R13 + JZ copy_4_word + MOVB (R14)(AX*1), CL + MOVB CL, (R10)(AX*1) + ADDQ $0x01, AX + +copy_4_word: + TESTQ $0x00000002, R13 + JZ copy_4_dword + MOVW (R14)(AX*1), CX + MOVW CX, (R10)(AX*1) + ADDQ $0x02, AX + +copy_4_dword: + TESTQ $0x00000004, R13 + JZ copy_4_qword + MOVL (R14)(AX*1), CX + MOVL CX, (R10)(AX*1) + ADDQ $0x04, AX + +copy_4_qword: + TESTQ $0x00000008, R13 + JZ copy_4_test + MOVQ (R14)(AX*1), CX + MOVQ CX, (R10)(AX*1) + ADDQ $0x08, AX + JMP copy_4_test + +copy_4: + MOVUPS (R14)(AX*1), X0 + MOVUPS X0, (R10)(AX*1) + ADDQ $0x10, AX + +copy_4_test: + CMPQ AX, R13 + JB copy_4 + ADDQ R13, R12 + ADDQ R13, R10 + JMP handle_loop + JMP loop_finished + +copy_all_from_history: + XORQ R15, R15 + TESTQ $0x00000001, AX + JZ copy_5_word + MOVB (R14)(R15*1), BP + MOVB BP, (R10)(R15*1) + ADDQ $0x01, R15 + +copy_5_word: + TESTQ $0x00000002, AX + JZ copy_5_dword + MOVW (R14)(R15*1), BP + MOVW BP, (R10)(R15*1) + ADDQ $0x02, R15 + +copy_5_dword: + TESTQ $0x00000004, AX + JZ copy_5_qword + MOVL (R14)(R15*1), BP + MOVL BP, (R10)(R15*1) + ADDQ $0x04, R15 + +copy_5_qword: + TESTQ $0x00000008, AX + JZ copy_5_test + MOVQ (R14)(R15*1), BP + MOVQ BP, (R10)(R15*1) + ADDQ $0x08, R15 + JMP copy_5_test + +copy_5: + MOVUPS (R14)(R15*1), X0 + MOVUPS X0, (R10)(R15*1) + ADDQ $0x10, R15 + +copy_5_test: + CMPQ R15, AX + JB copy_5 + ADDQ AX, R10 + ADDQ AX, R12 + SUBQ AX, R13 + + // Copy match from the current buffer +copy_match: + TESTQ R13, R13 + JZ handle_loop + MOVQ R10, AX + SUBQ CX, AX + + // ml <= mo + CMPQ R13, CX + JA copy_overlapping_match + + // Copy non-overlapping match + ADDQ R13, R12 + XORQ CX, CX + TESTQ $0x00000001, R13 + JZ copy_2_word + MOVB (AX)(CX*1), R14 + MOVB R14, (R10)(CX*1) + ADDQ $0x01, CX + +copy_2_word: + TESTQ $0x00000002, R13 + JZ copy_2_dword + MOVW (AX)(CX*1), R14 + MOVW R14, (R10)(CX*1) + ADDQ $0x02, CX + +copy_2_dword: + TESTQ $0x00000004, R13 + JZ copy_2_qword + MOVL (AX)(CX*1), R14 + MOVL R14, (R10)(CX*1) + ADDQ $0x04, CX + +copy_2_qword: + TESTQ $0x00000008, R13 + JZ copy_2_test + MOVQ (AX)(CX*1), R14 + MOVQ R14, (R10)(CX*1) + ADDQ $0x08, CX + JMP copy_2_test + +copy_2: + MOVUPS (AX)(CX*1), X0 + MOVUPS X0, (R10)(CX*1) + ADDQ $0x10, CX + +copy_2_test: + CMPQ CX, R13 + JB copy_2 + ADDQ R13, R10 + JMP handle_loop + + // Copy overlapping match +copy_overlapping_match: + ADDQ R13, R12 + +copy_slow_3: + MOVB (AX), CL + MOVB CL, (R10) + INCQ AX + INCQ R10 + DECQ R13 + JNZ copy_slow_3 + +handle_loop: + MOVQ ctx+16(FP), AX + DECQ 96(AX) + JNS sequenceDecs_decodeSync_safe_amd64_main_loop + +loop_finished: + MOVQ br+8(FP), AX + MOVQ DX, 32(AX) + MOVB BL, 40(AX) + MOVQ SI, 24(AX) + + // Update the context + MOVQ ctx+16(FP), AX + MOVQ R12, 136(AX) + MOVQ 144(AX), CX + SUBQ CX, R11 + MOVQ R11, 168(AX) + + // Return success + MOVQ $0x00000000, ret+24(FP) + RET + + // Return with match length error +sequenceDecs_decodeSync_safe_amd64_error_match_len_ofs_mismatch: + MOVQ 16(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 216(CX) + MOVQ $0x00000001, ret+24(FP) + RET + + // Return with match too long error +sequenceDecs_decodeSync_safe_amd64_error_match_len_too_big: + MOVQ ctx+16(FP), AX + MOVQ 16(SP), CX + MOVQ CX, 216(AX) + MOVQ $0x00000002, ret+24(FP) + RET + + // Return with match offset too long error +error_match_off_too_big: + MOVQ ctx+16(FP), AX + MOVQ 8(SP), CX + MOVQ CX, 224(AX) + MOVQ R12, 136(AX) + MOVQ $0x00000003, ret+24(FP) + RET + + // Return with not enough literals error +error_not_enough_literals: + MOVQ ctx+16(FP), AX + MOVQ 24(SP), CX + MOVQ CX, 208(AX) + MOVQ $0x00000004, ret+24(FP) + RET + + // Return with not enough output space error +error_not_enough_space: + MOVQ ctx+16(FP), AX + MOVQ 24(SP), CX + MOVQ CX, 208(AX) + MOVQ 16(SP), CX + MOVQ CX, 216(AX) + MOVQ R12, 136(AX) + MOVQ $0x00000005, ret+24(FP) + RET + +// func sequenceDecs_decodeSync_safe_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int +// Requires: BMI, BMI2, CMOV, SSE +TEXT ·sequenceDecs_decodeSync_safe_bmi2(SB), $64-32 + MOVQ br+8(FP), CX + MOVQ 32(CX), AX + MOVBQZX 40(CX), DX + MOVQ 24(CX), BX + MOVQ (CX), CX + ADDQ BX, CX + MOVQ CX, (SP) + MOVQ ctx+16(FP), CX + MOVQ 72(CX), SI + MOVQ 80(CX), DI + MOVQ 88(CX), R8 + MOVQ 112(CX), R9 + MOVQ 128(CX), R10 + MOVQ R10, 32(SP) + MOVQ 144(CX), R10 + MOVQ 136(CX), R11 + MOVQ 200(CX), R12 + MOVQ R12, 56(SP) + MOVQ 176(CX), R12 + MOVQ R12, 48(SP) + MOVQ 184(CX), CX + MOVQ CX, 40(SP) + MOVQ 40(SP), CX + ADDQ CX, 48(SP) + + // Calculate poiter to s.out[cap(s.out)] (a past-end pointer) + ADDQ R9, 32(SP) + + // outBase += outPosition + ADDQ R11, R9 + +sequenceDecs_decodeSync_safe_bmi2_main_loop: + MOVQ (SP), R12 + + // Fill bitreader to have enough for the offset and match length. + CMPQ BX, $0x08 + JL sequenceDecs_decodeSync_safe_bmi2_fill_byte_by_byte + MOVQ DX, CX + SHRQ $0x03, CX + SUBQ CX, R12 + MOVQ (R12), AX + SUBQ CX, BX + ANDQ $0x07, DX + JMP sequenceDecs_decodeSync_safe_bmi2_fill_end + +sequenceDecs_decodeSync_safe_bmi2_fill_byte_by_byte: + CMPQ BX, $0x00 + JLE sequenceDecs_decodeSync_safe_bmi2_fill_end + CMPQ DX, $0x07 + JLE sequenceDecs_decodeSync_safe_bmi2_fill_end + SHLQ $0x08, AX + SUBQ $0x01, R12 + SUBQ $0x01, BX + SUBQ $0x08, DX + MOVBQZX (R12), CX + ORQ CX, AX + JMP sequenceDecs_decodeSync_safe_bmi2_fill_byte_by_byte + +sequenceDecs_decodeSync_safe_bmi2_fill_end: + // Update offset + MOVQ $0x00000808, CX + BEXTRQ CX, R8, R13 + MOVQ AX, R14 + LEAQ (DX)(R13*1), CX + ROLQ CL, R14 + BZHIQ R13, R14, R14 + MOVQ CX, DX + MOVQ R8, CX + SHRQ $0x20, CX + ADDQ R14, CX + MOVQ CX, 8(SP) + + // Update match length + MOVQ $0x00000808, CX + BEXTRQ CX, DI, R13 + MOVQ AX, R14 + LEAQ (DX)(R13*1), CX + ROLQ CL, R14 + BZHIQ R13, R14, R14 + MOVQ CX, DX + MOVQ DI, CX + SHRQ $0x20, CX + ADDQ R14, CX + MOVQ CX, 16(SP) + + // Fill bitreader to have enough for the remaining + CMPQ BX, $0x08 + JL sequenceDecs_decodeSync_safe_bmi2_fill_2_byte_by_byte + MOVQ DX, CX + SHRQ $0x03, CX + SUBQ CX, R12 + MOVQ (R12), AX + SUBQ CX, BX + ANDQ $0x07, DX + JMP sequenceDecs_decodeSync_safe_bmi2_fill_2_end + +sequenceDecs_decodeSync_safe_bmi2_fill_2_byte_by_byte: + CMPQ BX, $0x00 + JLE sequenceDecs_decodeSync_safe_bmi2_fill_2_end + CMPQ DX, $0x07 + JLE sequenceDecs_decodeSync_safe_bmi2_fill_2_end + SHLQ $0x08, AX + SUBQ $0x01, R12 + SUBQ $0x01, BX + SUBQ $0x08, DX + MOVBQZX (R12), CX + ORQ CX, AX + JMP sequenceDecs_decodeSync_safe_bmi2_fill_2_byte_by_byte + +sequenceDecs_decodeSync_safe_bmi2_fill_2_end: + // Update literal length + MOVQ $0x00000808, CX + BEXTRQ CX, SI, R13 + MOVQ AX, R14 + LEAQ (DX)(R13*1), CX + ROLQ CL, R14 + BZHIQ R13, R14, R14 + MOVQ CX, DX + MOVQ SI, CX + SHRQ $0x20, CX + ADDQ R14, CX + MOVQ CX, 24(SP) + + // Fill bitreader for state updates + MOVQ R12, (SP) + MOVQ $0x00000808, CX + BEXTRQ CX, R8, R12 + MOVQ ctx+16(FP), CX + CMPQ 96(CX), $0x00 + JZ sequenceDecs_decodeSync_safe_bmi2_skip_update + LEAQ (SI)(DI*1), R13 + ADDQ R8, R13 + MOVBQZX R13, R13 + LEAQ (DX)(R13*1), CX + MOVQ AX, R14 + MOVQ CX, DX + ROLQ CL, R14 + BZHIQ R13, R14, R14 + + // Update Offset State + BZHIQ R8, R14, CX + SHRXQ R8, R14, R14 + MOVQ $0x00001010, R13 + BEXTRQ R13, R8, R8 + ADDQ CX, R8 + + // Load ctx.ofTable + MOVQ ctx+16(FP), CX + MOVQ 48(CX), CX + MOVQ (CX)(R8*8), R8 + + // Update Match Length State + BZHIQ DI, R14, CX + SHRXQ DI, R14, R14 + MOVQ $0x00001010, R13 + BEXTRQ R13, DI, DI + ADDQ CX, DI + + // Load ctx.mlTable + MOVQ ctx+16(FP), CX + MOVQ 24(CX), CX + MOVQ (CX)(DI*8), DI + + // Update Literal Length State + BZHIQ SI, R14, CX + MOVQ $0x00001010, R13 + BEXTRQ R13, SI, SI + ADDQ CX, SI + + // Load ctx.llTable + MOVQ ctx+16(FP), CX + MOVQ (CX), CX + MOVQ (CX)(SI*8), SI + +sequenceDecs_decodeSync_safe_bmi2_skip_update: + // Adjust offset + MOVQ s+0(FP), CX + MOVQ 8(SP), R13 + CMPQ R12, $0x01 + JBE sequenceDecs_decodeSync_safe_bmi2_adjust_offsetB_1_or_0 + MOVUPS 144(CX), X0 + MOVQ R13, 144(CX) + MOVUPS X0, 152(CX) + JMP sequenceDecs_decodeSync_safe_bmi2_adjust_end + +sequenceDecs_decodeSync_safe_bmi2_adjust_offsetB_1_or_0: + CMPQ 24(SP), $0x00000000 + JNE sequenceDecs_decodeSync_safe_bmi2_adjust_offset_maybezero + INCQ R13 + JMP sequenceDecs_decodeSync_safe_bmi2_adjust_offset_nonzero + +sequenceDecs_decodeSync_safe_bmi2_adjust_offset_maybezero: + TESTQ R13, R13 + JNZ sequenceDecs_decodeSync_safe_bmi2_adjust_offset_nonzero + MOVQ 144(CX), R13 + JMP sequenceDecs_decodeSync_safe_bmi2_adjust_end + +sequenceDecs_decodeSync_safe_bmi2_adjust_offset_nonzero: + MOVQ R13, R12 + XORQ R14, R14 + MOVQ $-1, R15 + CMPQ R13, $0x03 + CMOVQEQ R14, R12 + CMOVQEQ R15, R14 + LEAQ 144(CX), R15 + ADDQ (R15)(R12*8), R14 + JNZ sequenceDecs_decodeSync_safe_bmi2_adjust_temp_valid + MOVQ $0x00000001, R14 + +sequenceDecs_decodeSync_safe_bmi2_adjust_temp_valid: + CMPQ R13, $0x01 + JZ sequenceDecs_decodeSync_safe_bmi2_adjust_skip + MOVQ 152(CX), R12 + MOVQ R12, 160(CX) + +sequenceDecs_decodeSync_safe_bmi2_adjust_skip: + MOVQ 144(CX), R12 + MOVQ R12, 152(CX) + MOVQ R14, 144(CX) + MOVQ R14, R13 + +sequenceDecs_decodeSync_safe_bmi2_adjust_end: + MOVQ R13, 8(SP) + + // Check values + MOVQ 16(SP), CX + MOVQ 24(SP), R12 + LEAQ (CX)(R12*1), R14 + MOVQ s+0(FP), R15 + ADDQ R14, 256(R15) + MOVQ ctx+16(FP), R14 + SUBQ R12, 104(R14) + JS error_not_enough_literals + CMPQ CX, $0x00020002 + JA sequenceDecs_decodeSync_safe_bmi2_error_match_len_too_big + TESTQ R13, R13 + JNZ sequenceDecs_decodeSync_safe_bmi2_match_len_ofs_ok + TESTQ CX, CX + JNZ sequenceDecs_decodeSync_safe_bmi2_error_match_len_ofs_mismatch + +sequenceDecs_decodeSync_safe_bmi2_match_len_ofs_ok: + MOVQ 24(SP), CX + MOVQ 8(SP), R12 + MOVQ 16(SP), R13 + + // Check if we have enough space in s.out + LEAQ (CX)(R13*1), R14 + ADDQ R9, R14 + CMPQ R14, 32(SP) + JA error_not_enough_space + + // Copy literals + TESTQ CX, CX + JZ check_offset + XORQ R14, R14 + TESTQ $0x00000001, CX + JZ copy_1_word + MOVB (R10)(R14*1), R15 + MOVB R15, (R9)(R14*1) + ADDQ $0x01, R14 + +copy_1_word: + TESTQ $0x00000002, CX + JZ copy_1_dword + MOVW (R10)(R14*1), R15 + MOVW R15, (R9)(R14*1) + ADDQ $0x02, R14 + +copy_1_dword: + TESTQ $0x00000004, CX + JZ copy_1_qword + MOVL (R10)(R14*1), R15 + MOVL R15, (R9)(R14*1) + ADDQ $0x04, R14 + +copy_1_qword: + TESTQ $0x00000008, CX + JZ copy_1_test + MOVQ (R10)(R14*1), R15 + MOVQ R15, (R9)(R14*1) + ADDQ $0x08, R14 + JMP copy_1_test + +copy_1: + MOVUPS (R10)(R14*1), X0 + MOVUPS X0, (R9)(R14*1) + ADDQ $0x10, R14 + +copy_1_test: + CMPQ R14, CX + JB copy_1 + ADDQ CX, R10 + ADDQ CX, R9 + ADDQ CX, R11 + + // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize) +check_offset: + MOVQ R11, CX + ADDQ 40(SP), CX + CMPQ R12, CX + JG error_match_off_too_big + CMPQ R12, 56(SP) + JG error_match_off_too_big + + // Copy match from history + MOVQ R12, CX + SUBQ R11, CX + JLS copy_match + MOVQ 48(SP), R14 + SUBQ CX, R14 + CMPQ R13, CX + JGE copy_all_from_history + XORQ CX, CX + TESTQ $0x00000001, R13 + JZ copy_4_word + MOVB (R14)(CX*1), R12 + MOVB R12, (R9)(CX*1) + ADDQ $0x01, CX + +copy_4_word: + TESTQ $0x00000002, R13 + JZ copy_4_dword + MOVW (R14)(CX*1), R12 + MOVW R12, (R9)(CX*1) + ADDQ $0x02, CX + +copy_4_dword: + TESTQ $0x00000004, R13 + JZ copy_4_qword + MOVL (R14)(CX*1), R12 + MOVL R12, (R9)(CX*1) + ADDQ $0x04, CX + +copy_4_qword: + TESTQ $0x00000008, R13 + JZ copy_4_test + MOVQ (R14)(CX*1), R12 + MOVQ R12, (R9)(CX*1) + ADDQ $0x08, CX + JMP copy_4_test + +copy_4: + MOVUPS (R14)(CX*1), X0 + MOVUPS X0, (R9)(CX*1) + ADDQ $0x10, CX + +copy_4_test: + CMPQ CX, R13 + JB copy_4 + ADDQ R13, R11 + ADDQ R13, R9 + JMP handle_loop + JMP loop_finished + +copy_all_from_history: + XORQ R15, R15 + TESTQ $0x00000001, CX + JZ copy_5_word + MOVB (R14)(R15*1), BP + MOVB BP, (R9)(R15*1) + ADDQ $0x01, R15 + +copy_5_word: + TESTQ $0x00000002, CX + JZ copy_5_dword + MOVW (R14)(R15*1), BP + MOVW BP, (R9)(R15*1) + ADDQ $0x02, R15 + +copy_5_dword: + TESTQ $0x00000004, CX + JZ copy_5_qword + MOVL (R14)(R15*1), BP + MOVL BP, (R9)(R15*1) + ADDQ $0x04, R15 + +copy_5_qword: + TESTQ $0x00000008, CX + JZ copy_5_test + MOVQ (R14)(R15*1), BP + MOVQ BP, (R9)(R15*1) + ADDQ $0x08, R15 + JMP copy_5_test + +copy_5: + MOVUPS (R14)(R15*1), X0 + MOVUPS X0, (R9)(R15*1) + ADDQ $0x10, R15 + +copy_5_test: + CMPQ R15, CX + JB copy_5 + ADDQ CX, R9 + ADDQ CX, R11 + SUBQ CX, R13 + + // Copy match from the current buffer +copy_match: + TESTQ R13, R13 + JZ handle_loop + MOVQ R9, CX + SUBQ R12, CX + + // ml <= mo + CMPQ R13, R12 + JA copy_overlapping_match + + // Copy non-overlapping match + ADDQ R13, R11 + XORQ R12, R12 + TESTQ $0x00000001, R13 + JZ copy_2_word + MOVB (CX)(R12*1), R14 + MOVB R14, (R9)(R12*1) + ADDQ $0x01, R12 + +copy_2_word: + TESTQ $0x00000002, R13 + JZ copy_2_dword + MOVW (CX)(R12*1), R14 + MOVW R14, (R9)(R12*1) + ADDQ $0x02, R12 + +copy_2_dword: + TESTQ $0x00000004, R13 + JZ copy_2_qword + MOVL (CX)(R12*1), R14 + MOVL R14, (R9)(R12*1) + ADDQ $0x04, R12 + +copy_2_qword: + TESTQ $0x00000008, R13 + JZ copy_2_test + MOVQ (CX)(R12*1), R14 + MOVQ R14, (R9)(R12*1) + ADDQ $0x08, R12 + JMP copy_2_test + +copy_2: + MOVUPS (CX)(R12*1), X0 + MOVUPS X0, (R9)(R12*1) + ADDQ $0x10, R12 + +copy_2_test: + CMPQ R12, R13 + JB copy_2 + ADDQ R13, R9 + JMP handle_loop + + // Copy overlapping match +copy_overlapping_match: + ADDQ R13, R11 + +copy_slow_3: + MOVB (CX), R12 + MOVB R12, (R9) + INCQ CX + INCQ R9 + DECQ R13 + JNZ copy_slow_3 + +handle_loop: + MOVQ ctx+16(FP), CX + DECQ 96(CX) + JNS sequenceDecs_decodeSync_safe_bmi2_main_loop + +loop_finished: + MOVQ br+8(FP), CX + MOVQ AX, 32(CX) + MOVB DL, 40(CX) + MOVQ BX, 24(CX) + + // Update the context + MOVQ ctx+16(FP), AX + MOVQ R11, 136(AX) + MOVQ 144(AX), CX + SUBQ CX, R10 + MOVQ R10, 168(AX) + + // Return success + MOVQ $0x00000000, ret+24(FP) + RET + + // Return with match length error +sequenceDecs_decodeSync_safe_bmi2_error_match_len_ofs_mismatch: + MOVQ 16(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 216(CX) + MOVQ $0x00000001, ret+24(FP) + RET + + // Return with match too long error +sequenceDecs_decodeSync_safe_bmi2_error_match_len_too_big: + MOVQ ctx+16(FP), AX + MOVQ 16(SP), CX + MOVQ CX, 216(AX) + MOVQ $0x00000002, ret+24(FP) + RET + + // Return with match offset too long error +error_match_off_too_big: + MOVQ ctx+16(FP), AX + MOVQ 8(SP), CX + MOVQ CX, 224(AX) + MOVQ R11, 136(AX) + MOVQ $0x00000003, ret+24(FP) + RET + + // Return with not enough literals error +error_not_enough_literals: + MOVQ ctx+16(FP), AX + MOVQ 24(SP), CX + MOVQ CX, 208(AX) + MOVQ $0x00000004, ret+24(FP) + RET + + // Return with not enough output space error +error_not_enough_space: + MOVQ ctx+16(FP), AX + MOVQ 24(SP), CX + MOVQ CX, 208(AX) + MOVQ 16(SP), CX + MOVQ CX, 216(AX) + MOVQ R11, 136(AX) + MOVQ $0x00000005, ret+24(FP) + RET diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go b/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go new file mode 100644 index 00000000..c3452bc3 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go @@ -0,0 +1,237 @@ +//go:build !amd64 || appengine || !gc || noasm +// +build !amd64 appengine !gc noasm + +package zstd + +import ( + "fmt" + "io" +) + +// decode sequences from the stream with the provided history but without dictionary. +func (s *sequenceDecs) decodeSyncSimple(hist []byte) (bool, error) { + return false, nil +} + +// decode sequences from the stream without the provided history. +func (s *sequenceDecs) decode(seqs []seqVals) error { + br := s.br + + // Grab full sizes tables, to avoid bounds checks. + llTable, mlTable, ofTable := s.litLengths.fse.dt[:maxTablesize], s.matchLengths.fse.dt[:maxTablesize], s.offsets.fse.dt[:maxTablesize] + llState, mlState, ofState := s.litLengths.state.state, s.matchLengths.state.state, s.offsets.state.state + s.seqSize = 0 + litRemain := len(s.literals) + + maxBlockSize := maxCompressedBlockSize + if s.windowSize < maxBlockSize { + maxBlockSize = s.windowSize + } + for i := range seqs { + var ll, mo, ml int + if br.off > 4+((maxOffsetBits+16+16)>>3) { + // inlined function: + // ll, mo, ml = s.nextFast(br, llState, mlState, ofState) + + // Final will not read from stream. + var llB, mlB, moB uint8 + ll, llB = llState.final() + ml, mlB = mlState.final() + mo, moB = ofState.final() + + // extra bits are stored in reverse order. + br.fillFast() + mo += br.getBits(moB) + if s.maxBits > 32 { + br.fillFast() + } + ml += br.getBits(mlB) + ll += br.getBits(llB) + + if moB > 1 { + s.prevOffset[2] = s.prevOffset[1] + s.prevOffset[1] = s.prevOffset[0] + s.prevOffset[0] = mo + } else { + // mo = s.adjustOffset(mo, ll, moB) + // Inlined for rather big speedup + if ll == 0 { + // There is an exception though, when current sequence's literals_length = 0. + // In this case, repeated offsets are shifted by one, so an offset_value of 1 means Repeated_Offset2, + // an offset_value of 2 means Repeated_Offset3, and an offset_value of 3 means Repeated_Offset1 - 1_byte. + mo++ + } + + if mo == 0 { + mo = s.prevOffset[0] + } else { + var temp int + if mo == 3 { + temp = s.prevOffset[0] - 1 + } else { + temp = s.prevOffset[mo] + } + + if temp == 0 { + // 0 is not valid; input is corrupted; force offset to 1 + println("WARNING: temp was 0") + temp = 1 + } + + if mo != 1 { + s.prevOffset[2] = s.prevOffset[1] + } + s.prevOffset[1] = s.prevOffset[0] + s.prevOffset[0] = temp + mo = temp + } + } + br.fillFast() + } else { + if br.overread() { + if debugDecoder { + printf("reading sequence %d, exceeded available data\n", i) + } + return io.ErrUnexpectedEOF + } + ll, mo, ml = s.next(br, llState, mlState, ofState) + br.fill() + } + + if debugSequences { + println("Seq", i, "Litlen:", ll, "mo:", mo, "(abs) ml:", ml) + } + // Evaluate. + // We might be doing this async, so do it early. + if mo == 0 && ml > 0 { + return fmt.Errorf("zero matchoff and matchlen (%d) > 0", ml) + } + if ml > maxMatchLen { + return fmt.Errorf("match len (%d) bigger than max allowed length", ml) + } + s.seqSize += ll + ml + if s.seqSize > maxBlockSize { + return fmt.Errorf("output (%d) bigger than max block size (%d)", s.seqSize, maxBlockSize) + } + litRemain -= ll + if litRemain < 0 { + return fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", ll, litRemain+ll) + } + seqs[i] = seqVals{ + ll: ll, + ml: ml, + mo: mo, + } + if i == len(seqs)-1 { + // This is the last sequence, so we shouldn't update state. + break + } + + // Manually inlined, ~ 5-20% faster + // Update all 3 states at once. Approx 20% faster. + nBits := llState.nbBits() + mlState.nbBits() + ofState.nbBits() + if nBits == 0 { + llState = llTable[llState.newState()&maxTableMask] + mlState = mlTable[mlState.newState()&maxTableMask] + ofState = ofTable[ofState.newState()&maxTableMask] + } else { + bits := br.get32BitsFast(nBits) + lowBits := uint16(bits >> ((ofState.nbBits() + mlState.nbBits()) & 31)) + llState = llTable[(llState.newState()+lowBits)&maxTableMask] + + lowBits = uint16(bits >> (ofState.nbBits() & 31)) + lowBits &= bitMask[mlState.nbBits()&15] + mlState = mlTable[(mlState.newState()+lowBits)&maxTableMask] + + lowBits = uint16(bits) & bitMask[ofState.nbBits()&15] + ofState = ofTable[(ofState.newState()+lowBits)&maxTableMask] + } + } + s.seqSize += litRemain + if s.seqSize > maxBlockSize { + return fmt.Errorf("output (%d) bigger than max block size (%d)", s.seqSize, maxBlockSize) + } + err := br.close() + if err != nil { + printf("Closing sequences: %v, %+v\n", err, *br) + } + return err +} + +// executeSimple handles cases when a dictionary is not used. +func (s *sequenceDecs) executeSimple(seqs []seqVals, hist []byte) error { + // Ensure we have enough output size... + if len(s.out)+s.seqSize > cap(s.out) { + addBytes := s.seqSize + len(s.out) + s.out = append(s.out, make([]byte, addBytes)...) + s.out = s.out[:len(s.out)-addBytes] + } + + if debugDecoder { + printf("Execute %d seqs with literals: %d into %d bytes\n", len(seqs), len(s.literals), s.seqSize) + } + + var t = len(s.out) + out := s.out[:t+s.seqSize] + + for _, seq := range seqs { + // Add literals + copy(out[t:], s.literals[:seq.ll]) + t += seq.ll + s.literals = s.literals[seq.ll:] + + // Malformed input + if seq.mo > t+len(hist) || seq.mo > s.windowSize { + return fmt.Errorf("match offset (%d) bigger than current history (%d)", seq.mo, t+len(hist)) + } + + // Copy from history. + if v := seq.mo - t; v > 0 { + // v is the start position in history from end. + start := len(hist) - v + if seq.ml > v { + // Some goes into the current block. + // Copy remainder of history + copy(out[t:], hist[start:]) + t += v + seq.ml -= v + } else { + copy(out[t:], hist[start:start+seq.ml]) + t += seq.ml + continue + } + } + + // We must be in the current buffer now + if seq.ml > 0 { + start := t - seq.mo + if seq.ml <= t-start { + // No overlap + copy(out[t:], out[start:start+seq.ml]) + t += seq.ml + } else { + // Overlapping copy + // Extend destination slice and copy one byte at the time. + src := out[start : start+seq.ml] + dst := out[t:] + dst = dst[:len(src)] + t += len(src) + // Destination is the space we just added. + for i := range src { + dst[i] = src[i] + } + } + } + } + // Add final literals + copy(out[t:], s.literals) + if debugDecoder { + t += len(s.literals) + if t != len(out) { + panic(fmt.Errorf("length mismatch, want %d, got %d, ss: %d", len(out), t, s.seqSize)) + } + } + s.out = out + + return nil +} diff --git a/vendor/github.com/klauspost/compress/zstd/zip.go b/vendor/github.com/klauspost/compress/zstd/zip.go index ffffcbc2..29c15c8c 100644 --- a/vendor/github.com/klauspost/compress/zstd/zip.go +++ b/vendor/github.com/klauspost/compress/zstd/zip.go @@ -18,26 +18,44 @@ const ZipMethodWinZip = 93 // See https://pkware.cachefly.net/webdocs/APPNOTE/APPNOTE-6.3.9.TXT const ZipMethodPKWare = 20 -var zipReaderPool sync.Pool +// zipReaderPool is the default reader pool. +var zipReaderPool = sync.Pool{New: func() interface{} { + z, err := NewReader(nil, WithDecoderLowmem(true), WithDecoderMaxWindow(128<<20), WithDecoderConcurrency(1)) + if err != nil { + panic(err) + } + return z +}} // newZipReader creates a pooled zip decompressor. -func newZipReader(r io.Reader) io.ReadCloser { - dec, ok := zipReaderPool.Get().(*Decoder) - if ok { - dec.Reset(r) - } else { - d, err := NewReader(r, WithDecoderConcurrency(1), WithDecoderLowmem(true)) - if err != nil { - panic(err) +func newZipReader(opts ...DOption) func(r io.Reader) io.ReadCloser { + pool := &zipReaderPool + if len(opts) > 0 { + opts = append([]DOption{WithDecoderLowmem(true), WithDecoderMaxWindow(128 << 20)}, opts...) + // Force concurrency 1 + opts = append(opts, WithDecoderConcurrency(1)) + // Create our own pool + pool = &sync.Pool{} + } + return func(r io.Reader) io.ReadCloser { + dec, ok := pool.Get().(*Decoder) + if ok { + dec.Reset(r) + } else { + d, err := NewReader(r, opts...) + if err != nil { + panic(err) + } + dec = d } - dec = d + return &pooledZipReader{dec: dec, pool: pool} } - return &pooledZipReader{dec: dec} } type pooledZipReader struct { - mu sync.Mutex // guards Close and Read - dec *Decoder + mu sync.Mutex // guards Close and Read + pool *sync.Pool + dec *Decoder } func (r *pooledZipReader) Read(p []byte) (n int, err error) { @@ -48,8 +66,8 @@ func (r *pooledZipReader) Read(p []byte) (n int, err error) { } dec, err := r.dec.Read(p) if err == io.EOF { - err = r.dec.Reset(nil) - zipReaderPool.Put(r.dec) + r.dec.Reset(nil) + r.pool.Put(r.dec) r.dec = nil } return dec, err @@ -61,7 +79,7 @@ func (r *pooledZipReader) Close() error { var err error if r.dec != nil { err = r.dec.Reset(nil) - zipReaderPool.Put(r.dec) + r.pool.Put(r.dec) r.dec = nil } return err @@ -115,6 +133,9 @@ func ZipCompressor(opts ...EOption) func(w io.Writer) (io.WriteCloser, error) { // ZipDecompressor returns a decompressor that can be registered with zip libraries. // See ZipCompressor for example. -func ZipDecompressor() func(r io.Reader) io.ReadCloser { - return newZipReader +// Options can be specified. WithDecoderConcurrency(1) is forced, +// and by default a 128MB maximum decompression window is specified. +// The window size can be overridden if required. +func ZipDecompressor(opts ...DOption) func(r io.Reader) io.ReadCloser { + return newZipReader(opts...) } diff --git a/vendor/github.com/klauspost/compress/zstd/zstd.go b/vendor/github.com/klauspost/compress/zstd/zstd.go index c1c90b4a..3eb3f1c8 100644 --- a/vendor/github.com/klauspost/compress/zstd/zstd.go +++ b/vendor/github.com/klauspost/compress/zstd/zstd.go @@ -110,17 +110,6 @@ func printf(format string, a ...interface{}) { } } -// matchLenFast does matching, but will not match the last up to 7 bytes. -func matchLenFast(a, b []byte) int { - endI := len(a) & (math.MaxInt32 - 7) - for i := 0; i < endI; i += 8 { - if diff := load64(a, i) ^ load64(b, i); diff != 0 { - return i + bits.TrailingZeros64(diff)>>3 - } - } - return endI -} - // matchLen returns the maximum length. // a must be the shortest of the two. // The function also returns whether all bytes matched. diff --git a/vendor/github.com/slack-go/slack/README.md b/vendor/github.com/slack-go/slack/README.md index 39b04ce8..9618aebc 100644 --- a/vendor/github.com/slack-go/slack/README.md +++ b/vendor/github.com/slack-go/slack/README.md @@ -39,7 +39,7 @@ func main() { // If you set debugging, it will log all requests to the console // Useful when encountering issues // slack.New("YOUR_TOKEN_HERE", slack.OptionDebug(true)) - groups, err := api.GetUserGroups(false) + groups, err := api.GetUserGroups(slack.GetUserGroupsOptionIncludeUsers(false)) if err != nil { fmt.Printf("%s\n", err) return @@ -86,7 +86,13 @@ See https://github.com/slack-go/slack/blob/master/examples/websocket/websocket.g See https://github.com/slack-go/slack/blob/master/examples/eventsapi/events.go +## Socketmode Event Handler (Experimental) +When using socket mode, dealing with an event can be pretty lengthy as it requires you to route the event to the right place. + +Instead, you can use `SocketmodeHandler` much like you use an HTTP handler to register which event you would like to listen to and what callback function will process that event when it occurs. + +See [./examples/socketmode_handler/socketmode_handler.go](./examples/socketmode_handler/socketmode_handler.go) ## Contributing You are more than welcome to contribute to this project. Fork and diff --git a/vendor/github.com/slack-go/slack/block_input.go b/vendor/github.com/slack-go/slack/block_input.go index 087571af..78ffcdb8 100644 --- a/vendor/github.com/slack-go/slack/block_input.go +++ b/vendor/github.com/slack-go/slack/block_input.go @@ -19,11 +19,12 @@ func (s InputBlock) BlockType() MessageBlockType { } // NewInputBlock returns a new instance of an input block -func NewInputBlock(blockID string, label *TextBlockObject, element BlockElement) *InputBlock { +func NewInputBlock(blockID string, label, hint *TextBlockObject, element BlockElement) *InputBlock { return &InputBlock{ Type: MBTInput, BlockID: blockID, Label: label, Element: element, + Hint: hint, } } diff --git a/vendor/github.com/slack-go/slack/bookmarks.go b/vendor/github.com/slack-go/slack/bookmarks.go new file mode 100644 index 00000000..78753507 --- /dev/null +++ b/vendor/github.com/slack-go/slack/bookmarks.go @@ -0,0 +1,159 @@ +package slack + +import ( + "context" + "net/url" +) + +type Bookmark struct { + ID string `json:"id"` + ChannelID string `json:"channel_id"` + Title string `json:"title"` + Link string `json:"link"` + Emoji string `json:"emoji"` + IconURL string `json:"icon_url"` + Type string `json:"type"` + Created JSONTime `json:"date_created"` + Updated JSONTime `json:"date_updated"` + Rank string `json:"rank"` + + LastUpdatedByUserID string `json:"last_updated_by_user_id"` + LastUpdatedByTeamID string `json:"last_updated_by_team_id"` + + ShortcutID string `json:"shortcut_id"` + EntityID string `json:"entity_id"` + AppID string `json:"app_id"` +} + +type AddBookmarkParameters struct { + Title string // A required title for the bookmark + Type string // A required type for the bookmark + Link string // URL required for type:link + Emoji string // An optional emoji + EntityID string + ParentID string +} + +type EditBookmarkParameters struct { + Title *string // Change the title. Set to "" to clear + Emoji *string // Change the emoji. Set to "" to clear + Link string // Change the link +} + +type addBookmarkResponse struct { + Bookmark Bookmark `json:"bookmark"` + SlackResponse +} + +type editBookmarkResponse struct { + Bookmark Bookmark `json:"bookmark"` + SlackResponse +} + +type listBookmarksResponse struct { + Bookmarks []Bookmark `json:"bookmarks"` + SlackResponse +} + +// AddBookmark adds a bookmark in a channel +func (api *Client) AddBookmark(channelID string, params AddBookmarkParameters) (Bookmark, error) { + return api.AddBookmarkContext(context.Background(), channelID, params) +} + +// AddBookmarkContext adds a bookmark in a channel with a custom context +func (api *Client) AddBookmarkContext(ctx context.Context, channelID string, params AddBookmarkParameters) (Bookmark, error) { + values := url.Values{ + "channel_id": {channelID}, + "token": {api.token}, + "title": {params.Title}, + "type": {params.Type}, + } + if params.Link != "" { + values.Set("link", params.Link) + } + if params.Emoji != "" { + values.Set("emoji", params.Emoji) + } + if params.EntityID != "" { + values.Set("entity_id", params.EntityID) + } + if params.ParentID != "" { + values.Set("parent_id", params.ParentID) + } + + response := &addBookmarkResponse{} + if err := api.postMethod(ctx, "bookmarks.add", values, response); err != nil { + return Bookmark{}, err + } + + return response.Bookmark, response.Err() +} + +// RemoveBookmark removes a bookmark from a channel +func (api *Client) RemoveBookmark(channelID, bookmarkID string) error { + return api.RemoveBookmarkContext(context.Background(), channelID, bookmarkID) +} + +// RemoveBookmarkContext removes a bookmark from a channel with a custom context +func (api *Client) RemoveBookmarkContext(ctx context.Context, channelID, bookmarkID string) error { + values := url.Values{ + "channel_id": {channelID}, + "token": {api.token}, + "bookmark_id": {bookmarkID}, + } + + response := &SlackResponse{} + if err := api.postMethod(ctx, "bookmarks.remove", values, response); err != nil { + return err + } + + return response.Err() +} + +// ListBookmarks returns all bookmarks for a channel. +func (api *Client) ListBookmarks(channelID string) ([]Bookmark, error) { + return api.ListBookmarksContext(context.Background(), channelID) +} + +// ListBookmarksContext returns all bookmarks for a channel with a custom context. +func (api *Client) ListBookmarksContext(ctx context.Context, channelID string) ([]Bookmark, error) { + values := url.Values{ + "channel_id": {channelID}, + "token": {api.token}, + } + + response := &listBookmarksResponse{} + err := api.postMethod(ctx, "bookmarks.list", values, response) + if err != nil { + return nil, err + } + return response.Bookmarks, response.Err() +} + +func (api *Client) EditBookmark(channelID, bookmarkID string, params EditBookmarkParameters) (Bookmark, error) { + return api.EditBookmarkContext(context.Background(), channelID, bookmarkID, params) +} + +func (api *Client) EditBookmarkContext(ctx context.Context, channelID, bookmarkID string, params EditBookmarkParameters) (Bookmark, error) { + values := url.Values{ + "channel_id": {channelID}, + "token": {api.token}, + "bookmark_id": {bookmarkID}, + } + if params.Link != "" { + values.Set("link", params.Link) + } + if params.Emoji != nil { + values.Set("emoji", *params.Emoji) + } + if params.Title != nil { + values.Set("title", *params.Title) + } + + response := &editBookmarkResponse{} + if err := api.postMethod(ctx, "bookmarks.edit", values, response); err != nil { + return Bookmark{}, err + } + + return response.Bookmark, response.Err() +} diff --git a/vendor/github.com/slack-go/slack/internal/misc/misc.go b/vendor/github.com/slack-go/slack/internal/misc/misc.go deleted file mode 100644 index eab8cdd8..00000000 --- a/vendor/github.com/slack-go/slack/internal/misc/misc.go +++ /dev/null @@ -1,28 +0,0 @@ -package misc - -import ( - "fmt" - "net/http" -) - -// StatusCodeError represents an http response error. -// type httpStatusCode interface { HTTPStatusCode() int } to handle it. -type StatusCodeError struct { - Code int - Status string -} - -func (t StatusCodeError) Error() string { - return fmt.Sprintf("slack server error: %s", t.Status) -} - -func (t StatusCodeError) HTTPStatusCode() int { - return t.Code -} - -func (t StatusCodeError) Retryable() bool { - if t.Code >= 500 || t.Code == http.StatusTooManyRequests { - return true - } - return false -} diff --git a/vendor/github.com/slack-go/slack/misc.go b/vendor/github.com/slack-go/slack/misc.go index 804724d7..bb99f2c4 100644 --- a/vendor/github.com/slack-go/slack/misc.go +++ b/vendor/github.com/slack-go/slack/misc.go @@ -18,8 +18,6 @@ import ( "strconv" "strings" "time" - - "github.com/slack-go/slack/internal/misc" ) // SlackResponse handles parsing out errors from the web api. @@ -299,7 +297,7 @@ func checkStatusCode(resp *http.Response, d Debug) error { // Slack seems to send an HTML body along with 5xx error codes. Don't parse it. if resp.StatusCode != http.StatusOK { logResponse(resp, d) - return misc.StatusCodeError{Code: resp.StatusCode, Status: resp.Status} + return StatusCodeError{Code: resp.StatusCode, Status: resp.Status} } return nil diff --git a/vendor/github.com/slack-go/slack/remotefiles.go b/vendor/github.com/slack-go/slack/remotefiles.go new file mode 100644 index 00000000..8a908a8f --- /dev/null +++ b/vendor/github.com/slack-go/slack/remotefiles.go @@ -0,0 +1,316 @@ +package slack + +import ( + "context" + "fmt" + "io" + "net/url" + "strconv" + "strings" +) + +const ( + DEFAULT_REMOTE_FILES_CHANNEL = "" + DEFAULT_REMOTE_FILES_TS_FROM = 0 + DEFAULT_REMOTE_FILES_TS_TO = -1 + DEFAULT_REMOTE_FILES_COUNT = 100 +) + +// RemoteFile contains all the information for a remote file +// For more details: +// https://api.slack.com/messaging/files/remote +type RemoteFile struct { + ID string `json:"id"` + Created JSONTime `json:"created"` + Timestamp JSONTime `json:"timestamp"` + Name string `json:"name"` + Title string `json:"title"` + Mimetype string `json:"mimetype"` + Filetype string `json:"filetype"` + PrettyType string `json:"pretty_type"` + User string `json:"user"` + Editable bool `json:"editable"` + Size int `json:"size"` + Mode string `json:"mode"` + IsExternal bool `json:"is_external"` + ExternalType string `json:"external_type"` + IsPublic bool `json:"is_public"` + PublicURLShared bool `json:"public_url_shared"` + DisplayAsBot bool `json:"display_as_bot"` + Username string `json:"username"` + URLPrivate string `json:"url_private"` + Permalink string `json:"permalink"` + CommentsCount int `json:"comments_count"` + IsStarred bool `json:"is_starred"` + Shares Share `json:"shares"` + Channels []string `json:"channels"` + Groups []string `json:"groups"` + IMs []string `json:"ims"` + ExternalID string `json:"external_id"` + ExternalURL string `json:"external_url"` + HasRichPreview bool `json:"has_rich_preview"` +} + +// RemoteFileParameters contains required and optional parameters for a remote file. +// +// ExternalID is a user defined GUID, ExternalURL is where the remote file can be accessed, +// and Title is the name of the file. +// +// For more details: +// https://api.slack.com/methods/files.remote.add +type RemoteFileParameters struct { + ExternalID string // required + ExternalURL string // required + Title string // required + Filetype string + IndexableFileContents string + PreviewImage string + PreviewImageReader io.Reader +} + +// ListRemoteFilesParameters contains arguments for the ListRemoteFiles method. +// For more details: +// https://api.slack.com/methods/files.remote.list +type ListRemoteFilesParameters struct { + Channel string + Cursor string + Limit int + TimestampFrom JSONTime + TimestampTo JSONTime +} + +type remoteFileResponseFull struct { + RemoteFile `json:"file"` + Paging `json:"paging"` + Files []RemoteFile `json:"files"` + SlackResponse +} + +func (api *Client) remoteFileRequest(ctx context.Context, path string, values url.Values) (*remoteFileResponseFull, error) { + response := &remoteFileResponseFull{} + err := api.postMethod(ctx, path, values, response) + if err != nil { + return nil, err + } + + return response, response.Err() +} + +// AddRemoteFile adds a remote file. Unlike regular files, remote files must be explicitly shared. +// For more details: +// https://api.slack.com/methods/files.remote.add +func (api *Client) AddRemoteFile(params RemoteFileParameters) (*RemoteFile, error) { + return api.AddRemoteFileContext(context.Background(), params) +} + +// AddRemoteFileContext adds a remote file and setting a custom context +// For more details see the AddRemoteFile documentation. +func (api *Client) AddRemoteFileContext(ctx context.Context, params RemoteFileParameters) (remotefile *RemoteFile, err error) { + if params.ExternalID == "" || params.ExternalURL == "" || params.Title == "" { + return nil, ErrParametersMissing + } + response := &remoteFileResponseFull{} + values := url.Values{ + "token": {api.token}, + "external_id": {params.ExternalID}, + "external_url": {params.ExternalURL}, + "title": {params.Title}, + } + if params.Filetype != "" { + values.Add("filetype", params.Filetype) + } + if params.IndexableFileContents != "" { + values.Add("indexable_file_contents", params.IndexableFileContents) + } + if params.PreviewImage != "" { + err = postLocalWithMultipartResponse(ctx, api.httpclient, api.endpoint+"files.remote.add", params.PreviewImage, "preview_image", api.token, values, response, api) + } else if params.PreviewImageReader != nil { + err = postWithMultipartResponse(ctx, api.httpclient, api.endpoint+"files.remote.add", "preview.png", "preview_image", api.token, values, params.PreviewImageReader, response, api) + } else { + response, err = api.remoteFileRequest(ctx, "files.remote.add", values) + } + + if err != nil { + return nil, err + } + + return &response.RemoteFile, response.Err() +} + +// ListRemoteFiles retrieves all remote files according to the parameters given. Uses cursor based pagination. +// For more details: +// https://api.slack.com/methods/files.remote.list +func (api *Client) ListRemoteFiles(params ListRemoteFilesParameters) ([]RemoteFile, error) { + return api.ListRemoteFilesContext(context.Background(), params) +} + +// ListRemoteFilesContext retrieves all remote files according to the parameters given with a custom context. Uses cursor based pagination. +// For more details see the ListRemoteFiles documentation. +func (api *Client) ListRemoteFilesContext(ctx context.Context, params ListRemoteFilesParameters) ([]RemoteFile, error) { + values := url.Values{ + "token": {api.token}, + } + if params.Channel != DEFAULT_REMOTE_FILES_CHANNEL { + values.Add("channel", params.Channel) + } + if params.TimestampFrom != DEFAULT_REMOTE_FILES_TS_FROM { + values.Add("ts_from", strconv.FormatInt(int64(params.TimestampFrom), 10)) + } + if params.TimestampTo != DEFAULT_REMOTE_FILES_TS_TO { + values.Add("ts_to", strconv.FormatInt(int64(params.TimestampTo), 10)) + } + if params.Limit != DEFAULT_REMOTE_FILES_COUNT { + values.Add("limit", strconv.Itoa(params.Limit)) + } + if params.Cursor != "" { + values.Add("cursor", params.Cursor) + } + + response, err := api.remoteFileRequest(ctx, "files.remote.list", values) + if err != nil { + return nil, err + } + + params.Cursor = response.SlackResponse.ResponseMetadata.Cursor + + return response.Files, nil +} + +// GetRemoteFileInfo retrieves the complete remote file information. +// For more details: +// https://api.slack.com/methods/files.remote.info +func (api *Client) GetRemoteFileInfo(externalID, fileID string) (remotefile *RemoteFile, err error) { + return api.GetRemoteFileInfoContext(context.Background(), externalID, fileID) +} + +// GetRemoteFileInfoContext retrieves the complete remote file information given with a custom context. +// For more details see the GetRemoteFileInfo documentation. +func (api *Client) GetRemoteFileInfoContext(ctx context.Context, externalID, fileID string) (remotefile *RemoteFile, err error) { + if fileID == "" && externalID == "" { + return nil, fmt.Errorf("either externalID or fileID is required") + } + if fileID != "" && externalID != "" { + return nil, fmt.Errorf("don't provide both externalID and fileID") + } + values := url.Values{ + "token": {api.token}, + } + if fileID != "" { + values.Add("file", fileID) + } + if externalID != "" { + values.Add("external_id", externalID) + } + response, err := api.remoteFileRequest(ctx, "files.remote.info", values) + if err != nil { + return nil, err + } + return &response.RemoteFile, err +} + +// ShareRemoteFile shares a remote file to channels +// For more details: +// https://api.slack.com/methods/files.remote.share +func (api *Client) ShareRemoteFile(channels []string, externalID, fileID string) (file *RemoteFile, err error) { + return api.ShareRemoteFileContext(context.Background(), channels, externalID, fileID) +} + +// ShareRemoteFileContext shares a remote file to channels with a custom context. +// For more details see the ShareRemoteFile documentation. +func (api *Client) ShareRemoteFileContext(ctx context.Context, channels []string, externalID, fileID string) (file *RemoteFile, err error) { + if channels == nil || len(channels) == 0 { + return nil, ErrParametersMissing + } + if fileID == "" && externalID == "" { + return nil, fmt.Errorf("either externalID or fileID is required") + } + values := url.Values{ + "token": {api.token}, + "channels": {strings.Join(channels, ",")}, + } + if fileID != "" { + values.Add("file", fileID) + } + if externalID != "" { + values.Add("external_id", externalID) + } + response, err := api.remoteFileRequest(ctx, "files.remote.share", values) + if err != nil { + return nil, err + } + return &response.RemoteFile, err +} + +// UpdateRemoteFile updates a remote file +// For more details: +// https://api.slack.com/methods/files.remote.update +func (api *Client) UpdateRemoteFile(fileID string, params RemoteFileParameters) (remotefile *RemoteFile, err error) { + return api.UpdateRemoteFileContext(context.Background(), fileID, params) +} + +// UpdateRemoteFileContext updates a remote file with a custom context +// For more details see the UpdateRemoteFile documentation. +func (api *Client) UpdateRemoteFileContext(ctx context.Context, fileID string, params RemoteFileParameters) (remotefile *RemoteFile, err error) { + response := &remoteFileResponseFull{} + values := url.Values{ + "token": {api.token}, + } + if fileID != "" { + values.Add("file", fileID) + } + if params.ExternalID != "" { + values.Add("external_id", params.ExternalID) + } + if params.ExternalURL != "" { + values.Add("external_url", params.ExternalURL) + } + if params.Title != "" { + values.Add("title", params.Title) + } + if params.Filetype != "" { + values.Add("filetype", params.Filetype) + } + if params.IndexableFileContents != "" { + values.Add("indexable_file_contents", params.IndexableFileContents) + } + if params.PreviewImageReader != nil { + err = postWithMultipartResponse(ctx, api.httpclient, api.endpoint+"files.remote.update", "preview.png", "preview_image", api.token, values, params.PreviewImageReader, response, api) + } else { + response, err = api.remoteFileRequest(ctx, "files.remote.update", values) + } + + if err != nil { + return nil, err + } + + return &response.RemoteFile, response.Err() +} + +// RemoveRemoteFile removes a remote file. +// For more details: +// https://api.slack.com/methods/files.remote.remove +func (api *Client) RemoveRemoteFile(externalID, fileID string) (err error) { + return api.RemoveRemoteFileContext(context.Background(), externalID, fileID) +} + +// RemoveRemoteFileContext removes a remote file with a custom context +// For more information see the RemoveRemoteFiles documentation. +func (api *Client) RemoveRemoteFileContext(ctx context.Context, externalID, fileID string) (err error) { + if fileID == "" && externalID == "" { + return fmt.Errorf("either externalID or fileID is required") + } + if fileID != "" && externalID != "" { + return fmt.Errorf("don't provide both externalID and fileID") + } + values := url.Values{ + "token": {api.token}, + } + if fileID != "" { + values.Add("file", fileID) + } + if externalID != "" { + values.Add("external_id", externalID) + } + _, err = api.remoteFileRequest(ctx, "files.remote.remove", values) + return err +} diff --git a/vendor/github.com/slack-go/slack/status_code_error.go b/vendor/github.com/slack-go/slack/status_code_error.go new file mode 100644 index 00000000..7347137a --- /dev/null +++ b/vendor/github.com/slack-go/slack/status_code_error.go @@ -0,0 +1,28 @@ +package slack + +import ( + "fmt" + "net/http" +) + +// StatusCodeError represents an http response error. +// type httpStatusCode interface { HTTPStatusCode() int } to handle it. +type StatusCodeError struct { + Code int + Status string +} + +func (t StatusCodeError) Error() string { + return fmt.Sprintf("slack server error: %s", t.Status) +} + +func (t StatusCodeError) HTTPStatusCode() int { + return t.Code +} + +func (t StatusCodeError) Retryable() bool { + if t.Code >= 500 || t.Code == http.StatusTooManyRequests { + return true + } + return false +} diff --git a/vendor/github.com/slack-go/slack/views.go b/vendor/github.com/slack-go/slack/views.go index a3a1bd05..e6a96178 100644 --- a/vendor/github.com/slack-go/slack/views.go +++ b/vendor/github.com/slack-go/slack/views.go @@ -18,24 +18,25 @@ type ViewState struct { type View struct { SlackResponse - ID string `json:"id"` - TeamID string `json:"team_id"` - Type ViewType `json:"type"` - Title *TextBlockObject `json:"title"` - Close *TextBlockObject `json:"close"` - Submit *TextBlockObject `json:"submit"` - Blocks Blocks `json:"blocks"` - PrivateMetadata string `json:"private_metadata"` - CallbackID string `json:"callback_id"` - State *ViewState `json:"state"` - Hash string `json:"hash"` - ClearOnClose bool `json:"clear_on_close"` - NotifyOnClose bool `json:"notify_on_close"` - RootViewID string `json:"root_view_id"` - PreviousViewID string `json:"previous_view_id"` - AppID string `json:"app_id"` - ExternalID string `json:"external_id"` - BotID string `json:"bot_id"` + ID string `json:"id"` + TeamID string `json:"team_id"` + Type ViewType `json:"type"` + Title *TextBlockObject `json:"title"` + Close *TextBlockObject `json:"close"` + Submit *TextBlockObject `json:"submit"` + Blocks Blocks `json:"blocks"` + PrivateMetadata string `json:"private_metadata"` + CallbackID string `json:"callback_id"` + State *ViewState `json:"state"` + Hash string `json:"hash"` + ClearOnClose bool `json:"clear_on_close"` + NotifyOnClose bool `json:"notify_on_close"` + RootViewID string `json:"root_view_id"` + PreviousViewID string `json:"previous_view_id"` + AppID string `json:"app_id"` + ExternalID string `json:"external_id"` + BotID string `json:"bot_id"` + AppInstalledTeamID string `json:"app_installed_team_id"` } type ViewSubmissionCallbackResponseURL struct { diff --git a/vendor/github.com/slack-go/slack/webhooks.go b/vendor/github.com/slack-go/slack/webhooks.go index 15097f03..2f8fb47f 100644 --- a/vendor/github.com/slack-go/slack/webhooks.go +++ b/vendor/github.com/slack-go/slack/webhooks.go @@ -5,6 +5,8 @@ import ( "context" "encoding/json" "fmt" + "io" + "io/ioutil" "net/http" ) @@ -21,6 +23,7 @@ type WebhookMessage struct { ResponseType string `json:"response_type,omitempty"` ReplaceOriginal bool `json:"replace_original,omitempty"` DeleteOriginal bool `json:"delete_original,omitempty"` + ReplyBroadcast bool `json:"reply_broadcast,omitempty"` } func PostWebhook(url string, msg *WebhookMessage) error { @@ -51,7 +54,10 @@ func PostWebhookCustomHTTPContext(ctx context.Context, url string, httpClient *h if err != nil { return fmt.Errorf("failed to post webhook: %w", err) } - defer resp.Body.Close() + defer func() { + io.Copy(ioutil.Discard, resp.Body) + resp.Body.Close() + }() return checkStatusCode(resp, discard{}) } diff --git a/vendor/github.com/slack-go/slack/websocket_managed_conn.go b/vendor/github.com/slack-go/slack/websocket_managed_conn.go index 92536171..14dea219 100644 --- a/vendor/github.com/slack-go/slack/websocket_managed_conn.go +++ b/vendor/github.com/slack-go/slack/websocket_managed_conn.go @@ -13,7 +13,6 @@ import ( "github.com/slack-go/slack/internal/backoff" "github.com/slack-go/slack/internal/errorsx" - "github.com/slack-go/slack/internal/misc" "github.com/slack-go/slack/internal/timex" ) @@ -127,7 +126,7 @@ func (rtm *RTM) connect(connectionCount int, useRTMStart bool) (*Info, *websocke } switch actual := err.(type) { - case misc.StatusCodeError: + case StatusCodeError: if actual.Code == http.StatusNotFound { rtm.Debugf("invalid auth when connecting with RTM: %s", err) rtm.IncomingEvents <- RTMEvent{"invalid_auth", &InvalidAuthEvent{}} @@ -475,7 +474,7 @@ func (rtm *RTM) handleEvent(typeStr string, event json.RawMessage) { v, exists := EventMapping[typeStr] if !exists { rtm.Debugf("RTM Error - received unmapped event %q: %s\n", typeStr, string(event)) - err := fmt.Errorf("RTM Error: Received unmapped event %q: %s", typeStr, string(event)) + err := fmt.Errorf("RTM Error: Received unmapped event %q", typeStr) rtm.IncomingEvents <- RTMEvent{"unmarshalling_error", &UnmarshallingErrorEvent{err}} return } @@ -484,7 +483,7 @@ func (rtm *RTM) handleEvent(typeStr string, event json.RawMessage) { err := json.Unmarshal(event, recvEvent) if err != nil { rtm.Debugf("RTM Error, could not unmarshall event %q: %s\n", typeStr, string(event)) - err := fmt.Errorf("RTM Error: Could not unmarshall event %q: %s", typeStr, string(event)) + err := fmt.Errorf("RTM Error: Could not unmarshall event %q", typeStr) rtm.IncomingEvents <- RTMEvent{"unmarshalling_error", &UnmarshallingErrorEvent{err}} return } diff --git a/vendor/github.com/slack-go/slack/websocket_subteam.go b/vendor/github.com/slack-go/slack/websocket_subteam.go index a23b274c..2f618733 100644 --- a/vendor/github.com/slack-go/slack/websocket_subteam.go +++ b/vendor/github.com/slack-go/slack/websocket_subteam.go @@ -14,9 +14,9 @@ type SubteamMembersChangedEvent struct { DatePreviousUpdate JSONTime `json:"date_previous_update"` DateUpdate JSONTime `json:"date_update"` AddedUsers []string `json:"added_users"` - AddedUsersCount string `json:"added_users_count"` + AddedUsersCount int `json:"added_users_count"` RemovedUsers []string `json:"removed_users"` - RemovedUsersCount string `json:"removed_users_count"` + RemovedUsersCount int `json:"removed_users_count"` } // SubteamSelfAddedEvent represents an event of you have been added to a User Group diff --git a/vendor/github.com/stretchr/testify/assert/assertion_compare_can_convert.go b/vendor/github.com/stretchr/testify/assert/assertion_compare_can_convert.go index df22c47f..da867903 100644 --- a/vendor/github.com/stretchr/testify/assert/assertion_compare_can_convert.go +++ b/vendor/github.com/stretchr/testify/assert/assertion_compare_can_convert.go @@ -9,7 +9,7 @@ package assert import "reflect" -// Wrapper around reflect.Value.CanConvert, for compatability +// Wrapper around reflect.Value.CanConvert, for compatibility // reasons. func canConvert(value reflect.Value, to reflect.Type) bool { return value.CanConvert(to) diff --git a/vendor/github.com/stretchr/testify/suite/suite.go b/vendor/github.com/stretchr/testify/suite/suite.go index b9b5d1c5..1c402e8d 100644 --- a/vendor/github.com/stretchr/testify/suite/suite.go +++ b/vendor/github.com/stretchr/testify/suite/suite.go @@ -7,6 +7,7 @@ import ( "reflect" "regexp" "runtime/debug" + "sync" "testing" "time" @@ -21,17 +22,22 @@ var matchMethod = flag.String("testify.m", "", "regular expression to select tes // retrieving the current *testing.T context. type Suite struct { *assert.Assertions + mu sync.RWMutex require *require.Assertions t *testing.T } // T retrieves the current *testing.T context. func (suite *Suite) T() *testing.T { + suite.mu.RLock() + defer suite.mu.RUnlock() return suite.t } // SetT sets the current *testing.T context. func (suite *Suite) SetT(t *testing.T) { + suite.mu.Lock() + defer suite.mu.Unlock() suite.t = t suite.Assertions = assert.New(t) suite.require = require.New(t) @@ -39,6 +45,8 @@ func (suite *Suite) SetT(t *testing.T) { // Require returns a require context for suite. func (suite *Suite) Require() *require.Assertions { + suite.mu.Lock() + defer suite.mu.Unlock() if suite.require == nil { suite.require = require.New(suite.T()) } @@ -51,6 +59,8 @@ func (suite *Suite) Require() *require.Assertions { // assert.Assertions with require.Assertions), this method is provided so you // can call `suite.Assert().NoError()`. func (suite *Suite) Assert() *assert.Assertions { + suite.mu.Lock() + defer suite.mu.Unlock() if suite.Assertions == nil { suite.Assertions = assert.New(suite.T()) } diff --git a/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.go b/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.go index 5b91ccbc..62088933 100644 --- a/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.go +++ b/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.go @@ -22,6 +22,65 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type KeepType int32 + +const ( + KeepType_UNKNOWN KeepType = 0 + KeepType_KEEP_FOR_ALL KeepType = 1 + KeepType_UNDO_KEEP_FOR_ALL KeepType = 2 +) + +// Enum value maps for KeepType. +var ( + KeepType_name = map[int32]string{ + 0: "UNKNOWN", + 1: "KEEP_FOR_ALL", + 2: "UNDO_KEEP_FOR_ALL", + } + KeepType_value = map[string]int32{ + "UNKNOWN": 0, + "KEEP_FOR_ALL": 1, + "UNDO_KEEP_FOR_ALL": 2, + } +) + +func (x KeepType) Enum() *KeepType { + p := new(KeepType) + *p = x + return p +} + +func (x KeepType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (KeepType) Descriptor() protoreflect.EnumDescriptor { + return file_binary_proto_def_proto_enumTypes[0].Descriptor() +} + +func (KeepType) Type() protoreflect.EnumType { + return &file_binary_proto_def_proto_enumTypes[0] +} + +func (x KeepType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *KeepType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = KeepType(num) + return nil +} + +// Deprecated: Use KeepType.Descriptor instead. +func (KeepType) EnumDescriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{0} +} + type MediaVisibility int32 const ( @@ -55,11 +114,11 @@ func (x MediaVisibility) String() string { } func (MediaVisibility) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[0].Descriptor() + return file_binary_proto_def_proto_enumTypes[1].Descriptor() } func (MediaVisibility) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[0] + return &file_binary_proto_def_proto_enumTypes[1] } func (x MediaVisibility) Number() protoreflect.EnumNumber { @@ -78,31 +137,31 @@ func (x *MediaVisibility) UnmarshalJSON(b []byte) error { // Deprecated: Use MediaVisibility.Descriptor instead. func (MediaVisibility) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{1} } -type CompanionProps_CompanionPropsPlatformType int32 +type DeviceProps_DevicePropsPlatformType int32 const ( - CompanionProps_UNKNOWN CompanionProps_CompanionPropsPlatformType = 0 - CompanionProps_CHROME CompanionProps_CompanionPropsPlatformType = 1 - CompanionProps_FIREFOX CompanionProps_CompanionPropsPlatformType = 2 - CompanionProps_IE CompanionProps_CompanionPropsPlatformType = 3 - CompanionProps_OPERA CompanionProps_CompanionPropsPlatformType = 4 - CompanionProps_SAFARI CompanionProps_CompanionPropsPlatformType = 5 - CompanionProps_EDGE CompanionProps_CompanionPropsPlatformType = 6 - CompanionProps_DESKTOP CompanionProps_CompanionPropsPlatformType = 7 - CompanionProps_IPAD CompanionProps_CompanionPropsPlatformType = 8 - CompanionProps_ANDROID_TABLET CompanionProps_CompanionPropsPlatformType = 9 - CompanionProps_OHANA CompanionProps_CompanionPropsPlatformType = 10 - CompanionProps_ALOHA CompanionProps_CompanionPropsPlatformType = 11 - CompanionProps_CATALINA CompanionProps_CompanionPropsPlatformType = 12 - CompanionProps_TCL_TV CompanionProps_CompanionPropsPlatformType = 13 + DeviceProps_UNKNOWN DeviceProps_DevicePropsPlatformType = 0 + DeviceProps_CHROME DeviceProps_DevicePropsPlatformType = 1 + DeviceProps_FIREFOX DeviceProps_DevicePropsPlatformType = 2 + DeviceProps_IE DeviceProps_DevicePropsPlatformType = 3 + DeviceProps_OPERA DeviceProps_DevicePropsPlatformType = 4 + DeviceProps_SAFARI DeviceProps_DevicePropsPlatformType = 5 + DeviceProps_EDGE DeviceProps_DevicePropsPlatformType = 6 + DeviceProps_DESKTOP DeviceProps_DevicePropsPlatformType = 7 + DeviceProps_IPAD DeviceProps_DevicePropsPlatformType = 8 + DeviceProps_ANDROID_TABLET DeviceProps_DevicePropsPlatformType = 9 + DeviceProps_OHANA DeviceProps_DevicePropsPlatformType = 10 + DeviceProps_ALOHA DeviceProps_DevicePropsPlatformType = 11 + DeviceProps_CATALINA DeviceProps_DevicePropsPlatformType = 12 + DeviceProps_TCL_TV DeviceProps_DevicePropsPlatformType = 13 ) -// Enum value maps for CompanionProps_CompanionPropsPlatformType. +// Enum value maps for DeviceProps_DevicePropsPlatformType. var ( - CompanionProps_CompanionPropsPlatformType_name = map[int32]string{ + DeviceProps_DevicePropsPlatformType_name = map[int32]string{ 0: "UNKNOWN", 1: "CHROME", 2: "FIREFOX", @@ -118,7 +177,7 @@ var ( 12: "CATALINA", 13: "TCL_TV", } - CompanionProps_CompanionPropsPlatformType_value = map[string]int32{ + DeviceProps_DevicePropsPlatformType_value = map[string]int32{ "UNKNOWN": 0, "CHROME": 1, "FIREFOX": 2, @@ -136,118 +195,41 @@ var ( } ) -func (x CompanionProps_CompanionPropsPlatformType) Enum() *CompanionProps_CompanionPropsPlatformType { - p := new(CompanionProps_CompanionPropsPlatformType) - *p = x - return p -} - -func (x CompanionProps_CompanionPropsPlatformType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (CompanionProps_CompanionPropsPlatformType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[1].Descriptor() -} - -func (CompanionProps_CompanionPropsPlatformType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[1] -} - -func (x CompanionProps_CompanionPropsPlatformType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *CompanionProps_CompanionPropsPlatformType) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = CompanionProps_CompanionPropsPlatformType(num) - return nil -} - -// Deprecated: Use CompanionProps_CompanionPropsPlatformType.Descriptor instead. -func (CompanionProps_CompanionPropsPlatformType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{5, 0} -} - -type ProtocolMessage_ProtocolMessageType int32 - -const ( - ProtocolMessage_REVOKE ProtocolMessage_ProtocolMessageType = 0 - ProtocolMessage_EPHEMERAL_SETTING ProtocolMessage_ProtocolMessageType = 3 - ProtocolMessage_EPHEMERAL_SYNC_RESPONSE ProtocolMessage_ProtocolMessageType = 4 - ProtocolMessage_HISTORY_SYNC_NOTIFICATION ProtocolMessage_ProtocolMessageType = 5 - ProtocolMessage_APP_STATE_SYNC_KEY_SHARE ProtocolMessage_ProtocolMessageType = 6 - ProtocolMessage_APP_STATE_SYNC_KEY_REQUEST ProtocolMessage_ProtocolMessageType = 7 - ProtocolMessage_MSG_FANOUT_BACKFILL_REQUEST ProtocolMessage_ProtocolMessageType = 8 - ProtocolMessage_INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC ProtocolMessage_ProtocolMessageType = 9 - ProtocolMessage_APP_STATE_FATAL_EXCEPTION_NOTIFICATION ProtocolMessage_ProtocolMessageType = 10 -) - -// Enum value maps for ProtocolMessage_ProtocolMessageType. -var ( - ProtocolMessage_ProtocolMessageType_name = map[int32]string{ - 0: "REVOKE", - 3: "EPHEMERAL_SETTING", - 4: "EPHEMERAL_SYNC_RESPONSE", - 5: "HISTORY_SYNC_NOTIFICATION", - 6: "APP_STATE_SYNC_KEY_SHARE", - 7: "APP_STATE_SYNC_KEY_REQUEST", - 8: "MSG_FANOUT_BACKFILL_REQUEST", - 9: "INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC", - 10: "APP_STATE_FATAL_EXCEPTION_NOTIFICATION", - } - ProtocolMessage_ProtocolMessageType_value = map[string]int32{ - "REVOKE": 0, - "EPHEMERAL_SETTING": 3, - "EPHEMERAL_SYNC_RESPONSE": 4, - "HISTORY_SYNC_NOTIFICATION": 5, - "APP_STATE_SYNC_KEY_SHARE": 6, - "APP_STATE_SYNC_KEY_REQUEST": 7, - "MSG_FANOUT_BACKFILL_REQUEST": 8, - "INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC": 9, - "APP_STATE_FATAL_EXCEPTION_NOTIFICATION": 10, - } -) - -func (x ProtocolMessage_ProtocolMessageType) Enum() *ProtocolMessage_ProtocolMessageType { - p := new(ProtocolMessage_ProtocolMessageType) +func (x DeviceProps_DevicePropsPlatformType) Enum() *DeviceProps_DevicePropsPlatformType { + p := new(DeviceProps_DevicePropsPlatformType) *p = x return p } -func (x ProtocolMessage_ProtocolMessageType) String() string { +func (x DeviceProps_DevicePropsPlatformType) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (ProtocolMessage_ProtocolMessageType) Descriptor() protoreflect.EnumDescriptor { +func (DeviceProps_DevicePropsPlatformType) Descriptor() protoreflect.EnumDescriptor { return file_binary_proto_def_proto_enumTypes[2].Descriptor() } -func (ProtocolMessage_ProtocolMessageType) Type() protoreflect.EnumType { +func (DeviceProps_DevicePropsPlatformType) Type() protoreflect.EnumType { return &file_binary_proto_def_proto_enumTypes[2] } -func (x ProtocolMessage_ProtocolMessageType) Number() protoreflect.EnumNumber { +func (x DeviceProps_DevicePropsPlatformType) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. -func (x *ProtocolMessage_ProtocolMessageType) UnmarshalJSON(b []byte) error { +func (x *DeviceProps_DevicePropsPlatformType) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } - *x = ProtocolMessage_ProtocolMessageType(num) + *x = DeviceProps_DevicePropsPlatformType(num) return nil } -// Deprecated: Use ProtocolMessage_ProtocolMessageType.Descriptor instead. -func (ProtocolMessage_ProtocolMessageType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{7, 0} +// Deprecated: Use DeviceProps_DevicePropsPlatformType.Descriptor instead. +func (DeviceProps_DevicePropsPlatformType) EnumDescriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{5, 0} } type PaymentInviteMessage_PaymentInviteMessageServiceType int32 @@ -309,7 +291,7 @@ func (x *PaymentInviteMessage_PaymentInviteMessageServiceType) UnmarshalJSON(b [ // Deprecated: Use PaymentInviteMessage_PaymentInviteMessageServiceType.Descriptor instead. func (PaymentInviteMessage_PaymentInviteMessageServiceType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{16, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{15, 0} } type OrderMessage_OrderMessageOrderStatus int32 @@ -362,7 +344,7 @@ func (x *OrderMessage_OrderMessageOrderStatus) UnmarshalJSON(b []byte) error { // Deprecated: Use OrderMessage_OrderMessageOrderStatus.Descriptor instead. func (OrderMessage_OrderMessageOrderStatus) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{17, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{16, 0} } type OrderMessage_OrderMessageOrderSurface int32 @@ -415,7 +397,7 @@ func (x *OrderMessage_OrderMessageOrderSurface) UnmarshalJSON(b []byte) error { // Deprecated: Use OrderMessage_OrderMessageOrderSurface.Descriptor instead. func (OrderMessage_OrderMessageOrderSurface) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{17, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{16, 1} } type ListResponseMessage_ListResponseMessageListType int32 @@ -471,7 +453,7 @@ func (x *ListResponseMessage_ListResponseMessageListType) UnmarshalJSON(b []byte // Deprecated: Use ListResponseMessage_ListResponseMessageListType.Descriptor instead. func (ListResponseMessage_ListResponseMessageListType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{20, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{19, 0} } type ListMessage_ListMessageListType int32 @@ -530,7 +512,7 @@ func (x *ListMessage_ListMessageListType) UnmarshalJSON(b []byte) error { // Deprecated: Use ListMessage_ListMessageListType.Descriptor instead. func (ListMessage_ListMessageListType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{22, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{21, 0} } type InvoiceMessage_InvoiceMessageAttachmentType int32 @@ -1557,6 +1539,83 @@ func (VideoMessage_VideoMessageAttribution) EnumDescriptor() ([]byte, []int) { return file_binary_proto_def_proto_rawDescGZIP(), []int{96, 0} } +type ProtocolMessage_ProtocolMessageType int32 + +const ( + ProtocolMessage_REVOKE ProtocolMessage_ProtocolMessageType = 0 + ProtocolMessage_EPHEMERAL_SETTING ProtocolMessage_ProtocolMessageType = 3 + ProtocolMessage_EPHEMERAL_SYNC_RESPONSE ProtocolMessage_ProtocolMessageType = 4 + ProtocolMessage_HISTORY_SYNC_NOTIFICATION ProtocolMessage_ProtocolMessageType = 5 + ProtocolMessage_APP_STATE_SYNC_KEY_SHARE ProtocolMessage_ProtocolMessageType = 6 + ProtocolMessage_APP_STATE_SYNC_KEY_REQUEST ProtocolMessage_ProtocolMessageType = 7 + ProtocolMessage_MSG_FANOUT_BACKFILL_REQUEST ProtocolMessage_ProtocolMessageType = 8 + ProtocolMessage_INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC ProtocolMessage_ProtocolMessageType = 9 + ProtocolMessage_APP_STATE_FATAL_EXCEPTION_NOTIFICATION ProtocolMessage_ProtocolMessageType = 10 +) + +// Enum value maps for ProtocolMessage_ProtocolMessageType. +var ( + ProtocolMessage_ProtocolMessageType_name = map[int32]string{ + 0: "REVOKE", + 3: "EPHEMERAL_SETTING", + 4: "EPHEMERAL_SYNC_RESPONSE", + 5: "HISTORY_SYNC_NOTIFICATION", + 6: "APP_STATE_SYNC_KEY_SHARE", + 7: "APP_STATE_SYNC_KEY_REQUEST", + 8: "MSG_FANOUT_BACKFILL_REQUEST", + 9: "INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC", + 10: "APP_STATE_FATAL_EXCEPTION_NOTIFICATION", + } + ProtocolMessage_ProtocolMessageType_value = map[string]int32{ + "REVOKE": 0, + "EPHEMERAL_SETTING": 3, + "EPHEMERAL_SYNC_RESPONSE": 4, + "HISTORY_SYNC_NOTIFICATION": 5, + "APP_STATE_SYNC_KEY_SHARE": 6, + "APP_STATE_SYNC_KEY_REQUEST": 7, + "MSG_FANOUT_BACKFILL_REQUEST": 8, + "INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC": 9, + "APP_STATE_FATAL_EXCEPTION_NOTIFICATION": 10, + } +) + +func (x ProtocolMessage_ProtocolMessageType) Enum() *ProtocolMessage_ProtocolMessageType { + p := new(ProtocolMessage_ProtocolMessageType) + *p = x + return p +} + +func (x ProtocolMessage_ProtocolMessageType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ProtocolMessage_ProtocolMessageType) Descriptor() protoreflect.EnumDescriptor { + return file_binary_proto_def_proto_enumTypes[25].Descriptor() +} + +func (ProtocolMessage_ProtocolMessageType) Type() protoreflect.EnumType { + return &file_binary_proto_def_proto_enumTypes[25] +} + +func (x ProtocolMessage_ProtocolMessageType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *ProtocolMessage_ProtocolMessageType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = ProtocolMessage_ProtocolMessageType(num) + return nil +} + +// Deprecated: Use ProtocolMessage_ProtocolMessageType.Descriptor instead. +func (ProtocolMessage_ProtocolMessageType) EnumDescriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{107, 0} +} + type HistorySync_HistorySyncHistorySyncType int32 const ( @@ -1596,11 +1655,11 @@ func (x HistorySync_HistorySyncHistorySyncType) String() string { } func (HistorySync_HistorySyncHistorySyncType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[25].Descriptor() + return file_binary_proto_def_proto_enumTypes[26].Descriptor() } func (HistorySync_HistorySyncHistorySyncType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[25] + return &file_binary_proto_def_proto_enumTypes[26] } func (x HistorySync_HistorySyncHistorySyncType) Number() protoreflect.EnumNumber { @@ -1619,7 +1678,7 @@ func (x *HistorySync_HistorySyncHistorySyncType) UnmarshalJSON(b []byte) error { // Deprecated: Use HistorySync_HistorySyncHistorySyncType.Descriptor instead. func (HistorySync_HistorySyncHistorySyncType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{110, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{112, 0} } type GroupParticipant_GroupParticipantRank int32 @@ -1655,11 +1714,11 @@ func (x GroupParticipant_GroupParticipantRank) String() string { } func (GroupParticipant_GroupParticipantRank) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[26].Descriptor() + return file_binary_proto_def_proto_enumTypes[27].Descriptor() } func (GroupParticipant_GroupParticipantRank) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[26] + return &file_binary_proto_def_proto_enumTypes[27] } func (x GroupParticipant_GroupParticipantRank) Number() protoreflect.EnumNumber { @@ -1678,7 +1737,7 @@ func (x *GroupParticipant_GroupParticipantRank) UnmarshalJSON(b []byte) error { // Deprecated: Use GroupParticipant_GroupParticipantRank.Descriptor instead. func (GroupParticipant_GroupParticipantRank) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{112, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{114, 0} } type Conversation_ConversationEndOfHistoryTransferType int32 @@ -1711,11 +1770,11 @@ func (x Conversation_ConversationEndOfHistoryTransferType) String() string { } func (Conversation_ConversationEndOfHistoryTransferType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[27].Descriptor() + return file_binary_proto_def_proto_enumTypes[28].Descriptor() } func (Conversation_ConversationEndOfHistoryTransferType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[27] + return &file_binary_proto_def_proto_enumTypes[28] } func (x Conversation_ConversationEndOfHistoryTransferType) Number() protoreflect.EnumNumber { @@ -1734,7 +1793,7 @@ func (x *Conversation_ConversationEndOfHistoryTransferType) UnmarshalJSON(b []by // Deprecated: Use Conversation_ConversationEndOfHistoryTransferType.Descriptor instead. func (Conversation_ConversationEndOfHistoryTransferType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{114, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{116, 0} } type MediaRetryNotification_MediaRetryNotificationResultType int32 @@ -1773,11 +1832,11 @@ func (x MediaRetryNotification_MediaRetryNotificationResultType) String() string } func (MediaRetryNotification_MediaRetryNotificationResultType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[28].Descriptor() + return file_binary_proto_def_proto_enumTypes[29].Descriptor() } func (MediaRetryNotification_MediaRetryNotificationResultType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[28] + return &file_binary_proto_def_proto_enumTypes[29] } func (x MediaRetryNotification_MediaRetryNotificationResultType) Number() protoreflect.EnumNumber { @@ -1796,7 +1855,7 @@ func (x *MediaRetryNotification_MediaRetryNotificationResultType) UnmarshalJSON( // Deprecated: Use MediaRetryNotification_MediaRetryNotificationResultType.Descriptor instead. func (MediaRetryNotification_MediaRetryNotificationResultType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{120, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{122, 0} } type SyncdMutation_SyncdMutationSyncdOperation int32 @@ -1829,11 +1888,11 @@ func (x SyncdMutation_SyncdMutationSyncdOperation) String() string { } func (SyncdMutation_SyncdMutationSyncdOperation) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[29].Descriptor() + return file_binary_proto_def_proto_enumTypes[30].Descriptor() } func (SyncdMutation_SyncdMutationSyncdOperation) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[29] + return &file_binary_proto_def_proto_enumTypes[30] } func (x SyncdMutation_SyncdMutationSyncdOperation) Number() protoreflect.EnumNumber { @@ -1852,7 +1911,7 @@ func (x *SyncdMutation_SyncdMutationSyncdOperation) UnmarshalJSON(b []byte) erro // Deprecated: Use SyncdMutation_SyncdMutationSyncdOperation.Descriptor instead. func (SyncdMutation_SyncdMutationSyncdOperation) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{128, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{130, 0} } type BizIdentityInfo_BizIdentityInfoVerifiedLevelValue int32 @@ -1888,11 +1947,11 @@ func (x BizIdentityInfo_BizIdentityInfoVerifiedLevelValue) String() string { } func (BizIdentityInfo_BizIdentityInfoVerifiedLevelValue) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[30].Descriptor() + return file_binary_proto_def_proto_enumTypes[31].Descriptor() } func (BizIdentityInfo_BizIdentityInfoVerifiedLevelValue) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[30] + return &file_binary_proto_def_proto_enumTypes[31] } func (x BizIdentityInfo_BizIdentityInfoVerifiedLevelValue) Number() protoreflect.EnumNumber { @@ -1911,7 +1970,7 @@ func (x *BizIdentityInfo_BizIdentityInfoVerifiedLevelValue) UnmarshalJSON(b []by // Deprecated: Use BizIdentityInfo_BizIdentityInfoVerifiedLevelValue.Descriptor instead. func (BizIdentityInfo_BizIdentityInfoVerifiedLevelValue) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{169, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{171, 0} } type BizIdentityInfo_BizIdentityInfoHostStorageType int32 @@ -1944,11 +2003,11 @@ func (x BizIdentityInfo_BizIdentityInfoHostStorageType) String() string { } func (BizIdentityInfo_BizIdentityInfoHostStorageType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[31].Descriptor() + return file_binary_proto_def_proto_enumTypes[32].Descriptor() } func (BizIdentityInfo_BizIdentityInfoHostStorageType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[31] + return &file_binary_proto_def_proto_enumTypes[32] } func (x BizIdentityInfo_BizIdentityInfoHostStorageType) Number() protoreflect.EnumNumber { @@ -1967,7 +2026,7 @@ func (x *BizIdentityInfo_BizIdentityInfoHostStorageType) UnmarshalJSON(b []byte) // Deprecated: Use BizIdentityInfo_BizIdentityInfoHostStorageType.Descriptor instead. func (BizIdentityInfo_BizIdentityInfoHostStorageType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{169, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{171, 1} } type BizIdentityInfo_BizIdentityInfoActualActorsType int32 @@ -2000,11 +2059,11 @@ func (x BizIdentityInfo_BizIdentityInfoActualActorsType) String() string { } func (BizIdentityInfo_BizIdentityInfoActualActorsType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[32].Descriptor() + return file_binary_proto_def_proto_enumTypes[33].Descriptor() } func (BizIdentityInfo_BizIdentityInfoActualActorsType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[32] + return &file_binary_proto_def_proto_enumTypes[33] } func (x BizIdentityInfo_BizIdentityInfoActualActorsType) Number() protoreflect.EnumNumber { @@ -2023,7 +2082,7 @@ func (x *BizIdentityInfo_BizIdentityInfoActualActorsType) UnmarshalJSON(b []byte // Deprecated: Use BizIdentityInfo_BizIdentityInfoActualActorsType.Descriptor instead. func (BizIdentityInfo_BizIdentityInfoActualActorsType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{169, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{171, 2} } type BizAccountLinkInfo_BizAccountLinkInfoHostStorageType int32 @@ -2056,11 +2115,11 @@ func (x BizAccountLinkInfo_BizAccountLinkInfoHostStorageType) String() string { } func (BizAccountLinkInfo_BizAccountLinkInfoHostStorageType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[33].Descriptor() + return file_binary_proto_def_proto_enumTypes[34].Descriptor() } func (BizAccountLinkInfo_BizAccountLinkInfoHostStorageType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[33] + return &file_binary_proto_def_proto_enumTypes[34] } func (x BizAccountLinkInfo_BizAccountLinkInfoHostStorageType) Number() protoreflect.EnumNumber { @@ -2079,7 +2138,7 @@ func (x *BizAccountLinkInfo_BizAccountLinkInfoHostStorageType) UnmarshalJSON(b [ // Deprecated: Use BizAccountLinkInfo_BizAccountLinkInfoHostStorageType.Descriptor instead. func (BizAccountLinkInfo_BizAccountLinkInfoHostStorageType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{171, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{173, 0} } type BizAccountLinkInfo_BizAccountLinkInfoAccountType int32 @@ -2109,11 +2168,11 @@ func (x BizAccountLinkInfo_BizAccountLinkInfoAccountType) String() string { } func (BizAccountLinkInfo_BizAccountLinkInfoAccountType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[34].Descriptor() + return file_binary_proto_def_proto_enumTypes[35].Descriptor() } func (BizAccountLinkInfo_BizAccountLinkInfoAccountType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[34] + return &file_binary_proto_def_proto_enumTypes[35] } func (x BizAccountLinkInfo_BizAccountLinkInfoAccountType) Number() protoreflect.EnumNumber { @@ -2132,7 +2191,7 @@ func (x *BizAccountLinkInfo_BizAccountLinkInfoAccountType) UnmarshalJSON(b []byt // Deprecated: Use BizAccountLinkInfo_BizAccountLinkInfoAccountType.Descriptor instead. func (BizAccountLinkInfo_BizAccountLinkInfoAccountType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{171, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{173, 1} } type ClientPayload_ClientPayloadConnectType int32 @@ -2204,11 +2263,11 @@ func (x ClientPayload_ClientPayloadConnectType) String() string { } func (ClientPayload_ClientPayloadConnectType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[35].Descriptor() + return file_binary_proto_def_proto_enumTypes[36].Descriptor() } func (ClientPayload_ClientPayloadConnectType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[35] + return &file_binary_proto_def_proto_enumTypes[36] } func (x ClientPayload_ClientPayloadConnectType) Number() protoreflect.EnumNumber { @@ -2272,11 +2331,11 @@ func (x ClientPayload_ClientPayloadConnectReason) String() string { } func (ClientPayload_ClientPayloadConnectReason) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[36].Descriptor() + return file_binary_proto_def_proto_enumTypes[37].Descriptor() } func (ClientPayload_ClientPayloadConnectReason) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[36] + return &file_binary_proto_def_proto_enumTypes[37] } func (x ClientPayload_ClientPayloadConnectReason) Number() protoreflect.EnumNumber { @@ -2328,11 +2387,11 @@ func (x ClientPayload_ClientPayloadProduct) String() string { } func (ClientPayload_ClientPayloadProduct) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[37].Descriptor() + return file_binary_proto_def_proto_enumTypes[38].Descriptor() } func (ClientPayload_ClientPayloadProduct) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[37] + return &file_binary_proto_def_proto_enumTypes[38] } func (x ClientPayload_ClientPayloadProduct) Number() protoreflect.EnumNumber { @@ -2387,11 +2446,11 @@ func (x ClientPayload_ClientPayloadIOSAppExtension) String() string { } func (ClientPayload_ClientPayloadIOSAppExtension) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[38].Descriptor() + return file_binary_proto_def_proto_enumTypes[39].Descriptor() } func (ClientPayload_ClientPayloadIOSAppExtension) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[38] + return &file_binary_proto_def_proto_enumTypes[39] } func (x ClientPayload_ClientPayloadIOSAppExtension) Number() protoreflect.EnumNumber { @@ -2452,11 +2511,11 @@ func (x WebInfo_WebInfoWebSubPlatform) String() string { } func (WebInfo_WebInfoWebSubPlatform) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[39].Descriptor() + return file_binary_proto_def_proto_enumTypes[40].Descriptor() } func (WebInfo_WebInfoWebSubPlatform) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[39] + return &file_binary_proto_def_proto_enumTypes[40] } func (x WebInfo_WebInfoWebSubPlatform) Number() protoreflect.EnumNumber { @@ -2589,11 +2648,11 @@ func (x UserAgent_UserAgentPlatform) String() string { } func (UserAgent_UserAgentPlatform) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[40].Descriptor() + return file_binary_proto_def_proto_enumTypes[41].Descriptor() } func (UserAgent_UserAgentPlatform) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[40] + return &file_binary_proto_def_proto_enumTypes[41] } func (x UserAgent_UserAgentPlatform) Number() protoreflect.EnumNumber { @@ -2651,11 +2710,11 @@ func (x UserAgent_UserAgentReleaseChannel) String() string { } func (UserAgent_UserAgentReleaseChannel) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[41].Descriptor() + return file_binary_proto_def_proto_enumTypes[42].Descriptor() } func (UserAgent_UserAgentReleaseChannel) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[41] + return &file_binary_proto_def_proto_enumTypes[42] } func (x UserAgent_UserAgentReleaseChannel) Number() protoreflect.EnumNumber { @@ -2716,11 +2775,11 @@ func (x DNSSource_DNSSourceDNSResolutionMethod) String() string { } func (DNSSource_DNSSourceDNSResolutionMethod) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[42].Descriptor() + return file_binary_proto_def_proto_enumTypes[43].Descriptor() } func (DNSSource_DNSSourceDNSResolutionMethod) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[42] + return &file_binary_proto_def_proto_enumTypes[43] } func (x DNSSource_DNSSourceDNSResolutionMethod) Number() protoreflect.EnumNumber { @@ -2784,11 +2843,11 @@ func (x WebMessageInfo_WebMessageInfoStatus) String() string { } func (WebMessageInfo_WebMessageInfoStatus) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[43].Descriptor() + return file_binary_proto_def_proto_enumTypes[44].Descriptor() } func (WebMessageInfo_WebMessageInfoStatus) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[43] + return &file_binary_proto_def_proto_enumTypes[44] } func (x WebMessageInfo_WebMessageInfoStatus) Number() protoreflect.EnumNumber { @@ -2956,6 +3015,7 @@ const ( WebMessageInfo_GROUP_PARTICIPANT_ACCEPT WebMessageInfo_WebMessageInfoStubType = 140 WebMessageInfo_GROUP_PARTICIPANT_LINKED_GROUP_JOIN WebMessageInfo_WebMessageInfoStubType = 141 WebMessageInfo_COMMUNITY_CREATE WebMessageInfo_WebMessageInfoStubType = 142 + WebMessageInfo_EPHEMERAL_KEEP_IN_CHAT WebMessageInfo_WebMessageInfoStubType = 143 ) // Enum value maps for WebMessageInfo_WebMessageInfoStubType. @@ -3104,6 +3164,7 @@ var ( 140: "GROUP_PARTICIPANT_ACCEPT", 141: "GROUP_PARTICIPANT_LINKED_GROUP_JOIN", 142: "COMMUNITY_CREATE", + 143: "EPHEMERAL_KEEP_IN_CHAT", } WebMessageInfo_WebMessageInfoStubType_value = map[string]int32{ "UNKNOWN": 0, @@ -3249,6 +3310,7 @@ var ( "GROUP_PARTICIPANT_ACCEPT": 140, "GROUP_PARTICIPANT_LINKED_GROUP_JOIN": 141, "COMMUNITY_CREATE": 142, + "EPHEMERAL_KEEP_IN_CHAT": 143, } ) @@ -3263,11 +3325,11 @@ func (x WebMessageInfo_WebMessageInfoStubType) String() string { } func (WebMessageInfo_WebMessageInfoStubType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[44].Descriptor() + return file_binary_proto_def_proto_enumTypes[45].Descriptor() } func (WebMessageInfo_WebMessageInfoStubType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[44] + return &file_binary_proto_def_proto_enumTypes[45] } func (x WebMessageInfo_WebMessageInfoStubType) Number() protoreflect.EnumNumber { @@ -3325,11 +3387,11 @@ func (x WebMessageInfo_WebMessageInfoBizPrivacyStatus) String() string { } func (WebMessageInfo_WebMessageInfoBizPrivacyStatus) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[45].Descriptor() + return file_binary_proto_def_proto_enumTypes[46].Descriptor() } func (WebMessageInfo_WebMessageInfoBizPrivacyStatus) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[45] + return &file_binary_proto_def_proto_enumTypes[46] } func (x WebMessageInfo_WebMessageInfoBizPrivacyStatus) Number() protoreflect.EnumNumber { @@ -3387,11 +3449,11 @@ func (x WebFeatures_WebFeaturesFlag) String() string { } func (WebFeatures_WebFeaturesFlag) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[46].Descriptor() + return file_binary_proto_def_proto_enumTypes[47].Descriptor() } func (WebFeatures_WebFeaturesFlag) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[46] + return &file_binary_proto_def_proto_enumTypes[47] } func (x WebFeatures_WebFeaturesFlag) Number() protoreflect.EnumNumber { @@ -3443,11 +3505,11 @@ func (x PaymentInfo_PaymentInfoCurrency) String() string { } func (PaymentInfo_PaymentInfoCurrency) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[47].Descriptor() + return file_binary_proto_def_proto_enumTypes[48].Descriptor() } func (PaymentInfo_PaymentInfoCurrency) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[47] + return &file_binary_proto_def_proto_enumTypes[48] } func (x PaymentInfo_PaymentInfoCurrency) Number() protoreflect.EnumNumber { @@ -3529,11 +3591,11 @@ func (x PaymentInfo_PaymentInfoStatus) String() string { } func (PaymentInfo_PaymentInfoStatus) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[48].Descriptor() + return file_binary_proto_def_proto_enumTypes[49].Descriptor() } func (PaymentInfo_PaymentInfoStatus) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[48] + return &file_binary_proto_def_proto_enumTypes[49] } func (x PaymentInfo_PaymentInfoStatus) Number() protoreflect.EnumNumber { @@ -3675,11 +3737,11 @@ func (x PaymentInfo_PaymentInfoTxnStatus) String() string { } func (PaymentInfo_PaymentInfoTxnStatus) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[49].Descriptor() + return file_binary_proto_def_proto_enumTypes[50].Descriptor() } func (PaymentInfo_PaymentInfoTxnStatus) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[49] + return &file_binary_proto_def_proto_enumTypes[50] } func (x PaymentInfo_PaymentInfoTxnStatus) Number() protoreflect.EnumNumber { @@ -4016,19 +4078,19 @@ func (x *ADVDeviceIdentity) GetKeyIndex() uint32 { return 0 } -type CompanionProps struct { +type DeviceProps struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Os *string `protobuf:"bytes,1,opt,name=os" json:"os,omitempty"` - Version *AppVersion `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` - PlatformType *CompanionProps_CompanionPropsPlatformType `protobuf:"varint,3,opt,name=platformType,enum=proto.CompanionProps_CompanionPropsPlatformType" json:"platformType,omitempty"` - RequireFullSync *bool `protobuf:"varint,4,opt,name=requireFullSync" json:"requireFullSync,omitempty"` + Os *string `protobuf:"bytes,1,opt,name=os" json:"os,omitempty"` + Version *AppVersion `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` + PlatformType *DeviceProps_DevicePropsPlatformType `protobuf:"varint,3,opt,name=platformType,enum=proto.DeviceProps_DevicePropsPlatformType" json:"platformType,omitempty"` + RequireFullSync *bool `protobuf:"varint,4,opt,name=requireFullSync" json:"requireFullSync,omitempty"` } -func (x *CompanionProps) Reset() { - *x = CompanionProps{} +func (x *DeviceProps) Reset() { + *x = DeviceProps{} if protoimpl.UnsafeEnabled { mi := &file_binary_proto_def_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4036,13 +4098,13 @@ func (x *CompanionProps) Reset() { } } -func (x *CompanionProps) String() string { +func (x *DeviceProps) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CompanionProps) ProtoMessage() {} +func (*DeviceProps) ProtoMessage() {} -func (x *CompanionProps) ProtoReflect() protoreflect.Message { +func (x *DeviceProps) ProtoReflect() protoreflect.Message { mi := &file_binary_proto_def_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4054,33 +4116,33 @@ func (x *CompanionProps) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CompanionProps.ProtoReflect.Descriptor instead. -func (*CompanionProps) Descriptor() ([]byte, []int) { +// Deprecated: Use DeviceProps.ProtoReflect.Descriptor instead. +func (*DeviceProps) Descriptor() ([]byte, []int) { return file_binary_proto_def_proto_rawDescGZIP(), []int{5} } -func (x *CompanionProps) GetOs() string { +func (x *DeviceProps) GetOs() string { if x != nil && x.Os != nil { return *x.Os } return "" } -func (x *CompanionProps) GetVersion() *AppVersion { +func (x *DeviceProps) GetVersion() *AppVersion { if x != nil { return x.Version } return nil } -func (x *CompanionProps) GetPlatformType() CompanionProps_CompanionPropsPlatformType { +func (x *DeviceProps) GetPlatformType() DeviceProps_DevicePropsPlatformType { if x != nil && x.PlatformType != nil { return *x.PlatformType } - return CompanionProps_UNKNOWN + return DeviceProps_UNKNOWN } -func (x *CompanionProps) GetRequireFullSync() bool { +func (x *DeviceProps) GetRequireFullSync() bool { if x != nil && x.RequireFullSync != nil { return *x.RequireFullSync } @@ -4166,25 +4228,26 @@ func (x *AppVersion) GetQuinary() uint32 { return 0 } -type ProtocolMessage struct { +type ProductSnapshot struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Key *MessageKey `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` - Type *ProtocolMessage_ProtocolMessageType `protobuf:"varint,2,opt,name=type,enum=proto.ProtocolMessage_ProtocolMessageType" json:"type,omitempty"` - EphemeralExpiration *uint32 `protobuf:"varint,4,opt,name=ephemeralExpiration" json:"ephemeralExpiration,omitempty"` - EphemeralSettingTimestamp *int64 `protobuf:"varint,5,opt,name=ephemeralSettingTimestamp" json:"ephemeralSettingTimestamp,omitempty"` - HistorySyncNotification *HistorySyncNotification `protobuf:"bytes,6,opt,name=historySyncNotification" json:"historySyncNotification,omitempty"` - AppStateSyncKeyShare *AppStateSyncKeyShare `protobuf:"bytes,7,opt,name=appStateSyncKeyShare" json:"appStateSyncKeyShare,omitempty"` - AppStateSyncKeyRequest *AppStateSyncKeyRequest `protobuf:"bytes,8,opt,name=appStateSyncKeyRequest" json:"appStateSyncKeyRequest,omitempty"` - InitialSecurityNotificationSettingSync *InitialSecurityNotificationSettingSync `protobuf:"bytes,9,opt,name=initialSecurityNotificationSettingSync" json:"initialSecurityNotificationSettingSync,omitempty"` - AppStateFatalExceptionNotification *AppStateFatalExceptionNotification `protobuf:"bytes,10,opt,name=appStateFatalExceptionNotification" json:"appStateFatalExceptionNotification,omitempty"` - DisappearingMode *DisappearingMode `protobuf:"bytes,11,opt,name=disappearingMode" json:"disappearingMode,omitempty"` + ProductImage *ImageMessage `protobuf:"bytes,1,opt,name=productImage" json:"productImage,omitempty"` + ProductId *string `protobuf:"bytes,2,opt,name=productId" json:"productId,omitempty"` + Title *string `protobuf:"bytes,3,opt,name=title" json:"title,omitempty"` + Description *string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"` + CurrencyCode *string `protobuf:"bytes,5,opt,name=currencyCode" json:"currencyCode,omitempty"` + PriceAmount1000 *int64 `protobuf:"varint,6,opt,name=priceAmount1000" json:"priceAmount1000,omitempty"` + RetailerId *string `protobuf:"bytes,7,opt,name=retailerId" json:"retailerId,omitempty"` + Url *string `protobuf:"bytes,8,opt,name=url" json:"url,omitempty"` + ProductImageCount *uint32 `protobuf:"varint,9,opt,name=productImageCount" json:"productImageCount,omitempty"` + FirstImageId *string `protobuf:"bytes,11,opt,name=firstImageId" json:"firstImageId,omitempty"` + SalePriceAmount1000 *int64 `protobuf:"varint,12,opt,name=salePriceAmount1000" json:"salePriceAmount1000,omitempty"` } -func (x *ProtocolMessage) Reset() { - *x = ProtocolMessage{} +func (x *ProductSnapshot) Reset() { + *x = ProductSnapshot{} if protoimpl.UnsafeEnabled { mi := &file_binary_proto_def_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4192,13 +4255,13 @@ func (x *ProtocolMessage) Reset() { } } -func (x *ProtocolMessage) String() string { +func (x *ProductSnapshot) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ProtocolMessage) ProtoMessage() {} +func (*ProductSnapshot) ProtoMessage() {} -func (x *ProtocolMessage) ProtoReflect() protoreflect.Message { +func (x *ProductSnapshot) ProtoReflect() protoreflect.Message { mi := &file_binary_proto_def_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4210,96 +4273,100 @@ func (x *ProtocolMessage) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ProtocolMessage.ProtoReflect.Descriptor instead. -func (*ProtocolMessage) Descriptor() ([]byte, []int) { +// Deprecated: Use ProductSnapshot.ProtoReflect.Descriptor instead. +func (*ProductSnapshot) Descriptor() ([]byte, []int) { return file_binary_proto_def_proto_rawDescGZIP(), []int{7} } -func (x *ProtocolMessage) GetKey() *MessageKey { +func (x *ProductSnapshot) GetProductImage() *ImageMessage { if x != nil { - return x.Key + return x.ProductImage } return nil } -func (x *ProtocolMessage) GetType() ProtocolMessage_ProtocolMessageType { - if x != nil && x.Type != nil { - return *x.Type +func (x *ProductSnapshot) GetProductId() string { + if x != nil && x.ProductId != nil { + return *x.ProductId } - return ProtocolMessage_REVOKE + return "" } -func (x *ProtocolMessage) GetEphemeralExpiration() uint32 { - if x != nil && x.EphemeralExpiration != nil { - return *x.EphemeralExpiration +func (x *ProductSnapshot) GetTitle() string { + if x != nil && x.Title != nil { + return *x.Title } - return 0 + return "" } -func (x *ProtocolMessage) GetEphemeralSettingTimestamp() int64 { - if x != nil && x.EphemeralSettingTimestamp != nil { - return *x.EphemeralSettingTimestamp +func (x *ProductSnapshot) GetDescription() string { + if x != nil && x.Description != nil { + return *x.Description } - return 0 + return "" } -func (x *ProtocolMessage) GetHistorySyncNotification() *HistorySyncNotification { - if x != nil { - return x.HistorySyncNotification +func (x *ProductSnapshot) GetCurrencyCode() string { + if x != nil && x.CurrencyCode != nil { + return *x.CurrencyCode } - return nil + return "" } -func (x *ProtocolMessage) GetAppStateSyncKeyShare() *AppStateSyncKeyShare { - if x != nil { - return x.AppStateSyncKeyShare +func (x *ProductSnapshot) GetPriceAmount1000() int64 { + if x != nil && x.PriceAmount1000 != nil { + return *x.PriceAmount1000 } - return nil + return 0 } -func (x *ProtocolMessage) GetAppStateSyncKeyRequest() *AppStateSyncKeyRequest { - if x != nil { - return x.AppStateSyncKeyRequest +func (x *ProductSnapshot) GetRetailerId() string { + if x != nil && x.RetailerId != nil { + return *x.RetailerId } - return nil + return "" } -func (x *ProtocolMessage) GetInitialSecurityNotificationSettingSync() *InitialSecurityNotificationSettingSync { - if x != nil { - return x.InitialSecurityNotificationSettingSync +func (x *ProductSnapshot) GetUrl() string { + if x != nil && x.Url != nil { + return *x.Url } - return nil + return "" } -func (x *ProtocolMessage) GetAppStateFatalExceptionNotification() *AppStateFatalExceptionNotification { - if x != nil { - return x.AppStateFatalExceptionNotification +func (x *ProductSnapshot) GetProductImageCount() uint32 { + if x != nil && x.ProductImageCount != nil { + return *x.ProductImageCount } - return nil + return 0 } -func (x *ProtocolMessage) GetDisappearingMode() *DisappearingMode { - if x != nil { - return x.DisappearingMode +func (x *ProductSnapshot) GetFirstImageId() string { + if x != nil && x.FirstImageId != nil { + return *x.FirstImageId } - return nil + return "" } -type ProductMessage struct { +func (x *ProductSnapshot) GetSalePriceAmount1000() int64 { + if x != nil && x.SalePriceAmount1000 != nil { + return *x.SalePriceAmount1000 + } + return 0 +} + +type CatalogSnapshot struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Product *ProductSnapshot `protobuf:"bytes,1,opt,name=product" json:"product,omitempty"` - BusinessOwnerJid *string `protobuf:"bytes,2,opt,name=businessOwnerJid" json:"businessOwnerJid,omitempty"` - Catalog *CatalogSnapshot `protobuf:"bytes,4,opt,name=catalog" json:"catalog,omitempty"` - Body *string `protobuf:"bytes,5,opt,name=body" json:"body,omitempty"` - Footer *string `protobuf:"bytes,6,opt,name=footer" json:"footer,omitempty"` - ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` + CatalogImage *ImageMessage `protobuf:"bytes,1,opt,name=catalogImage" json:"catalogImage,omitempty"` + Title *string `protobuf:"bytes,2,opt,name=title" json:"title,omitempty"` + Description *string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` } -func (x *ProductMessage) Reset() { - *x = ProductMessage{} +func (x *CatalogSnapshot) Reset() { + *x = CatalogSnapshot{} if protoimpl.UnsafeEnabled { mi := &file_binary_proto_def_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4307,13 +4374,13 @@ func (x *ProductMessage) Reset() { } } -func (x *ProductMessage) String() string { +func (x *CatalogSnapshot) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ProductMessage) ProtoMessage() {} +func (*CatalogSnapshot) ProtoMessage() {} -func (x *ProductMessage) ProtoReflect() protoreflect.Message { +func (x *CatalogSnapshot) ProtoReflect() protoreflect.Message { mi := &file_binary_proto_def_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4325,73 +4392,43 @@ func (x *ProductMessage) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ProductMessage.ProtoReflect.Descriptor instead. -func (*ProductMessage) Descriptor() ([]byte, []int) { +// Deprecated: Use CatalogSnapshot.ProtoReflect.Descriptor instead. +func (*CatalogSnapshot) Descriptor() ([]byte, []int) { return file_binary_proto_def_proto_rawDescGZIP(), []int{8} } -func (x *ProductMessage) GetProduct() *ProductSnapshot { - if x != nil { - return x.Product - } - return nil -} - -func (x *ProductMessage) GetBusinessOwnerJid() string { - if x != nil && x.BusinessOwnerJid != nil { - return *x.BusinessOwnerJid - } - return "" -} - -func (x *ProductMessage) GetCatalog() *CatalogSnapshot { +func (x *CatalogSnapshot) GetCatalogImage() *ImageMessage { if x != nil { - return x.Catalog + return x.CatalogImage } return nil } -func (x *ProductMessage) GetBody() string { - if x != nil && x.Body != nil { - return *x.Body +func (x *CatalogSnapshot) GetTitle() string { + if x != nil && x.Title != nil { + return *x.Title } return "" } -func (x *ProductMessage) GetFooter() string { - if x != nil && x.Footer != nil { - return *x.Footer +func (x *CatalogSnapshot) GetDescription() string { + if x != nil && x.Description != nil { + return *x.Description } return "" } -func (x *ProductMessage) GetContextInfo() *ContextInfo { - if x != nil { - return x.ContextInfo - } - return nil -} - -type ProductSnapshot struct { +type PollVoteMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ProductImage *ImageMessage `protobuf:"bytes,1,opt,name=productImage" json:"productImage,omitempty"` - ProductId *string `protobuf:"bytes,2,opt,name=productId" json:"productId,omitempty"` - Title *string `protobuf:"bytes,3,opt,name=title" json:"title,omitempty"` - Description *string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"` - CurrencyCode *string `protobuf:"bytes,5,opt,name=currencyCode" json:"currencyCode,omitempty"` - PriceAmount1000 *int64 `protobuf:"varint,6,opt,name=priceAmount1000" json:"priceAmount1000,omitempty"` - RetailerId *string `protobuf:"bytes,7,opt,name=retailerId" json:"retailerId,omitempty"` - Url *string `protobuf:"bytes,8,opt,name=url" json:"url,omitempty"` - ProductImageCount *uint32 `protobuf:"varint,9,opt,name=productImageCount" json:"productImageCount,omitempty"` - FirstImageId *string `protobuf:"bytes,11,opt,name=firstImageId" json:"firstImageId,omitempty"` - SalePriceAmount1000 *int64 `protobuf:"varint,12,opt,name=salePriceAmount1000" json:"salePriceAmount1000,omitempty"` + SelectedOptions [][]byte `protobuf:"bytes,1,rep,name=selectedOptions" json:"selectedOptions,omitempty"` + SenderTimestampMs *int64 `protobuf:"varint,2,opt,name=senderTimestampMs" json:"senderTimestampMs,omitempty"` } -func (x *ProductSnapshot) Reset() { - *x = ProductSnapshot{} +func (x *PollVoteMessage) Reset() { + *x = PollVoteMessage{} if protoimpl.UnsafeEnabled { mi := &file_binary_proto_def_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4399,13 +4436,13 @@ func (x *ProductSnapshot) Reset() { } } -func (x *ProductSnapshot) String() string { +func (x *PollVoteMessage) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ProductSnapshot) ProtoMessage() {} +func (*PollVoteMessage) ProtoMessage() {} -func (x *ProductSnapshot) ProtoReflect() protoreflect.Message { +func (x *PollVoteMessage) ProtoReflect() protoreflect.Message { mi := &file_binary_proto_def_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4417,100 +4454,37 @@ func (x *ProductSnapshot) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ProductSnapshot.ProtoReflect.Descriptor instead. -func (*ProductSnapshot) Descriptor() ([]byte, []int) { +// Deprecated: Use PollVoteMessage.ProtoReflect.Descriptor instead. +func (*PollVoteMessage) Descriptor() ([]byte, []int) { return file_binary_proto_def_proto_rawDescGZIP(), []int{9} } -func (x *ProductSnapshot) GetProductImage() *ImageMessage { +func (x *PollVoteMessage) GetSelectedOptions() [][]byte { if x != nil { - return x.ProductImage + return x.SelectedOptions } return nil } -func (x *ProductSnapshot) GetProductId() string { - if x != nil && x.ProductId != nil { - return *x.ProductId - } - return "" -} - -func (x *ProductSnapshot) GetTitle() string { - if x != nil && x.Title != nil { - return *x.Title - } - return "" -} - -func (x *ProductSnapshot) GetDescription() string { - if x != nil && x.Description != nil { - return *x.Description - } - return "" -} - -func (x *ProductSnapshot) GetCurrencyCode() string { - if x != nil && x.CurrencyCode != nil { - return *x.CurrencyCode - } - return "" -} - -func (x *ProductSnapshot) GetPriceAmount1000() int64 { - if x != nil && x.PriceAmount1000 != nil { - return *x.PriceAmount1000 - } - return 0 -} - -func (x *ProductSnapshot) GetRetailerId() string { - if x != nil && x.RetailerId != nil { - return *x.RetailerId - } - return "" -} - -func (x *ProductSnapshot) GetUrl() string { - if x != nil && x.Url != nil { - return *x.Url - } - return "" -} - -func (x *ProductSnapshot) GetProductImageCount() uint32 { - if x != nil && x.ProductImageCount != nil { - return *x.ProductImageCount - } - return 0 -} - -func (x *ProductSnapshot) GetFirstImageId() string { - if x != nil && x.FirstImageId != nil { - return *x.FirstImageId - } - return "" -} - -func (x *ProductSnapshot) GetSalePriceAmount1000() int64 { - if x != nil && x.SalePriceAmount1000 != nil { - return *x.SalePriceAmount1000 +func (x *PollVoteMessage) GetSenderTimestampMs() int64 { + if x != nil && x.SenderTimestampMs != nil { + return *x.SenderTimestampMs } return 0 } -type CatalogSnapshot struct { +type PollUpdateMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - CatalogImage *ImageMessage `protobuf:"bytes,1,opt,name=catalogImage" json:"catalogImage,omitempty"` - Title *string `protobuf:"bytes,2,opt,name=title" json:"title,omitempty"` - Description *string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` + PollCreationMessageKey *MessageKey `protobuf:"bytes,1,opt,name=pollCreationMessageKey" json:"pollCreationMessageKey,omitempty"` + Vote *PollEncValue `protobuf:"bytes,2,opt,name=vote" json:"vote,omitempty"` + Metadata *PollUpdateMessageMetadata `protobuf:"bytes,3,opt,name=metadata" json:"metadata,omitempty"` } -func (x *CatalogSnapshot) Reset() { - *x = CatalogSnapshot{} +func (x *PollUpdateMessage) Reset() { + *x = PollUpdateMessage{} if protoimpl.UnsafeEnabled { mi := &file_binary_proto_def_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4518,13 +4492,13 @@ func (x *CatalogSnapshot) Reset() { } } -func (x *CatalogSnapshot) String() string { +func (x *PollUpdateMessage) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CatalogSnapshot) ProtoMessage() {} +func (*PollUpdateMessage) ProtoMessage() {} -func (x *CatalogSnapshot) ProtoReflect() protoreflect.Message { +func (x *PollUpdateMessage) ProtoReflect() protoreflect.Message { mi := &file_binary_proto_def_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4536,43 +4510,40 @@ func (x *CatalogSnapshot) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CatalogSnapshot.ProtoReflect.Descriptor instead. -func (*CatalogSnapshot) Descriptor() ([]byte, []int) { +// Deprecated: Use PollUpdateMessage.ProtoReflect.Descriptor instead. +func (*PollUpdateMessage) Descriptor() ([]byte, []int) { return file_binary_proto_def_proto_rawDescGZIP(), []int{10} } -func (x *CatalogSnapshot) GetCatalogImage() *ImageMessage { +func (x *PollUpdateMessage) GetPollCreationMessageKey() *MessageKey { if x != nil { - return x.CatalogImage + return x.PollCreationMessageKey } return nil } -func (x *CatalogSnapshot) GetTitle() string { - if x != nil && x.Title != nil { - return *x.Title +func (x *PollUpdateMessage) GetVote() *PollEncValue { + if x != nil { + return x.Vote } - return "" + return nil } -func (x *CatalogSnapshot) GetDescription() string { - if x != nil && x.Description != nil { - return *x.Description +func (x *PollUpdateMessage) GetMetadata() *PollUpdateMessageMetadata { + if x != nil { + return x.Metadata } - return "" + return nil } -type PollVoteMessage struct { +type PollUpdateMessageMetadata struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - SelectedOptions [][]byte `protobuf:"bytes,1,rep,name=selectedOptions" json:"selectedOptions,omitempty"` - SenderTimestampMs *int64 `protobuf:"varint,2,opt,name=senderTimestampMs" json:"senderTimestampMs,omitempty"` } -func (x *PollVoteMessage) Reset() { - *x = PollVoteMessage{} +func (x *PollUpdateMessageMetadata) Reset() { + *x = PollUpdateMessageMetadata{} if protoimpl.UnsafeEnabled { mi := &file_binary_proto_def_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4580,13 +4551,13 @@ func (x *PollVoteMessage) Reset() { } } -func (x *PollVoteMessage) String() string { +func (x *PollUpdateMessageMetadata) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PollVoteMessage) ProtoMessage() {} +func (*PollUpdateMessageMetadata) ProtoMessage() {} -func (x *PollVoteMessage) ProtoReflect() protoreflect.Message { +func (x *PollUpdateMessageMetadata) ProtoReflect() protoreflect.Message { mi := &file_binary_proto_def_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4598,80 +4569,11 @@ func (x *PollVoteMessage) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PollVoteMessage.ProtoReflect.Descriptor instead. -func (*PollVoteMessage) Descriptor() ([]byte, []int) { +// Deprecated: Use PollUpdateMessageMetadata.ProtoReflect.Descriptor instead. +func (*PollUpdateMessageMetadata) Descriptor() ([]byte, []int) { return file_binary_proto_def_proto_rawDescGZIP(), []int{11} } -func (x *PollVoteMessage) GetSelectedOptions() [][]byte { - if x != nil { - return x.SelectedOptions - } - return nil -} - -func (x *PollVoteMessage) GetSenderTimestampMs() int64 { - if x != nil && x.SenderTimestampMs != nil { - return *x.SenderTimestampMs - } - return 0 -} - -type PollUpdateMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PollCreationMessageKey *MessageKey `protobuf:"bytes,1,opt,name=pollCreationMessageKey" json:"pollCreationMessageKey,omitempty"` - Vote *PollEncValue `protobuf:"bytes,2,opt,name=vote" json:"vote,omitempty"` -} - -func (x *PollUpdateMessage) Reset() { - *x = PollUpdateMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PollUpdateMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PollUpdateMessage) ProtoMessage() {} - -func (x *PollUpdateMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PollUpdateMessage.ProtoReflect.Descriptor instead. -func (*PollUpdateMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{12} -} - -func (x *PollUpdateMessage) GetPollCreationMessageKey() *MessageKey { - if x != nil { - return x.PollCreationMessageKey - } - return nil -} - -func (x *PollUpdateMessage) GetVote() *PollEncValue { - if x != nil { - return x.Vote - } - return nil -} - type PollEncValue struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4684,7 +4586,7 @@ type PollEncValue struct { func (x *PollEncValue) Reset() { *x = PollEncValue{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[13] + mi := &file_binary_proto_def_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4697,7 +4599,7 @@ func (x *PollEncValue) String() string { func (*PollEncValue) ProtoMessage() {} func (x *PollEncValue) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[13] + mi := &file_binary_proto_def_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4710,7 +4612,7 @@ func (x *PollEncValue) ProtoReflect() protoreflect.Message { // Deprecated: Use PollEncValue.ProtoReflect.Descriptor instead. func (*PollEncValue) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{13} + return file_binary_proto_def_proto_rawDescGZIP(), []int{12} } func (x *PollEncValue) GetEncPayload() []byte { @@ -4742,7 +4644,7 @@ type PollCreationMessage struct { func (x *PollCreationMessage) Reset() { *x = PollCreationMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[14] + mi := &file_binary_proto_def_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4755,7 +4657,7 @@ func (x *PollCreationMessage) String() string { func (*PollCreationMessage) ProtoMessage() {} func (x *PollCreationMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[14] + mi := &file_binary_proto_def_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4768,7 +4670,7 @@ func (x *PollCreationMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use PollCreationMessage.ProtoReflect.Descriptor instead. func (*PollCreationMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{14} + return file_binary_proto_def_proto_rawDescGZIP(), []int{13} } func (x *PollCreationMessage) GetEncKey() []byte { @@ -4817,7 +4719,7 @@ type Option struct { func (x *Option) Reset() { *x = Option{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[15] + mi := &file_binary_proto_def_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4830,7 +4732,7 @@ func (x *Option) String() string { func (*Option) ProtoMessage() {} func (x *Option) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[15] + mi := &file_binary_proto_def_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4843,7 +4745,7 @@ func (x *Option) ProtoReflect() protoreflect.Message { // Deprecated: Use Option.ProtoReflect.Descriptor instead. func (*Option) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{15} + return file_binary_proto_def_proto_rawDescGZIP(), []int{14} } func (x *Option) GetOptionName() string { @@ -4865,7 +4767,7 @@ type PaymentInviteMessage struct { func (x *PaymentInviteMessage) Reset() { *x = PaymentInviteMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[16] + mi := &file_binary_proto_def_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4878,7 +4780,7 @@ func (x *PaymentInviteMessage) String() string { func (*PaymentInviteMessage) ProtoMessage() {} func (x *PaymentInviteMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[16] + mi := &file_binary_proto_def_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4891,7 +4793,7 @@ func (x *PaymentInviteMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use PaymentInviteMessage.ProtoReflect.Descriptor instead. func (*PaymentInviteMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{16} + return file_binary_proto_def_proto_rawDescGZIP(), []int{15} } func (x *PaymentInviteMessage) GetServiceType() PaymentInviteMessage_PaymentInviteMessageServiceType { @@ -4930,7 +4832,7 @@ type OrderMessage struct { func (x *OrderMessage) Reset() { *x = OrderMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[17] + mi := &file_binary_proto_def_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4943,7 +4845,7 @@ func (x *OrderMessage) String() string { func (*OrderMessage) ProtoMessage() {} func (x *OrderMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[17] + mi := &file_binary_proto_def_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4956,7 +4858,7 @@ func (x *OrderMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use OrderMessage.ProtoReflect.Descriptor instead. func (*OrderMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{17} + return file_binary_proto_def_proto_rawDescGZIP(), []int{16} } func (x *OrderMessage) GetOrderId() string { @@ -5065,7 +4967,7 @@ type LocationMessage struct { func (x *LocationMessage) Reset() { *x = LocationMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[18] + mi := &file_binary_proto_def_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5078,7 +4980,7 @@ func (x *LocationMessage) String() string { func (*LocationMessage) ProtoMessage() {} func (x *LocationMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[18] + mi := &file_binary_proto_def_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5091,7 +4993,7 @@ func (x *LocationMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use LocationMessage.ProtoReflect.Descriptor instead. func (*LocationMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{18} + return file_binary_proto_def_proto_rawDescGZIP(), []int{17} } func (x *LocationMessage) GetDegreesLatitude() float64 { @@ -5198,7 +5100,7 @@ type LiveLocationMessage struct { func (x *LiveLocationMessage) Reset() { *x = LiveLocationMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[19] + mi := &file_binary_proto_def_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5211,7 +5113,7 @@ func (x *LiveLocationMessage) String() string { func (*LiveLocationMessage) ProtoMessage() {} func (x *LiveLocationMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[19] + mi := &file_binary_proto_def_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5224,7 +5126,7 @@ func (x *LiveLocationMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use LiveLocationMessage.ProtoReflect.Descriptor instead. func (*LiveLocationMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{19} + return file_binary_proto_def_proto_rawDescGZIP(), []int{18} } func (x *LiveLocationMessage) GetDegreesLatitude() float64 { @@ -5312,7 +5214,7 @@ type ListResponseMessage struct { func (x *ListResponseMessage) Reset() { *x = ListResponseMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[20] + mi := &file_binary_proto_def_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5325,7 +5227,7 @@ func (x *ListResponseMessage) String() string { func (*ListResponseMessage) ProtoMessage() {} func (x *ListResponseMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[20] + mi := &file_binary_proto_def_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5338,7 +5240,7 @@ func (x *ListResponseMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ListResponseMessage.ProtoReflect.Descriptor instead. func (*ListResponseMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{20} + return file_binary_proto_def_proto_rawDescGZIP(), []int{19} } func (x *ListResponseMessage) GetTitle() string { @@ -5387,7 +5289,7 @@ type SingleSelectReply struct { func (x *SingleSelectReply) Reset() { *x = SingleSelectReply{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[21] + mi := &file_binary_proto_def_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5400,7 +5302,7 @@ func (x *SingleSelectReply) String() string { func (*SingleSelectReply) ProtoMessage() {} func (x *SingleSelectReply) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[21] + mi := &file_binary_proto_def_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5413,7 +5315,7 @@ func (x *SingleSelectReply) ProtoReflect() protoreflect.Message { // Deprecated: Use SingleSelectReply.ProtoReflect.Descriptor instead. func (*SingleSelectReply) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{21} + return file_binary_proto_def_proto_rawDescGZIP(), []int{20} } func (x *SingleSelectReply) GetSelectedRowId() string { @@ -5441,7 +5343,7 @@ type ListMessage struct { func (x *ListMessage) Reset() { *x = ListMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[22] + mi := &file_binary_proto_def_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5454,7 +5356,7 @@ func (x *ListMessage) String() string { func (*ListMessage) ProtoMessage() {} func (x *ListMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[22] + mi := &file_binary_proto_def_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5467,7 +5369,7 @@ func (x *ListMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMessage.ProtoReflect.Descriptor instead. func (*ListMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{22} + return file_binary_proto_def_proto_rawDescGZIP(), []int{21} } func (x *ListMessage) GetTitle() string { @@ -5538,7 +5440,7 @@ type Section struct { func (x *Section) Reset() { *x = Section{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[23] + mi := &file_binary_proto_def_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5551,7 +5453,7 @@ func (x *Section) String() string { func (*Section) ProtoMessage() {} func (x *Section) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[23] + mi := &file_binary_proto_def_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5564,7 +5466,7 @@ func (x *Section) ProtoReflect() protoreflect.Message { // Deprecated: Use Section.ProtoReflect.Descriptor instead. func (*Section) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{23} + return file_binary_proto_def_proto_rawDescGZIP(), []int{22} } func (x *Section) GetTitle() string { @@ -5594,7 +5496,7 @@ type Row struct { func (x *Row) Reset() { *x = Row{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[24] + mi := &file_binary_proto_def_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5607,7 +5509,7 @@ func (x *Row) String() string { func (*Row) ProtoMessage() {} func (x *Row) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[24] + mi := &file_binary_proto_def_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5620,7 +5522,7 @@ func (x *Row) ProtoReflect() protoreflect.Message { // Deprecated: Use Row.ProtoReflect.Descriptor instead. func (*Row) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{24} + return file_binary_proto_def_proto_rawDescGZIP(), []int{23} } func (x *Row) GetTitle() string { @@ -5655,7 +5557,7 @@ type Product struct { func (x *Product) Reset() { *x = Product{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[25] + mi := &file_binary_proto_def_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5668,7 +5570,7 @@ func (x *Product) String() string { func (*Product) ProtoMessage() {} func (x *Product) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[25] + mi := &file_binary_proto_def_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5681,7 +5583,7 @@ func (x *Product) ProtoReflect() protoreflect.Message { // Deprecated: Use Product.ProtoReflect.Descriptor instead. func (*Product) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{25} + return file_binary_proto_def_proto_rawDescGZIP(), []int{24} } func (x *Product) GetProductId() string { @@ -5703,7 +5605,7 @@ type ProductSection struct { func (x *ProductSection) Reset() { *x = ProductSection{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[26] + mi := &file_binary_proto_def_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5716,7 +5618,7 @@ func (x *ProductSection) String() string { func (*ProductSection) ProtoMessage() {} func (x *ProductSection) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[26] + mi := &file_binary_proto_def_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5729,7 +5631,7 @@ func (x *ProductSection) ProtoReflect() protoreflect.Message { // Deprecated: Use ProductSection.ProtoReflect.Descriptor instead. func (*ProductSection) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{26} + return file_binary_proto_def_proto_rawDescGZIP(), []int{25} } func (x *ProductSection) GetTitle() string { @@ -5759,7 +5661,7 @@ type ProductListInfo struct { func (x *ProductListInfo) Reset() { *x = ProductListInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[27] + mi := &file_binary_proto_def_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5772,7 +5674,7 @@ func (x *ProductListInfo) String() string { func (*ProductListInfo) ProtoMessage() {} func (x *ProductListInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[27] + mi := &file_binary_proto_def_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5785,7 +5687,7 @@ func (x *ProductListInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ProductListInfo.ProtoReflect.Descriptor instead. func (*ProductListInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{27} + return file_binary_proto_def_proto_rawDescGZIP(), []int{26} } func (x *ProductListInfo) GetProductSections() []*ProductSection { @@ -5821,7 +5723,7 @@ type ProductListHeaderImage struct { func (x *ProductListHeaderImage) Reset() { *x = ProductListHeaderImage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[28] + mi := &file_binary_proto_def_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5834,7 +5736,7 @@ func (x *ProductListHeaderImage) String() string { func (*ProductListHeaderImage) ProtoMessage() {} func (x *ProductListHeaderImage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[28] + mi := &file_binary_proto_def_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5847,7 +5749,7 @@ func (x *ProductListHeaderImage) ProtoReflect() protoreflect.Message { // Deprecated: Use ProductListHeaderImage.ProtoReflect.Descriptor instead. func (*ProductListHeaderImage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{28} + return file_binary_proto_def_proto_rawDescGZIP(), []int{27} } func (x *ProductListHeaderImage) GetProductId() string { @@ -5864,6 +5766,69 @@ func (x *ProductListHeaderImage) GetJpegThumbnail() []byte { return nil } +type KeepInChatMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key *MessageKey `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + KeepType *KeepType `protobuf:"varint,2,opt,name=keepType,enum=proto.KeepType" json:"keepType,omitempty"` + TimestampMs *int64 `protobuf:"varint,3,opt,name=timestampMs" json:"timestampMs,omitempty"` +} + +func (x *KeepInChatMessage) Reset() { + *x = KeepInChatMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepInChatMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepInChatMessage) ProtoMessage() {} + +func (x *KeepInChatMessage) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KeepInChatMessage.ProtoReflect.Descriptor instead. +func (*KeepInChatMessage) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{28} +} + +func (x *KeepInChatMessage) GetKey() *MessageKey { + if x != nil { + return x.Key + } + return nil +} + +func (x *KeepInChatMessage) GetKeepType() KeepType { + if x != nil && x.KeepType != nil { + return *x.KeepType + } + return KeepType_UNKNOWN +} + +func (x *KeepInChatMessage) GetTimestampMs() int64 { + if x != nil && x.TimestampMs != nil { + return *x.TimestampMs + } + return 0 +} + type InvoiceMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -11234,6 +11199,7 @@ type Message struct { InteractiveResponseMessage *InteractiveResponseMessage `protobuf:"bytes,48,opt,name=interactiveResponseMessage" json:"interactiveResponseMessage,omitempty"` PollCreationMessage *PollCreationMessage `protobuf:"bytes,49,opt,name=pollCreationMessage" json:"pollCreationMessage,omitempty"` PollUpdateMessage *PollUpdateMessage `protobuf:"bytes,50,opt,name=pollUpdateMessage" json:"pollUpdateMessage,omitempty"` + KeepInChatMessage *KeepInChatMessage `protobuf:"bytes,51,opt,name=keepInChatMessage" json:"keepInChatMessage,omitempty"` } func (x *Message) Reset() { @@ -11562,6 +11528,13 @@ func (x *Message) GetPollUpdateMessage() *PollUpdateMessage { return nil } +func (x *Message) GetKeepInChatMessage() *KeepInChatMessage { + if x != nil { + return x.KeepInChatMessage + } + return nil +} + type MessageContextInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -11570,6 +11543,7 @@ type MessageContextInfo struct { DeviceListMetadata *DeviceListMetadata `protobuf:"bytes,1,opt,name=deviceListMetadata" json:"deviceListMetadata,omitempty"` DeviceListMetadataVersion *int32 `protobuf:"varint,2,opt,name=deviceListMetadataVersion" json:"deviceListMetadataVersion,omitempty"` MessageSecret []byte `protobuf:"bytes,3,opt,name=messageSecret" json:"messageSecret,omitempty"` + PaddingBytes []byte `protobuf:"bytes,4,opt,name=paddingBytes" json:"paddingBytes,omitempty"` } func (x *MessageContextInfo) Reset() { @@ -11625,6 +11599,13 @@ func (x *MessageContextInfo) GetMessageSecret() []byte { return nil } +func (x *MessageContextInfo) GetPaddingBytes() []byte { + if x != nil { + return x.PaddingBytes + } + return nil +} + type VideoMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -12821,17 +12802,25 @@ func (x *ReactionMessage) GetSenderTimestampMs() int64 { return 0 } -type EphemeralSetting struct { +type ProtocolMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Duration *int32 `protobuf:"fixed32,1,opt,name=duration" json:"duration,omitempty"` - Timestamp *int64 `protobuf:"fixed64,2,opt,name=timestamp" json:"timestamp,omitempty"` + Key *MessageKey `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + Type *ProtocolMessage_ProtocolMessageType `protobuf:"varint,2,opt,name=type,enum=proto.ProtocolMessage_ProtocolMessageType" json:"type,omitempty"` + EphemeralExpiration *uint32 `protobuf:"varint,4,opt,name=ephemeralExpiration" json:"ephemeralExpiration,omitempty"` + EphemeralSettingTimestamp *int64 `protobuf:"varint,5,opt,name=ephemeralSettingTimestamp" json:"ephemeralSettingTimestamp,omitempty"` + HistorySyncNotification *HistorySyncNotification `protobuf:"bytes,6,opt,name=historySyncNotification" json:"historySyncNotification,omitempty"` + AppStateSyncKeyShare *AppStateSyncKeyShare `protobuf:"bytes,7,opt,name=appStateSyncKeyShare" json:"appStateSyncKeyShare,omitempty"` + AppStateSyncKeyRequest *AppStateSyncKeyRequest `protobuf:"bytes,8,opt,name=appStateSyncKeyRequest" json:"appStateSyncKeyRequest,omitempty"` + InitialSecurityNotificationSettingSync *InitialSecurityNotificationSettingSync `protobuf:"bytes,9,opt,name=initialSecurityNotificationSettingSync" json:"initialSecurityNotificationSettingSync,omitempty"` + AppStateFatalExceptionNotification *AppStateFatalExceptionNotification `protobuf:"bytes,10,opt,name=appStateFatalExceptionNotification" json:"appStateFatalExceptionNotification,omitempty"` + DisappearingMode *DisappearingMode `protobuf:"bytes,11,opt,name=disappearingMode" json:"disappearingMode,omitempty"` } -func (x *EphemeralSetting) Reset() { - *x = EphemeralSetting{} +func (x *ProtocolMessage) Reset() { + *x = ProtocolMessage{} if protoimpl.UnsafeEnabled { mi := &file_binary_proto_def_proto_msgTypes[107] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -12839,13 +12828,13 @@ func (x *EphemeralSetting) Reset() { } } -func (x *EphemeralSetting) String() string { +func (x *ProtocolMessage) String() string { return protoimpl.X.MessageStringOf(x) } -func (*EphemeralSetting) ProtoMessage() {} +func (*ProtocolMessage) ProtoMessage() {} -func (x *EphemeralSetting) ProtoReflect() protoreflect.Message { +func (x *ProtocolMessage) ProtoReflect() protoreflect.Message { mi := &file_binary_proto_def_proto_msgTypes[107] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -12857,106 +12846,111 @@ func (x *EphemeralSetting) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use EphemeralSetting.ProtoReflect.Descriptor instead. -func (*EphemeralSetting) Descriptor() ([]byte, []int) { +// Deprecated: Use ProtocolMessage.ProtoReflect.Descriptor instead. +func (*ProtocolMessage) Descriptor() ([]byte, []int) { return file_binary_proto_def_proto_rawDescGZIP(), []int{107} } -func (x *EphemeralSetting) GetDuration() int32 { - if x != nil && x.Duration != nil { - return *x.Duration +func (x *ProtocolMessage) GetKey() *MessageKey { + if x != nil { + return x.Key } - return 0 + return nil } -func (x *EphemeralSetting) GetTimestamp() int64 { - if x != nil && x.Timestamp != nil { - return *x.Timestamp +func (x *ProtocolMessage) GetType() ProtocolMessage_ProtocolMessageType { + if x != nil && x.Type != nil { + return *x.Type } - return 0 + return ProtocolMessage_REVOKE } -type WallpaperSettings struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Filename *string `protobuf:"bytes,1,opt,name=filename" json:"filename,omitempty"` - Opacity *uint32 `protobuf:"varint,2,opt,name=opacity" json:"opacity,omitempty"` +func (x *ProtocolMessage) GetEphemeralExpiration() uint32 { + if x != nil && x.EphemeralExpiration != nil { + return *x.EphemeralExpiration + } + return 0 } -func (x *WallpaperSettings) Reset() { - *x = WallpaperSettings{} - if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[108] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +func (x *ProtocolMessage) GetEphemeralSettingTimestamp() int64 { + if x != nil && x.EphemeralSettingTimestamp != nil { + return *x.EphemeralSettingTimestamp } + return 0 } -func (x *WallpaperSettings) String() string { - return protoimpl.X.MessageStringOf(x) +func (x *ProtocolMessage) GetHistorySyncNotification() *HistorySyncNotification { + if x != nil { + return x.HistorySyncNotification + } + return nil } -func (*WallpaperSettings) ProtoMessage() {} +func (x *ProtocolMessage) GetAppStateSyncKeyShare() *AppStateSyncKeyShare { + if x != nil { + return x.AppStateSyncKeyShare + } + return nil +} -func (x *WallpaperSettings) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[108] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms +func (x *ProtocolMessage) GetAppStateSyncKeyRequest() *AppStateSyncKeyRequest { + if x != nil { + return x.AppStateSyncKeyRequest } - return mi.MessageOf(x) + return nil } -// Deprecated: Use WallpaperSettings.ProtoReflect.Descriptor instead. -func (*WallpaperSettings) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{108} +func (x *ProtocolMessage) GetInitialSecurityNotificationSettingSync() *InitialSecurityNotificationSettingSync { + if x != nil { + return x.InitialSecurityNotificationSettingSync + } + return nil } -func (x *WallpaperSettings) GetFilename() string { - if x != nil && x.Filename != nil { - return *x.Filename +func (x *ProtocolMessage) GetAppStateFatalExceptionNotification() *AppStateFatalExceptionNotification { + if x != nil { + return x.AppStateFatalExceptionNotification } - return "" + return nil } -func (x *WallpaperSettings) GetOpacity() uint32 { - if x != nil && x.Opacity != nil { - return *x.Opacity +func (x *ProtocolMessage) GetDisappearingMode() *DisappearingMode { + if x != nil { + return x.DisappearingMode } - return 0 + return nil } -type Pushname struct { +type ProductMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id *string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - Pushname *string `protobuf:"bytes,2,opt,name=pushname" json:"pushname,omitempty"` + Product *ProductSnapshot `protobuf:"bytes,1,opt,name=product" json:"product,omitempty"` + BusinessOwnerJid *string `protobuf:"bytes,2,opt,name=businessOwnerJid" json:"businessOwnerJid,omitempty"` + Catalog *CatalogSnapshot `protobuf:"bytes,4,opt,name=catalog" json:"catalog,omitempty"` + Body *string `protobuf:"bytes,5,opt,name=body" json:"body,omitempty"` + Footer *string `protobuf:"bytes,6,opt,name=footer" json:"footer,omitempty"` + ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` } -func (x *Pushname) Reset() { - *x = Pushname{} +func (x *ProductMessage) Reset() { + *x = ProductMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[109] + mi := &file_binary_proto_def_proto_msgTypes[108] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *Pushname) String() string { +func (x *ProductMessage) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Pushname) ProtoMessage() {} +func (*ProductMessage) ProtoMessage() {} -func (x *Pushname) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[109] +func (x *ProductMessage) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[108] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12967,34 +12961,227 @@ func (x *Pushname) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Pushname.ProtoReflect.Descriptor instead. -func (*Pushname) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{109} +// Deprecated: Use ProductMessage.ProtoReflect.Descriptor instead. +func (*ProductMessage) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{108} } -func (x *Pushname) GetId() string { - if x != nil && x.Id != nil { - return *x.Id +func (x *ProductMessage) GetProduct() *ProductSnapshot { + if x != nil { + return x.Product } - return "" + return nil } -func (x *Pushname) GetPushname() string { - if x != nil && x.Pushname != nil { - return *x.Pushname +func (x *ProductMessage) GetBusinessOwnerJid() string { + if x != nil && x.BusinessOwnerJid != nil { + return *x.BusinessOwnerJid } return "" } -type HistorySync struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SyncType *HistorySync_HistorySyncHistorySyncType `protobuf:"varint,1,req,name=syncType,enum=proto.HistorySync_HistorySyncHistorySyncType" json:"syncType,omitempty"` - Conversations []*Conversation `protobuf:"bytes,2,rep,name=conversations" json:"conversations,omitempty"` - StatusV3Messages []*WebMessageInfo `protobuf:"bytes,3,rep,name=statusV3Messages" json:"statusV3Messages,omitempty"` - ChunkOrder *uint32 `protobuf:"varint,5,opt,name=chunkOrder" json:"chunkOrder,omitempty"` +func (x *ProductMessage) GetCatalog() *CatalogSnapshot { + if x != nil { + return x.Catalog + } + return nil +} + +func (x *ProductMessage) GetBody() string { + if x != nil && x.Body != nil { + return *x.Body + } + return "" +} + +func (x *ProductMessage) GetFooter() string { + if x != nil && x.Footer != nil { + return *x.Footer + } + return "" +} + +func (x *ProductMessage) GetContextInfo() *ContextInfo { + if x != nil { + return x.ContextInfo + } + return nil +} + +type EphemeralSetting struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Duration *int32 `protobuf:"fixed32,1,opt,name=duration" json:"duration,omitempty"` + Timestamp *int64 `protobuf:"fixed64,2,opt,name=timestamp" json:"timestamp,omitempty"` +} + +func (x *EphemeralSetting) Reset() { + *x = EphemeralSetting{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[109] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EphemeralSetting) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EphemeralSetting) ProtoMessage() {} + +func (x *EphemeralSetting) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[109] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EphemeralSetting.ProtoReflect.Descriptor instead. +func (*EphemeralSetting) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{109} +} + +func (x *EphemeralSetting) GetDuration() int32 { + if x != nil && x.Duration != nil { + return *x.Duration + } + return 0 +} + +func (x *EphemeralSetting) GetTimestamp() int64 { + if x != nil && x.Timestamp != nil { + return *x.Timestamp + } + return 0 +} + +type WallpaperSettings struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Filename *string `protobuf:"bytes,1,opt,name=filename" json:"filename,omitempty"` + Opacity *uint32 `protobuf:"varint,2,opt,name=opacity" json:"opacity,omitempty"` +} + +func (x *WallpaperSettings) Reset() { + *x = WallpaperSettings{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[110] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WallpaperSettings) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WallpaperSettings) ProtoMessage() {} + +func (x *WallpaperSettings) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[110] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WallpaperSettings.ProtoReflect.Descriptor instead. +func (*WallpaperSettings) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{110} +} + +func (x *WallpaperSettings) GetFilename() string { + if x != nil && x.Filename != nil { + return *x.Filename + } + return "" +} + +func (x *WallpaperSettings) GetOpacity() uint32 { + if x != nil && x.Opacity != nil { + return *x.Opacity + } + return 0 +} + +type Pushname struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Pushname *string `protobuf:"bytes,2,opt,name=pushname" json:"pushname,omitempty"` +} + +func (x *Pushname) Reset() { + *x = Pushname{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[111] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Pushname) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Pushname) ProtoMessage() {} + +func (x *Pushname) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[111] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Pushname.ProtoReflect.Descriptor instead. +func (*Pushname) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{111} +} + +func (x *Pushname) GetId() string { + if x != nil && x.Id != nil { + return *x.Id + } + return "" +} + +func (x *Pushname) GetPushname() string { + if x != nil && x.Pushname != nil { + return *x.Pushname + } + return "" +} + +type HistorySync struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SyncType *HistorySync_HistorySyncHistorySyncType `protobuf:"varint,1,req,name=syncType,enum=proto.HistorySync_HistorySyncHistorySyncType" json:"syncType,omitempty"` + Conversations []*Conversation `protobuf:"bytes,2,rep,name=conversations" json:"conversations,omitempty"` + StatusV3Messages []*WebMessageInfo `protobuf:"bytes,3,rep,name=statusV3Messages" json:"statusV3Messages,omitempty"` + ChunkOrder *uint32 `protobuf:"varint,5,opt,name=chunkOrder" json:"chunkOrder,omitempty"` Progress *uint32 `protobuf:"varint,6,opt,name=progress" json:"progress,omitempty"` Pushnames []*Pushname `protobuf:"bytes,7,rep,name=pushnames" json:"pushnames,omitempty"` GlobalSettings *GlobalSettings `protobuf:"bytes,8,opt,name=globalSettings" json:"globalSettings,omitempty"` @@ -13005,7 +13192,7 @@ type HistorySync struct { func (x *HistorySync) Reset() { *x = HistorySync{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[110] + mi := &file_binary_proto_def_proto_msgTypes[112] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13018,7 +13205,7 @@ func (x *HistorySync) String() string { func (*HistorySync) ProtoMessage() {} func (x *HistorySync) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[110] + mi := &file_binary_proto_def_proto_msgTypes[112] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13031,7 +13218,7 @@ func (x *HistorySync) ProtoReflect() protoreflect.Message { // Deprecated: Use HistorySync.ProtoReflect.Descriptor instead. func (*HistorySync) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{110} + return file_binary_proto_def_proto_rawDescGZIP(), []int{112} } func (x *HistorySync) GetSyncType() HistorySync_HistorySyncHistorySyncType { @@ -13109,7 +13296,7 @@ type HistorySyncMsg struct { func (x *HistorySyncMsg) Reset() { *x = HistorySyncMsg{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[111] + mi := &file_binary_proto_def_proto_msgTypes[113] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13122,7 +13309,7 @@ func (x *HistorySyncMsg) String() string { func (*HistorySyncMsg) ProtoMessage() {} func (x *HistorySyncMsg) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[111] + mi := &file_binary_proto_def_proto_msgTypes[113] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13135,7 +13322,7 @@ func (x *HistorySyncMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use HistorySyncMsg.ProtoReflect.Descriptor instead. func (*HistorySyncMsg) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{111} + return file_binary_proto_def_proto_rawDescGZIP(), []int{113} } func (x *HistorySyncMsg) GetMessage() *WebMessageInfo { @@ -13164,7 +13351,7 @@ type GroupParticipant struct { func (x *GroupParticipant) Reset() { *x = GroupParticipant{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[112] + mi := &file_binary_proto_def_proto_msgTypes[114] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13177,7 +13364,7 @@ func (x *GroupParticipant) String() string { func (*GroupParticipant) ProtoMessage() {} func (x *GroupParticipant) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[112] + mi := &file_binary_proto_def_proto_msgTypes[114] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13190,7 +13377,7 @@ func (x *GroupParticipant) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupParticipant.ProtoReflect.Descriptor instead. func (*GroupParticipant) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{112} + return file_binary_proto_def_proto_rawDescGZIP(), []int{114} } func (x *GroupParticipant) GetUserJid() string { @@ -13227,7 +13414,7 @@ type GlobalSettings struct { func (x *GlobalSettings) Reset() { *x = GlobalSettings{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[113] + mi := &file_binary_proto_def_proto_msgTypes[115] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13240,7 +13427,7 @@ func (x *GlobalSettings) String() string { func (*GlobalSettings) ProtoMessage() {} func (x *GlobalSettings) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[113] + mi := &file_binary_proto_def_proto_msgTypes[115] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13253,7 +13440,7 @@ func (x *GlobalSettings) ProtoReflect() protoreflect.Message { // Deprecated: Use GlobalSettings.ProtoReflect.Descriptor instead. func (*GlobalSettings) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{113} + return file_binary_proto_def_proto_rawDescGZIP(), []int{115} } func (x *GlobalSettings) GetLightThemeWallpaper() *WallpaperSettings { @@ -13360,12 +13547,23 @@ type Conversation struct { MediaVisibility *MediaVisibility `protobuf:"varint,27,opt,name=mediaVisibility,enum=proto.MediaVisibility" json:"mediaVisibility,omitempty"` TcTokenSenderTimestamp *uint64 `protobuf:"varint,28,opt,name=tcTokenSenderTimestamp" json:"tcTokenSenderTimestamp,omitempty"` Suspended *bool `protobuf:"varint,29,opt,name=suspended" json:"suspended,omitempty"` + Terminated *bool `protobuf:"varint,30,opt,name=terminated" json:"terminated,omitempty"` + CreatedAt *uint64 `protobuf:"varint,31,opt,name=createdAt" json:"createdAt,omitempty"` + CreatedBy *string `protobuf:"bytes,32,opt,name=createdBy" json:"createdBy,omitempty"` + Description *string `protobuf:"bytes,33,opt,name=description" json:"description,omitempty"` + Support *bool `protobuf:"varint,34,opt,name=support" json:"support,omitempty"` + IsParentGroup *bool `protobuf:"varint,35,opt,name=isParentGroup" json:"isParentGroup,omitempty"` + IsDefaultSubgroup *bool `protobuf:"varint,36,opt,name=isDefaultSubgroup" json:"isDefaultSubgroup,omitempty"` + ParentGroupId *string `protobuf:"bytes,37,opt,name=parentGroupId" json:"parentGroupId,omitempty"` + DisplayName *string `protobuf:"bytes,38,opt,name=displayName" json:"displayName,omitempty"` + PnJid *string `protobuf:"bytes,39,opt,name=pnJid" json:"pnJid,omitempty"` + SelfMasked *bool `protobuf:"varint,40,opt,name=selfMasked" json:"selfMasked,omitempty"` } func (x *Conversation) Reset() { *x = Conversation{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[114] + mi := &file_binary_proto_def_proto_msgTypes[116] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13378,7 +13576,7 @@ func (x *Conversation) String() string { func (*Conversation) ProtoMessage() {} func (x *Conversation) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[114] + mi := &file_binary_proto_def_proto_msgTypes[116] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13391,7 +13589,7 @@ func (x *Conversation) ProtoReflect() protoreflect.Message { // Deprecated: Use Conversation.ProtoReflect.Descriptor instead. func (*Conversation) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{114} + return file_binary_proto_def_proto_rawDescGZIP(), []int{116} } func (x *Conversation) GetId() string { @@ -13597,34 +13795,111 @@ func (x *Conversation) GetSuspended() bool { return false } -type AutoDownloadSettings struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - DownloadImages *bool `protobuf:"varint,1,opt,name=downloadImages" json:"downloadImages,omitempty"` - DownloadAudio *bool `protobuf:"varint,2,opt,name=downloadAudio" json:"downloadAudio,omitempty"` - DownloadVideo *bool `protobuf:"varint,3,opt,name=downloadVideo" json:"downloadVideo,omitempty"` - DownloadDocuments *bool `protobuf:"varint,4,opt,name=downloadDocuments" json:"downloadDocuments,omitempty"` +func (x *Conversation) GetTerminated() bool { + if x != nil && x.Terminated != nil { + return *x.Terminated + } + return false } -func (x *AutoDownloadSettings) Reset() { - *x = AutoDownloadSettings{} - if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[115] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +func (x *Conversation) GetCreatedAt() uint64 { + if x != nil && x.CreatedAt != nil { + return *x.CreatedAt } + return 0 } -func (x *AutoDownloadSettings) String() string { - return protoimpl.X.MessageStringOf(x) +func (x *Conversation) GetCreatedBy() string { + if x != nil && x.CreatedBy != nil { + return *x.CreatedBy + } + return "" } -func (*AutoDownloadSettings) ProtoMessage() {} - +func (x *Conversation) GetDescription() string { + if x != nil && x.Description != nil { + return *x.Description + } + return "" +} + +func (x *Conversation) GetSupport() bool { + if x != nil && x.Support != nil { + return *x.Support + } + return false +} + +func (x *Conversation) GetIsParentGroup() bool { + if x != nil && x.IsParentGroup != nil { + return *x.IsParentGroup + } + return false +} + +func (x *Conversation) GetIsDefaultSubgroup() bool { + if x != nil && x.IsDefaultSubgroup != nil { + return *x.IsDefaultSubgroup + } + return false +} + +func (x *Conversation) GetParentGroupId() string { + if x != nil && x.ParentGroupId != nil { + return *x.ParentGroupId + } + return "" +} + +func (x *Conversation) GetDisplayName() string { + if x != nil && x.DisplayName != nil { + return *x.DisplayName + } + return "" +} + +func (x *Conversation) GetPnJid() string { + if x != nil && x.PnJid != nil { + return *x.PnJid + } + return "" +} + +func (x *Conversation) GetSelfMasked() bool { + if x != nil && x.SelfMasked != nil { + return *x.SelfMasked + } + return false +} + +type AutoDownloadSettings struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DownloadImages *bool `protobuf:"varint,1,opt,name=downloadImages" json:"downloadImages,omitempty"` + DownloadAudio *bool `protobuf:"varint,2,opt,name=downloadAudio" json:"downloadAudio,omitempty"` + DownloadVideo *bool `protobuf:"varint,3,opt,name=downloadVideo" json:"downloadVideo,omitempty"` + DownloadDocuments *bool `protobuf:"varint,4,opt,name=downloadDocuments" json:"downloadDocuments,omitempty"` +} + +func (x *AutoDownloadSettings) Reset() { + *x = AutoDownloadSettings{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[117] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AutoDownloadSettings) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AutoDownloadSettings) ProtoMessage() {} + func (x *AutoDownloadSettings) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[115] + mi := &file_binary_proto_def_proto_msgTypes[117] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13637,7 +13912,7 @@ func (x *AutoDownloadSettings) ProtoReflect() protoreflect.Message { // Deprecated: Use AutoDownloadSettings.ProtoReflect.Descriptor instead. func (*AutoDownloadSettings) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{115} + return file_binary_proto_def_proto_rawDescGZIP(), []int{117} } func (x *AutoDownloadSettings) GetDownloadImages() bool { @@ -13680,7 +13955,7 @@ type MsgRowOpaqueData struct { func (x *MsgRowOpaqueData) Reset() { *x = MsgRowOpaqueData{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[116] + mi := &file_binary_proto_def_proto_msgTypes[118] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13693,7 +13968,7 @@ func (x *MsgRowOpaqueData) String() string { func (*MsgRowOpaqueData) ProtoMessage() {} func (x *MsgRowOpaqueData) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[116] + mi := &file_binary_proto_def_proto_msgTypes[118] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13706,7 +13981,7 @@ func (x *MsgRowOpaqueData) ProtoReflect() protoreflect.Message { // Deprecated: Use MsgRowOpaqueData.ProtoReflect.Descriptor instead. func (*MsgRowOpaqueData) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{116} + return file_binary_proto_def_proto_rawDescGZIP(), []int{118} } func (x *MsgRowOpaqueData) GetCurrentMsg() *MsgOpaqueData { @@ -13744,14 +14019,14 @@ type MsgOpaqueData struct { Loc *string `protobuf:"bytes,16,opt,name=loc" json:"loc,omitempty"` PollName *string `protobuf:"bytes,17,opt,name=pollName" json:"pollName,omitempty"` PollOptions []*PollOption `protobuf:"bytes,18,rep,name=pollOptions" json:"pollOptions,omitempty"` - PollEncKey []byte `protobuf:"bytes,19,opt,name=pollEncKey" json:"pollEncKey,omitempty"` PollSelectableOptionsCount *uint32 `protobuf:"varint,20,opt,name=pollSelectableOptionsCount" json:"pollSelectableOptionsCount,omitempty"` + MessageSecret []byte `protobuf:"bytes,21,opt,name=messageSecret" json:"messageSecret,omitempty"` } func (x *MsgOpaqueData) Reset() { *x = MsgOpaqueData{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[117] + mi := &file_binary_proto_def_proto_msgTypes[119] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13764,7 +14039,7 @@ func (x *MsgOpaqueData) String() string { func (*MsgOpaqueData) ProtoMessage() {} func (x *MsgOpaqueData) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[117] + mi := &file_binary_proto_def_proto_msgTypes[119] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13777,7 +14052,7 @@ func (x *MsgOpaqueData) ProtoReflect() protoreflect.Message { // Deprecated: Use MsgOpaqueData.ProtoReflect.Descriptor instead. func (*MsgOpaqueData) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{117} + return file_binary_proto_def_proto_rawDescGZIP(), []int{119} } func (x *MsgOpaqueData) GetBody() string { @@ -13892,13 +14167,6 @@ func (x *MsgOpaqueData) GetPollOptions() []*PollOption { return nil } -func (x *MsgOpaqueData) GetPollEncKey() []byte { - if x != nil { - return x.PollEncKey - } - return nil -} - func (x *MsgOpaqueData) GetPollSelectableOptionsCount() uint32 { if x != nil && x.PollSelectableOptionsCount != nil { return *x.PollSelectableOptionsCount @@ -13906,6 +14174,13 @@ func (x *MsgOpaqueData) GetPollSelectableOptionsCount() uint32 { return 0 } +func (x *MsgOpaqueData) GetMessageSecret() []byte { + if x != nil { + return x.MessageSecret + } + return nil +} + type PollOption struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -13917,7 +14192,7 @@ type PollOption struct { func (x *PollOption) Reset() { *x = PollOption{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[118] + mi := &file_binary_proto_def_proto_msgTypes[120] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13930,7 +14205,7 @@ func (x *PollOption) String() string { func (*PollOption) ProtoMessage() {} func (x *PollOption) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[118] + mi := &file_binary_proto_def_proto_msgTypes[120] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13943,7 +14218,7 @@ func (x *PollOption) ProtoReflect() protoreflect.Message { // Deprecated: Use PollOption.ProtoReflect.Descriptor instead. func (*PollOption) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{118} + return file_binary_proto_def_proto_rawDescGZIP(), []int{120} } func (x *PollOption) GetName() string { @@ -13964,7 +14239,7 @@ type ServerErrorReceipt struct { func (x *ServerErrorReceipt) Reset() { *x = ServerErrorReceipt{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[119] + mi := &file_binary_proto_def_proto_msgTypes[121] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13977,7 +14252,7 @@ func (x *ServerErrorReceipt) String() string { func (*ServerErrorReceipt) ProtoMessage() {} func (x *ServerErrorReceipt) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[119] + mi := &file_binary_proto_def_proto_msgTypes[121] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13990,7 +14265,7 @@ func (x *ServerErrorReceipt) ProtoReflect() protoreflect.Message { // Deprecated: Use ServerErrorReceipt.ProtoReflect.Descriptor instead. func (*ServerErrorReceipt) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{119} + return file_binary_proto_def_proto_rawDescGZIP(), []int{121} } func (x *ServerErrorReceipt) GetStanzaId() string { @@ -14013,7 +14288,7 @@ type MediaRetryNotification struct { func (x *MediaRetryNotification) Reset() { *x = MediaRetryNotification{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[120] + mi := &file_binary_proto_def_proto_msgTypes[122] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14026,7 +14301,7 @@ func (x *MediaRetryNotification) String() string { func (*MediaRetryNotification) ProtoMessage() {} func (x *MediaRetryNotification) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[120] + mi := &file_binary_proto_def_proto_msgTypes[122] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14039,7 +14314,7 @@ func (x *MediaRetryNotification) ProtoReflect() protoreflect.Message { // Deprecated: Use MediaRetryNotification.ProtoReflect.Descriptor instead. func (*MediaRetryNotification) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{120} + return file_binary_proto_def_proto_rawDescGZIP(), []int{122} } func (x *MediaRetryNotification) GetStanzaId() string { @@ -14077,7 +14352,7 @@ type MessageKey struct { func (x *MessageKey) Reset() { *x = MessageKey{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[121] + mi := &file_binary_proto_def_proto_msgTypes[123] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14090,7 +14365,7 @@ func (x *MessageKey) String() string { func (*MessageKey) ProtoMessage() {} func (x *MessageKey) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[121] + mi := &file_binary_proto_def_proto_msgTypes[123] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14103,7 +14378,7 @@ func (x *MessageKey) ProtoReflect() protoreflect.Message { // Deprecated: Use MessageKey.ProtoReflect.Descriptor instead. func (*MessageKey) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{121} + return file_binary_proto_def_proto_rawDescGZIP(), []int{123} } func (x *MessageKey) GetRemoteJid() string { @@ -14145,7 +14420,7 @@ type SyncdVersion struct { func (x *SyncdVersion) Reset() { *x = SyncdVersion{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[122] + mi := &file_binary_proto_def_proto_msgTypes[124] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14158,7 +14433,7 @@ func (x *SyncdVersion) String() string { func (*SyncdVersion) ProtoMessage() {} func (x *SyncdVersion) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[122] + mi := &file_binary_proto_def_proto_msgTypes[124] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14171,7 +14446,7 @@ func (x *SyncdVersion) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdVersion.ProtoReflect.Descriptor instead. func (*SyncdVersion) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{122} + return file_binary_proto_def_proto_rawDescGZIP(), []int{124} } func (x *SyncdVersion) GetVersion() uint64 { @@ -14192,7 +14467,7 @@ type SyncdValue struct { func (x *SyncdValue) Reset() { *x = SyncdValue{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[123] + mi := &file_binary_proto_def_proto_msgTypes[125] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14205,7 +14480,7 @@ func (x *SyncdValue) String() string { func (*SyncdValue) ProtoMessage() {} func (x *SyncdValue) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[123] + mi := &file_binary_proto_def_proto_msgTypes[125] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14218,7 +14493,7 @@ func (x *SyncdValue) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdValue.ProtoReflect.Descriptor instead. func (*SyncdValue) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{123} + return file_binary_proto_def_proto_rawDescGZIP(), []int{125} } func (x *SyncdValue) GetBlob() []byte { @@ -14242,7 +14517,7 @@ type SyncdSnapshot struct { func (x *SyncdSnapshot) Reset() { *x = SyncdSnapshot{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[124] + mi := &file_binary_proto_def_proto_msgTypes[126] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14255,7 +14530,7 @@ func (x *SyncdSnapshot) String() string { func (*SyncdSnapshot) ProtoMessage() {} func (x *SyncdSnapshot) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[124] + mi := &file_binary_proto_def_proto_msgTypes[126] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14268,7 +14543,7 @@ func (x *SyncdSnapshot) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdSnapshot.ProtoReflect.Descriptor instead. func (*SyncdSnapshot) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{124} + return file_binary_proto_def_proto_rawDescGZIP(), []int{126} } func (x *SyncdSnapshot) GetVersion() *SyncdVersion { @@ -14312,7 +14587,7 @@ type SyncdRecord struct { func (x *SyncdRecord) Reset() { *x = SyncdRecord{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[125] + mi := &file_binary_proto_def_proto_msgTypes[127] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14325,7 +14600,7 @@ func (x *SyncdRecord) String() string { func (*SyncdRecord) ProtoMessage() {} func (x *SyncdRecord) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[125] + mi := &file_binary_proto_def_proto_msgTypes[127] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14338,7 +14613,7 @@ func (x *SyncdRecord) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdRecord.ProtoReflect.Descriptor instead. func (*SyncdRecord) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{125} + return file_binary_proto_def_proto_rawDescGZIP(), []int{127} } func (x *SyncdRecord) GetIndex() *SyncdIndex { @@ -14380,7 +14655,7 @@ type SyncdPatch struct { func (x *SyncdPatch) Reset() { *x = SyncdPatch{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[126] + mi := &file_binary_proto_def_proto_msgTypes[128] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14393,7 +14668,7 @@ func (x *SyncdPatch) String() string { func (*SyncdPatch) ProtoMessage() {} func (x *SyncdPatch) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[126] + mi := &file_binary_proto_def_proto_msgTypes[128] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14406,7 +14681,7 @@ func (x *SyncdPatch) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdPatch.ProtoReflect.Descriptor instead. func (*SyncdPatch) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{126} + return file_binary_proto_def_proto_rawDescGZIP(), []int{128} } func (x *SyncdPatch) GetVersion() *SyncdVersion { @@ -14476,7 +14751,7 @@ type SyncdMutations struct { func (x *SyncdMutations) Reset() { *x = SyncdMutations{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[127] + mi := &file_binary_proto_def_proto_msgTypes[129] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14489,7 +14764,7 @@ func (x *SyncdMutations) String() string { func (*SyncdMutations) ProtoMessage() {} func (x *SyncdMutations) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[127] + mi := &file_binary_proto_def_proto_msgTypes[129] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14502,7 +14777,7 @@ func (x *SyncdMutations) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdMutations.ProtoReflect.Descriptor instead. func (*SyncdMutations) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{127} + return file_binary_proto_def_proto_rawDescGZIP(), []int{129} } func (x *SyncdMutations) GetMutations() []*SyncdMutation { @@ -14524,7 +14799,7 @@ type SyncdMutation struct { func (x *SyncdMutation) Reset() { *x = SyncdMutation{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[128] + mi := &file_binary_proto_def_proto_msgTypes[130] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14537,7 +14812,7 @@ func (x *SyncdMutation) String() string { func (*SyncdMutation) ProtoMessage() {} func (x *SyncdMutation) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[128] + mi := &file_binary_proto_def_proto_msgTypes[130] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14550,7 +14825,7 @@ func (x *SyncdMutation) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdMutation.ProtoReflect.Descriptor instead. func (*SyncdMutation) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{128} + return file_binary_proto_def_proto_rawDescGZIP(), []int{130} } func (x *SyncdMutation) GetOperation() SyncdMutation_SyncdMutationSyncdOperation { @@ -14578,7 +14853,7 @@ type SyncdIndex struct { func (x *SyncdIndex) Reset() { *x = SyncdIndex{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[129] + mi := &file_binary_proto_def_proto_msgTypes[131] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14591,7 +14866,7 @@ func (x *SyncdIndex) String() string { func (*SyncdIndex) ProtoMessage() {} func (x *SyncdIndex) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[129] + mi := &file_binary_proto_def_proto_msgTypes[131] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14604,7 +14879,7 @@ func (x *SyncdIndex) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdIndex.ProtoReflect.Descriptor instead. func (*SyncdIndex) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{129} + return file_binary_proto_def_proto_rawDescGZIP(), []int{131} } func (x *SyncdIndex) GetBlob() []byte { @@ -14625,7 +14900,7 @@ type KeyId struct { func (x *KeyId) Reset() { *x = KeyId{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[130] + mi := &file_binary_proto_def_proto_msgTypes[132] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14638,7 +14913,7 @@ func (x *KeyId) String() string { func (*KeyId) ProtoMessage() {} func (x *KeyId) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[130] + mi := &file_binary_proto_def_proto_msgTypes[132] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14651,7 +14926,7 @@ func (x *KeyId) ProtoReflect() protoreflect.Message { // Deprecated: Use KeyId.ProtoReflect.Descriptor instead. func (*KeyId) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{130} + return file_binary_proto_def_proto_rawDescGZIP(), []int{132} } func (x *KeyId) GetId() []byte { @@ -14677,7 +14952,7 @@ type ExternalBlobReference struct { func (x *ExternalBlobReference) Reset() { *x = ExternalBlobReference{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[131] + mi := &file_binary_proto_def_proto_msgTypes[133] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14690,7 +14965,7 @@ func (x *ExternalBlobReference) String() string { func (*ExternalBlobReference) ProtoMessage() {} func (x *ExternalBlobReference) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[131] + mi := &file_binary_proto_def_proto_msgTypes[133] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14703,7 +14978,7 @@ func (x *ExternalBlobReference) ProtoReflect() protoreflect.Message { // Deprecated: Use ExternalBlobReference.ProtoReflect.Descriptor instead. func (*ExternalBlobReference) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{131} + return file_binary_proto_def_proto_rawDescGZIP(), []int{133} } func (x *ExternalBlobReference) GetMediaKey() []byte { @@ -14760,7 +15035,7 @@ type ExitCode struct { func (x *ExitCode) Reset() { *x = ExitCode{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[132] + mi := &file_binary_proto_def_proto_msgTypes[134] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14773,7 +15048,7 @@ func (x *ExitCode) String() string { func (*ExitCode) ProtoMessage() {} func (x *ExitCode) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[132] + mi := &file_binary_proto_def_proto_msgTypes[134] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14786,7 +15061,7 @@ func (x *ExitCode) ProtoReflect() protoreflect.Message { // Deprecated: Use ExitCode.ProtoReflect.Descriptor instead. func (*ExitCode) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{132} + return file_binary_proto_def_proto_rawDescGZIP(), []int{134} } func (x *ExitCode) GetCode() uint64 { @@ -14841,7 +15116,7 @@ type SyncActionValue struct { func (x *SyncActionValue) Reset() { *x = SyncActionValue{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[133] + mi := &file_binary_proto_def_proto_msgTypes[135] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14854,7 +15129,7 @@ func (x *SyncActionValue) String() string { func (*SyncActionValue) ProtoMessage() {} func (x *SyncActionValue) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[133] + mi := &file_binary_proto_def_proto_msgTypes[135] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14867,7 +15142,7 @@ func (x *SyncActionValue) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncActionValue.ProtoReflect.Descriptor instead. func (*SyncActionValue) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{133} + return file_binary_proto_def_proto_rawDescGZIP(), []int{135} } func (x *SyncActionValue) GetTimestamp() int64 { @@ -15077,7 +15352,7 @@ type UserStatusMuteAction struct { func (x *UserStatusMuteAction) Reset() { *x = UserStatusMuteAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[134] + mi := &file_binary_proto_def_proto_msgTypes[136] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15090,7 +15365,7 @@ func (x *UserStatusMuteAction) String() string { func (*UserStatusMuteAction) ProtoMessage() {} func (x *UserStatusMuteAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[134] + mi := &file_binary_proto_def_proto_msgTypes[136] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15103,7 +15378,7 @@ func (x *UserStatusMuteAction) ProtoReflect() protoreflect.Message { // Deprecated: Use UserStatusMuteAction.ProtoReflect.Descriptor instead. func (*UserStatusMuteAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{134} + return file_binary_proto_def_proto_rawDescGZIP(), []int{136} } func (x *UserStatusMuteAction) GetMuted() bool { @@ -15124,7 +15399,7 @@ type UnarchiveChatsSetting struct { func (x *UnarchiveChatsSetting) Reset() { *x = UnarchiveChatsSetting{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[135] + mi := &file_binary_proto_def_proto_msgTypes[137] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15137,7 +15412,7 @@ func (x *UnarchiveChatsSetting) String() string { func (*UnarchiveChatsSetting) ProtoMessage() {} func (x *UnarchiveChatsSetting) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[135] + mi := &file_binary_proto_def_proto_msgTypes[137] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15150,7 +15425,7 @@ func (x *UnarchiveChatsSetting) ProtoReflect() protoreflect.Message { // Deprecated: Use UnarchiveChatsSetting.ProtoReflect.Descriptor instead. func (*UnarchiveChatsSetting) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{135} + return file_binary_proto_def_proto_rawDescGZIP(), []int{137} } func (x *UnarchiveChatsSetting) GetUnarchiveChats() bool { @@ -15171,7 +15446,7 @@ type TimeFormatAction struct { func (x *TimeFormatAction) Reset() { *x = TimeFormatAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[136] + mi := &file_binary_proto_def_proto_msgTypes[138] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15184,7 +15459,7 @@ func (x *TimeFormatAction) String() string { func (*TimeFormatAction) ProtoMessage() {} func (x *TimeFormatAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[136] + mi := &file_binary_proto_def_proto_msgTypes[138] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15197,7 +15472,7 @@ func (x *TimeFormatAction) ProtoReflect() protoreflect.Message { // Deprecated: Use TimeFormatAction.ProtoReflect.Descriptor instead. func (*TimeFormatAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{136} + return file_binary_proto_def_proto_rawDescGZIP(), []int{138} } func (x *TimeFormatAction) GetIsTwentyFourHourFormatEnabled() bool { @@ -15219,7 +15494,7 @@ type SyncActionMessage struct { func (x *SyncActionMessage) Reset() { *x = SyncActionMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[137] + mi := &file_binary_proto_def_proto_msgTypes[139] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15232,7 +15507,7 @@ func (x *SyncActionMessage) String() string { func (*SyncActionMessage) ProtoMessage() {} func (x *SyncActionMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[137] + mi := &file_binary_proto_def_proto_msgTypes[139] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15245,7 +15520,7 @@ func (x *SyncActionMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncActionMessage.ProtoReflect.Descriptor instead. func (*SyncActionMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{137} + return file_binary_proto_def_proto_rawDescGZIP(), []int{139} } func (x *SyncActionMessage) GetKey() *MessageKey { @@ -15275,7 +15550,7 @@ type SyncActionMessageRange struct { func (x *SyncActionMessageRange) Reset() { *x = SyncActionMessageRange{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[138] + mi := &file_binary_proto_def_proto_msgTypes[140] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15288,7 +15563,7 @@ func (x *SyncActionMessageRange) String() string { func (*SyncActionMessageRange) ProtoMessage() {} func (x *SyncActionMessageRange) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[138] + mi := &file_binary_proto_def_proto_msgTypes[140] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15301,7 +15576,7 @@ func (x *SyncActionMessageRange) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncActionMessageRange.ProtoReflect.Descriptor instead. func (*SyncActionMessageRange) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{138} + return file_binary_proto_def_proto_rawDescGZIP(), []int{140} } func (x *SyncActionMessageRange) GetLastMessageTimestamp() int64 { @@ -15338,7 +15613,7 @@ type SubscriptionAction struct { func (x *SubscriptionAction) Reset() { *x = SubscriptionAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[139] + mi := &file_binary_proto_def_proto_msgTypes[141] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15351,7 +15626,7 @@ func (x *SubscriptionAction) String() string { func (*SubscriptionAction) ProtoMessage() {} func (x *SubscriptionAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[139] + mi := &file_binary_proto_def_proto_msgTypes[141] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15364,7 +15639,7 @@ func (x *SubscriptionAction) ProtoReflect() protoreflect.Message { // Deprecated: Use SubscriptionAction.ProtoReflect.Descriptor instead. func (*SubscriptionAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{139} + return file_binary_proto_def_proto_rawDescGZIP(), []int{141} } func (x *SubscriptionAction) GetIsDeactivated() bool { @@ -15399,7 +15674,7 @@ type StarAction struct { func (x *StarAction) Reset() { *x = StarAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[140] + mi := &file_binary_proto_def_proto_msgTypes[142] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15412,7 +15687,7 @@ func (x *StarAction) String() string { func (*StarAction) ProtoMessage() {} func (x *StarAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[140] + mi := &file_binary_proto_def_proto_msgTypes[142] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15425,7 +15700,7 @@ func (x *StarAction) ProtoReflect() protoreflect.Message { // Deprecated: Use StarAction.ProtoReflect.Descriptor instead. func (*StarAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{140} + return file_binary_proto_def_proto_rawDescGZIP(), []int{142} } func (x *StarAction) GetStarred() bool { @@ -15446,7 +15721,7 @@ type SecurityNotificationSetting struct { func (x *SecurityNotificationSetting) Reset() { *x = SecurityNotificationSetting{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[141] + mi := &file_binary_proto_def_proto_msgTypes[143] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15459,7 +15734,7 @@ func (x *SecurityNotificationSetting) String() string { func (*SecurityNotificationSetting) ProtoMessage() {} func (x *SecurityNotificationSetting) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[141] + mi := &file_binary_proto_def_proto_msgTypes[143] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15472,7 +15747,7 @@ func (x *SecurityNotificationSetting) ProtoReflect() protoreflect.Message { // Deprecated: Use SecurityNotificationSetting.ProtoReflect.Descriptor instead. func (*SecurityNotificationSetting) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{141} + return file_binary_proto_def_proto_rawDescGZIP(), []int{143} } func (x *SecurityNotificationSetting) GetShowNotification() bool { @@ -15493,7 +15768,7 @@ type RecentStickerWeightsAction struct { func (x *RecentStickerWeightsAction) Reset() { *x = RecentStickerWeightsAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[142] + mi := &file_binary_proto_def_proto_msgTypes[144] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15506,7 +15781,7 @@ func (x *RecentStickerWeightsAction) String() string { func (*RecentStickerWeightsAction) ProtoMessage() {} func (x *RecentStickerWeightsAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[142] + mi := &file_binary_proto_def_proto_msgTypes[144] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15519,7 +15794,7 @@ func (x *RecentStickerWeightsAction) ProtoReflect() protoreflect.Message { // Deprecated: Use RecentStickerWeightsAction.ProtoReflect.Descriptor instead. func (*RecentStickerWeightsAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{142} + return file_binary_proto_def_proto_rawDescGZIP(), []int{144} } func (x *RecentStickerWeightsAction) GetWeights() []*RecentStickerWeight { @@ -15546,7 +15821,7 @@ type RecentStickerMetadata struct { func (x *RecentStickerMetadata) Reset() { *x = RecentStickerMetadata{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[143] + mi := &file_binary_proto_def_proto_msgTypes[145] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15559,7 +15834,7 @@ func (x *RecentStickerMetadata) String() string { func (*RecentStickerMetadata) ProtoMessage() {} func (x *RecentStickerMetadata) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[143] + mi := &file_binary_proto_def_proto_msgTypes[145] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15572,7 +15847,7 @@ func (x *RecentStickerMetadata) ProtoReflect() protoreflect.Message { // Deprecated: Use RecentStickerMetadata.ProtoReflect.Descriptor instead. func (*RecentStickerMetadata) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{143} + return file_binary_proto_def_proto_rawDescGZIP(), []int{145} } func (x *RecentStickerMetadata) GetDirectPath() string { @@ -15635,7 +15910,7 @@ type RecentEmojiWeightsAction struct { func (x *RecentEmojiWeightsAction) Reset() { *x = RecentEmojiWeightsAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[144] + mi := &file_binary_proto_def_proto_msgTypes[146] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15648,7 +15923,7 @@ func (x *RecentEmojiWeightsAction) String() string { func (*RecentEmojiWeightsAction) ProtoMessage() {} func (x *RecentEmojiWeightsAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[144] + mi := &file_binary_proto_def_proto_msgTypes[146] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15661,7 +15936,7 @@ func (x *RecentEmojiWeightsAction) ProtoReflect() protoreflect.Message { // Deprecated: Use RecentEmojiWeightsAction.ProtoReflect.Descriptor instead. func (*RecentEmojiWeightsAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{144} + return file_binary_proto_def_proto_rawDescGZIP(), []int{146} } func (x *RecentEmojiWeightsAction) GetWeights() []*RecentEmojiWeight { @@ -15686,7 +15961,7 @@ type QuickReplyAction struct { func (x *QuickReplyAction) Reset() { *x = QuickReplyAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[145] + mi := &file_binary_proto_def_proto_msgTypes[147] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15699,7 +15974,7 @@ func (x *QuickReplyAction) String() string { func (*QuickReplyAction) ProtoMessage() {} func (x *QuickReplyAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[145] + mi := &file_binary_proto_def_proto_msgTypes[147] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15712,7 +15987,7 @@ func (x *QuickReplyAction) ProtoReflect() protoreflect.Message { // Deprecated: Use QuickReplyAction.ProtoReflect.Descriptor instead. func (*QuickReplyAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{145} + return file_binary_proto_def_proto_rawDescGZIP(), []int{147} } func (x *QuickReplyAction) GetShortcut() string { @@ -15761,7 +16036,7 @@ type PushNameSetting struct { func (x *PushNameSetting) Reset() { *x = PushNameSetting{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[146] + mi := &file_binary_proto_def_proto_msgTypes[148] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15774,7 +16049,7 @@ func (x *PushNameSetting) String() string { func (*PushNameSetting) ProtoMessage() {} func (x *PushNameSetting) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[146] + mi := &file_binary_proto_def_proto_msgTypes[148] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15787,7 +16062,7 @@ func (x *PushNameSetting) ProtoReflect() protoreflect.Message { // Deprecated: Use PushNameSetting.ProtoReflect.Descriptor instead. func (*PushNameSetting) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{146} + return file_binary_proto_def_proto_rawDescGZIP(), []int{148} } func (x *PushNameSetting) GetName() string { @@ -15808,7 +16083,7 @@ type PrimaryFeature struct { func (x *PrimaryFeature) Reset() { *x = PrimaryFeature{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[147] + mi := &file_binary_proto_def_proto_msgTypes[149] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15821,7 +16096,7 @@ func (x *PrimaryFeature) String() string { func (*PrimaryFeature) ProtoMessage() {} func (x *PrimaryFeature) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[147] + mi := &file_binary_proto_def_proto_msgTypes[149] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15834,7 +16109,7 @@ func (x *PrimaryFeature) ProtoReflect() protoreflect.Message { // Deprecated: Use PrimaryFeature.ProtoReflect.Descriptor instead. func (*PrimaryFeature) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{147} + return file_binary_proto_def_proto_rawDescGZIP(), []int{149} } func (x *PrimaryFeature) GetFlags() []string { @@ -15855,7 +16130,7 @@ type PinAction struct { func (x *PinAction) Reset() { *x = PinAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[148] + mi := &file_binary_proto_def_proto_msgTypes[150] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15868,7 +16143,7 @@ func (x *PinAction) String() string { func (*PinAction) ProtoMessage() {} func (x *PinAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[148] + mi := &file_binary_proto_def_proto_msgTypes[150] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15881,7 +16156,7 @@ func (x *PinAction) ProtoReflect() protoreflect.Message { // Deprecated: Use PinAction.ProtoReflect.Descriptor instead. func (*PinAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{148} + return file_binary_proto_def_proto_rawDescGZIP(), []int{150} } func (x *PinAction) GetPinned() bool { @@ -15903,7 +16178,7 @@ type MuteAction struct { func (x *MuteAction) Reset() { *x = MuteAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[149] + mi := &file_binary_proto_def_proto_msgTypes[151] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15916,7 +16191,7 @@ func (x *MuteAction) String() string { func (*MuteAction) ProtoMessage() {} func (x *MuteAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[149] + mi := &file_binary_proto_def_proto_msgTypes[151] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15929,7 +16204,7 @@ func (x *MuteAction) ProtoReflect() protoreflect.Message { // Deprecated: Use MuteAction.ProtoReflect.Descriptor instead. func (*MuteAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{149} + return file_binary_proto_def_proto_rawDescGZIP(), []int{151} } func (x *MuteAction) GetMuted() bool { @@ -15958,7 +16233,7 @@ type MarkChatAsReadAction struct { func (x *MarkChatAsReadAction) Reset() { *x = MarkChatAsReadAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[150] + mi := &file_binary_proto_def_proto_msgTypes[152] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15971,7 +16246,7 @@ func (x *MarkChatAsReadAction) String() string { func (*MarkChatAsReadAction) ProtoMessage() {} func (x *MarkChatAsReadAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[150] + mi := &file_binary_proto_def_proto_msgTypes[152] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15984,7 +16259,7 @@ func (x *MarkChatAsReadAction) ProtoReflect() protoreflect.Message { // Deprecated: Use MarkChatAsReadAction.ProtoReflect.Descriptor instead. func (*MarkChatAsReadAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{150} + return file_binary_proto_def_proto_rawDescGZIP(), []int{152} } func (x *MarkChatAsReadAction) GetRead() bool { @@ -16012,7 +16287,7 @@ type LocaleSetting struct { func (x *LocaleSetting) Reset() { *x = LocaleSetting{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[151] + mi := &file_binary_proto_def_proto_msgTypes[153] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16025,7 +16300,7 @@ func (x *LocaleSetting) String() string { func (*LocaleSetting) ProtoMessage() {} func (x *LocaleSetting) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[151] + mi := &file_binary_proto_def_proto_msgTypes[153] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16038,7 +16313,7 @@ func (x *LocaleSetting) ProtoReflect() protoreflect.Message { // Deprecated: Use LocaleSetting.ProtoReflect.Descriptor instead. func (*LocaleSetting) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{151} + return file_binary_proto_def_proto_rawDescGZIP(), []int{153} } func (x *LocaleSetting) GetLocale() string { @@ -16062,7 +16337,7 @@ type LabelEditAction struct { func (x *LabelEditAction) Reset() { *x = LabelEditAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[152] + mi := &file_binary_proto_def_proto_msgTypes[154] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16075,7 +16350,7 @@ func (x *LabelEditAction) String() string { func (*LabelEditAction) ProtoMessage() {} func (x *LabelEditAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[152] + mi := &file_binary_proto_def_proto_msgTypes[154] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16088,7 +16363,7 @@ func (x *LabelEditAction) ProtoReflect() protoreflect.Message { // Deprecated: Use LabelEditAction.ProtoReflect.Descriptor instead. func (*LabelEditAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{152} + return file_binary_proto_def_proto_rawDescGZIP(), []int{154} } func (x *LabelEditAction) GetName() string { @@ -16130,7 +16405,7 @@ type LabelAssociationAction struct { func (x *LabelAssociationAction) Reset() { *x = LabelAssociationAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[153] + mi := &file_binary_proto_def_proto_msgTypes[155] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16143,7 +16418,7 @@ func (x *LabelAssociationAction) String() string { func (*LabelAssociationAction) ProtoMessage() {} func (x *LabelAssociationAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[153] + mi := &file_binary_proto_def_proto_msgTypes[155] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16156,7 +16431,7 @@ func (x *LabelAssociationAction) ProtoReflect() protoreflect.Message { // Deprecated: Use LabelAssociationAction.ProtoReflect.Descriptor instead. func (*LabelAssociationAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{153} + return file_binary_proto_def_proto_rawDescGZIP(), []int{155} } func (x *LabelAssociationAction) GetLabeled() bool { @@ -16177,7 +16452,7 @@ type KeyExpiration struct { func (x *KeyExpiration) Reset() { *x = KeyExpiration{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[154] + mi := &file_binary_proto_def_proto_msgTypes[156] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16190,7 +16465,7 @@ func (x *KeyExpiration) String() string { func (*KeyExpiration) ProtoMessage() {} func (x *KeyExpiration) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[154] + mi := &file_binary_proto_def_proto_msgTypes[156] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16203,7 +16478,7 @@ func (x *KeyExpiration) ProtoReflect() protoreflect.Message { // Deprecated: Use KeyExpiration.ProtoReflect.Descriptor instead. func (*KeyExpiration) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{154} + return file_binary_proto_def_proto_rawDescGZIP(), []int{156} } func (x *KeyExpiration) GetExpiredKeyEpoch() int32 { @@ -16231,7 +16506,7 @@ type FavoriteStickerAction struct { func (x *FavoriteStickerAction) Reset() { *x = FavoriteStickerAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[155] + mi := &file_binary_proto_def_proto_msgTypes[157] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16244,7 +16519,7 @@ func (x *FavoriteStickerAction) String() string { func (*FavoriteStickerAction) ProtoMessage() {} func (x *FavoriteStickerAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[155] + mi := &file_binary_proto_def_proto_msgTypes[157] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16257,7 +16532,7 @@ func (x *FavoriteStickerAction) ProtoReflect() protoreflect.Message { // Deprecated: Use FavoriteStickerAction.ProtoReflect.Descriptor instead. func (*FavoriteStickerAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{155} + return file_binary_proto_def_proto_rawDescGZIP(), []int{157} } func (x *FavoriteStickerAction) GetDirectPath() string { @@ -16328,7 +16603,7 @@ type DeleteMessageForMeAction struct { func (x *DeleteMessageForMeAction) Reset() { *x = DeleteMessageForMeAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[156] + mi := &file_binary_proto_def_proto_msgTypes[158] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16341,7 +16616,7 @@ func (x *DeleteMessageForMeAction) String() string { func (*DeleteMessageForMeAction) ProtoMessage() {} func (x *DeleteMessageForMeAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[156] + mi := &file_binary_proto_def_proto_msgTypes[158] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16354,7 +16629,7 @@ func (x *DeleteMessageForMeAction) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteMessageForMeAction.ProtoReflect.Descriptor instead. func (*DeleteMessageForMeAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{156} + return file_binary_proto_def_proto_rawDescGZIP(), []int{158} } func (x *DeleteMessageForMeAction) GetDeleteMedia() bool { @@ -16382,7 +16657,7 @@ type DeleteChatAction struct { func (x *DeleteChatAction) Reset() { *x = DeleteChatAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[157] + mi := &file_binary_proto_def_proto_msgTypes[159] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16395,7 +16670,7 @@ func (x *DeleteChatAction) String() string { func (*DeleteChatAction) ProtoMessage() {} func (x *DeleteChatAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[157] + mi := &file_binary_proto_def_proto_msgTypes[159] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16408,7 +16683,7 @@ func (x *DeleteChatAction) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteChatAction.ProtoReflect.Descriptor instead. func (*DeleteChatAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{157} + return file_binary_proto_def_proto_rawDescGZIP(), []int{159} } func (x *DeleteChatAction) GetMessageRange() *SyncActionMessageRange { @@ -16430,7 +16705,7 @@ type ContactAction struct { func (x *ContactAction) Reset() { *x = ContactAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[158] + mi := &file_binary_proto_def_proto_msgTypes[160] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16443,7 +16718,7 @@ func (x *ContactAction) String() string { func (*ContactAction) ProtoMessage() {} func (x *ContactAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[158] + mi := &file_binary_proto_def_proto_msgTypes[160] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16456,7 +16731,7 @@ func (x *ContactAction) ProtoReflect() protoreflect.Message { // Deprecated: Use ContactAction.ProtoReflect.Descriptor instead. func (*ContactAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{158} + return file_binary_proto_def_proto_rawDescGZIP(), []int{160} } func (x *ContactAction) GetFullName() string { @@ -16484,7 +16759,7 @@ type ClearChatAction struct { func (x *ClearChatAction) Reset() { *x = ClearChatAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[159] + mi := &file_binary_proto_def_proto_msgTypes[161] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16497,7 +16772,7 @@ func (x *ClearChatAction) String() string { func (*ClearChatAction) ProtoMessage() {} func (x *ClearChatAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[159] + mi := &file_binary_proto_def_proto_msgTypes[161] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16510,7 +16785,7 @@ func (x *ClearChatAction) ProtoReflect() protoreflect.Message { // Deprecated: Use ClearChatAction.ProtoReflect.Descriptor instead. func (*ClearChatAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{159} + return file_binary_proto_def_proto_rawDescGZIP(), []int{161} } func (x *ClearChatAction) GetMessageRange() *SyncActionMessageRange { @@ -16532,7 +16807,7 @@ type ArchiveChatAction struct { func (x *ArchiveChatAction) Reset() { *x = ArchiveChatAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[160] + mi := &file_binary_proto_def_proto_msgTypes[162] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16545,7 +16820,7 @@ func (x *ArchiveChatAction) String() string { func (*ArchiveChatAction) ProtoMessage() {} func (x *ArchiveChatAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[160] + mi := &file_binary_proto_def_proto_msgTypes[162] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16558,7 +16833,7 @@ func (x *ArchiveChatAction) ProtoReflect() protoreflect.Message { // Deprecated: Use ArchiveChatAction.ProtoReflect.Descriptor instead. func (*ArchiveChatAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{160} + return file_binary_proto_def_proto_rawDescGZIP(), []int{162} } func (x *ArchiveChatAction) GetArchived() bool { @@ -16586,7 +16861,7 @@ type AndroidUnsupportedActions struct { func (x *AndroidUnsupportedActions) Reset() { *x = AndroidUnsupportedActions{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[161] + mi := &file_binary_proto_def_proto_msgTypes[163] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16599,7 +16874,7 @@ func (x *AndroidUnsupportedActions) String() string { func (*AndroidUnsupportedActions) ProtoMessage() {} func (x *AndroidUnsupportedActions) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[161] + mi := &file_binary_proto_def_proto_msgTypes[163] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16612,7 +16887,7 @@ func (x *AndroidUnsupportedActions) ProtoReflect() protoreflect.Message { // Deprecated: Use AndroidUnsupportedActions.ProtoReflect.Descriptor instead. func (*AndroidUnsupportedActions) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{161} + return file_binary_proto_def_proto_rawDescGZIP(), []int{163} } func (x *AndroidUnsupportedActions) GetAllowed() bool { @@ -16635,7 +16910,7 @@ type AgentAction struct { func (x *AgentAction) Reset() { *x = AgentAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[162] + mi := &file_binary_proto_def_proto_msgTypes[164] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16648,7 +16923,7 @@ func (x *AgentAction) String() string { func (*AgentAction) ProtoMessage() {} func (x *AgentAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[162] + mi := &file_binary_proto_def_proto_msgTypes[164] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16661,7 +16936,7 @@ func (x *AgentAction) ProtoReflect() protoreflect.Message { // Deprecated: Use AgentAction.ProtoReflect.Descriptor instead. func (*AgentAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{162} + return file_binary_proto_def_proto_rawDescGZIP(), []int{164} } func (x *AgentAction) GetName() string { @@ -16699,7 +16974,7 @@ type SyncActionData struct { func (x *SyncActionData) Reset() { *x = SyncActionData{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[163] + mi := &file_binary_proto_def_proto_msgTypes[165] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16712,7 +16987,7 @@ func (x *SyncActionData) String() string { func (*SyncActionData) ProtoMessage() {} func (x *SyncActionData) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[163] + mi := &file_binary_proto_def_proto_msgTypes[165] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16725,7 +17000,7 @@ func (x *SyncActionData) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncActionData.ProtoReflect.Descriptor instead. func (*SyncActionData) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{163} + return file_binary_proto_def_proto_rawDescGZIP(), []int{165} } func (x *SyncActionData) GetIndex() []byte { @@ -16768,7 +17043,7 @@ type RecentStickerWeight struct { func (x *RecentStickerWeight) Reset() { *x = RecentStickerWeight{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[164] + mi := &file_binary_proto_def_proto_msgTypes[166] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16781,7 +17056,7 @@ func (x *RecentStickerWeight) String() string { func (*RecentStickerWeight) ProtoMessage() {} func (x *RecentStickerWeight) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[164] + mi := &file_binary_proto_def_proto_msgTypes[166] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16794,7 +17069,7 @@ func (x *RecentStickerWeight) ProtoReflect() protoreflect.Message { // Deprecated: Use RecentStickerWeight.ProtoReflect.Descriptor instead. func (*RecentStickerWeight) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{164} + return file_binary_proto_def_proto_rawDescGZIP(), []int{166} } func (x *RecentStickerWeight) GetFilehash() string { @@ -16823,7 +17098,7 @@ type RecentEmojiWeight struct { func (x *RecentEmojiWeight) Reset() { *x = RecentEmojiWeight{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[165] + mi := &file_binary_proto_def_proto_msgTypes[167] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16836,7 +17111,7 @@ func (x *RecentEmojiWeight) String() string { func (*RecentEmojiWeight) ProtoMessage() {} func (x *RecentEmojiWeight) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[165] + mi := &file_binary_proto_def_proto_msgTypes[167] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16849,7 +17124,7 @@ func (x *RecentEmojiWeight) ProtoReflect() protoreflect.Message { // Deprecated: Use RecentEmojiWeight.ProtoReflect.Descriptor instead. func (*RecentEmojiWeight) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{165} + return file_binary_proto_def_proto_rawDescGZIP(), []int{167} } func (x *RecentEmojiWeight) GetEmoji() string { @@ -16879,7 +17154,7 @@ type VerifiedNameCertificate struct { func (x *VerifiedNameCertificate) Reset() { *x = VerifiedNameCertificate{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[166] + mi := &file_binary_proto_def_proto_msgTypes[168] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16892,7 +17167,7 @@ func (x *VerifiedNameCertificate) String() string { func (*VerifiedNameCertificate) ProtoMessage() {} func (x *VerifiedNameCertificate) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[166] + mi := &file_binary_proto_def_proto_msgTypes[168] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16905,7 +17180,7 @@ func (x *VerifiedNameCertificate) ProtoReflect() protoreflect.Message { // Deprecated: Use VerifiedNameCertificate.ProtoReflect.Descriptor instead. func (*VerifiedNameCertificate) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{166} + return file_binary_proto_def_proto_rawDescGZIP(), []int{168} } func (x *VerifiedNameCertificate) GetDetails() []byte { @@ -16945,7 +17220,7 @@ type VerifiedNameDetails struct { func (x *VerifiedNameDetails) Reset() { *x = VerifiedNameDetails{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[167] + mi := &file_binary_proto_def_proto_msgTypes[169] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16958,7 +17233,7 @@ func (x *VerifiedNameDetails) String() string { func (*VerifiedNameDetails) ProtoMessage() {} func (x *VerifiedNameDetails) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[167] + mi := &file_binary_proto_def_proto_msgTypes[169] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16971,7 +17246,7 @@ func (x *VerifiedNameDetails) ProtoReflect() protoreflect.Message { // Deprecated: Use VerifiedNameDetails.ProtoReflect.Descriptor instead. func (*VerifiedNameDetails) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{167} + return file_binary_proto_def_proto_rawDescGZIP(), []int{169} } func (x *VerifiedNameDetails) GetSerial() uint64 { @@ -17022,7 +17297,7 @@ type LocalizedName struct { func (x *LocalizedName) Reset() { *x = LocalizedName{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[168] + mi := &file_binary_proto_def_proto_msgTypes[170] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17035,7 +17310,7 @@ func (x *LocalizedName) String() string { func (*LocalizedName) ProtoMessage() {} func (x *LocalizedName) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[168] + mi := &file_binary_proto_def_proto_msgTypes[170] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17048,7 +17323,7 @@ func (x *LocalizedName) ProtoReflect() protoreflect.Message { // Deprecated: Use LocalizedName.ProtoReflect.Descriptor instead. func (*LocalizedName) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{168} + return file_binary_proto_def_proto_rawDescGZIP(), []int{170} } func (x *LocalizedName) GetLg() string { @@ -17090,7 +17365,7 @@ type BizIdentityInfo struct { func (x *BizIdentityInfo) Reset() { *x = BizIdentityInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[169] + mi := &file_binary_proto_def_proto_msgTypes[171] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17103,7 +17378,7 @@ func (x *BizIdentityInfo) String() string { func (*BizIdentityInfo) ProtoMessage() {} func (x *BizIdentityInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[169] + mi := &file_binary_proto_def_proto_msgTypes[171] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17116,7 +17391,7 @@ func (x *BizIdentityInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use BizIdentityInfo.ProtoReflect.Descriptor instead. func (*BizIdentityInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{169} + return file_binary_proto_def_proto_rawDescGZIP(), []int{171} } func (x *BizIdentityInfo) GetVlevel() BizIdentityInfo_BizIdentityInfoVerifiedLevelValue { @@ -17187,7 +17462,7 @@ type BizAccountPayload struct { func (x *BizAccountPayload) Reset() { *x = BizAccountPayload{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[170] + mi := &file_binary_proto_def_proto_msgTypes[172] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17200,7 +17475,7 @@ func (x *BizAccountPayload) String() string { func (*BizAccountPayload) ProtoMessage() {} func (x *BizAccountPayload) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[170] + mi := &file_binary_proto_def_proto_msgTypes[172] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17213,7 +17488,7 @@ func (x *BizAccountPayload) ProtoReflect() protoreflect.Message { // Deprecated: Use BizAccountPayload.ProtoReflect.Descriptor instead. func (*BizAccountPayload) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{170} + return file_binary_proto_def_proto_rawDescGZIP(), []int{172} } func (x *BizAccountPayload) GetVnameCert() *VerifiedNameCertificate { @@ -17245,7 +17520,7 @@ type BizAccountLinkInfo struct { func (x *BizAccountLinkInfo) Reset() { *x = BizAccountLinkInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[171] + mi := &file_binary_proto_def_proto_msgTypes[173] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17258,7 +17533,7 @@ func (x *BizAccountLinkInfo) String() string { func (*BizAccountLinkInfo) ProtoMessage() {} func (x *BizAccountLinkInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[171] + mi := &file_binary_proto_def_proto_msgTypes[173] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17271,7 +17546,7 @@ func (x *BizAccountLinkInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use BizAccountLinkInfo.ProtoReflect.Descriptor instead. func (*BizAccountLinkInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{171} + return file_binary_proto_def_proto_rawDescGZIP(), []int{173} } func (x *BizAccountLinkInfo) GetWhatsappBizAcctFbid() uint64 { @@ -17309,32 +17584,33 @@ func (x *BizAccountLinkInfo) GetAccountType() BizAccountLinkInfo_BizAccountLinkI return BizAccountLinkInfo_ENTERPRISE } -type NoiseCertificate struct { +type HandshakeMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Details []byte `protobuf:"bytes,1,opt,name=details" json:"details,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` + ClientHello *ClientHello `protobuf:"bytes,2,opt,name=clientHello" json:"clientHello,omitempty"` + ServerHello *ServerHello `protobuf:"bytes,3,opt,name=serverHello" json:"serverHello,omitempty"` + ClientFinish *ClientFinish `protobuf:"bytes,4,opt,name=clientFinish" json:"clientFinish,omitempty"` } -func (x *NoiseCertificate) Reset() { - *x = NoiseCertificate{} +func (x *HandshakeMessage) Reset() { + *x = HandshakeMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[172] + mi := &file_binary_proto_def_proto_msgTypes[174] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *NoiseCertificate) String() string { +func (x *HandshakeMessage) String() string { return protoimpl.X.MessageStringOf(x) } -func (*NoiseCertificate) ProtoMessage() {} +func (*HandshakeMessage) ProtoMessage() {} -func (x *NoiseCertificate) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[172] +func (x *HandshakeMessage) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[174] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17345,55 +17621,59 @@ func (x *NoiseCertificate) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use NoiseCertificate.ProtoReflect.Descriptor instead. -func (*NoiseCertificate) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{172} +// Deprecated: Use HandshakeMessage.ProtoReflect.Descriptor instead. +func (*HandshakeMessage) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{174} } -func (x *NoiseCertificate) GetDetails() []byte { +func (x *HandshakeMessage) GetClientHello() *ClientHello { if x != nil { - return x.Details + return x.ClientHello } return nil } -func (x *NoiseCertificate) GetSignature() []byte { +func (x *HandshakeMessage) GetServerHello() *ServerHello { if x != nil { - return x.Signature + return x.ServerHello } return nil } -// Renamed from NoiseCertificate$Details -type NoiseCertificateDetails struct { +func (x *HandshakeMessage) GetClientFinish() *ClientFinish { + if x != nil { + return x.ClientFinish + } + return nil +} + +type ServerHello struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Serial *uint32 `protobuf:"varint,1,opt,name=serial" json:"serial,omitempty"` - Issuer *string `protobuf:"bytes,2,opt,name=issuer" json:"issuer,omitempty"` - Expires *uint64 `protobuf:"varint,3,opt,name=expires" json:"expires,omitempty"` - Subject *string `protobuf:"bytes,4,opt,name=subject" json:"subject,omitempty"` - Key []byte `protobuf:"bytes,5,opt,name=key" json:"key,omitempty"` + Ephemeral []byte `protobuf:"bytes,1,opt,name=ephemeral" json:"ephemeral,omitempty"` + Static []byte `protobuf:"bytes,2,opt,name=static" json:"static,omitempty"` + Payload []byte `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` } -func (x *NoiseCertificateDetails) Reset() { - *x = NoiseCertificateDetails{} +func (x *ServerHello) Reset() { + *x = ServerHello{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[173] + mi := &file_binary_proto_def_proto_msgTypes[175] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *NoiseCertificateDetails) String() string { +func (x *ServerHello) String() string { return protoimpl.X.MessageStringOf(x) } -func (*NoiseCertificateDetails) ProtoMessage() {} +func (*ServerHello) ProtoMessage() {} -func (x *NoiseCertificateDetails) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[173] +func (x *ServerHello) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[175] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17404,170 +17684,30 @@ func (x *NoiseCertificateDetails) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use NoiseCertificateDetails.ProtoReflect.Descriptor instead. -func (*NoiseCertificateDetails) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{173} +// Deprecated: Use ServerHello.ProtoReflect.Descriptor instead. +func (*ServerHello) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{175} } -func (x *NoiseCertificateDetails) GetSerial() uint32 { - if x != nil && x.Serial != nil { - return *x.Serial +func (x *ServerHello) GetEphemeral() []byte { + if x != nil { + return x.Ephemeral } - return 0 + return nil } -func (x *NoiseCertificateDetails) GetIssuer() string { - if x != nil && x.Issuer != nil { - return *x.Issuer +func (x *ServerHello) GetStatic() []byte { + if x != nil { + return x.Static } - return "" + return nil } -func (x *NoiseCertificateDetails) GetExpires() uint64 { - if x != nil && x.Expires != nil { - return *x.Expires +func (x *ServerHello) GetPayload() []byte { + if x != nil { + return x.Payload } - return 0 -} - -func (x *NoiseCertificateDetails) GetSubject() string { - if x != nil && x.Subject != nil { - return *x.Subject - } - return "" -} - -func (x *NoiseCertificateDetails) GetKey() []byte { - if x != nil { - return x.Key - } - return nil -} - -type HandshakeMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ClientHello *ClientHello `protobuf:"bytes,2,opt,name=clientHello" json:"clientHello,omitempty"` - ServerHello *ServerHello `protobuf:"bytes,3,opt,name=serverHello" json:"serverHello,omitempty"` - ClientFinish *ClientFinish `protobuf:"bytes,4,opt,name=clientFinish" json:"clientFinish,omitempty"` -} - -func (x *HandshakeMessage) Reset() { - *x = HandshakeMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[174] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HandshakeMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HandshakeMessage) ProtoMessage() {} - -func (x *HandshakeMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[174] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HandshakeMessage.ProtoReflect.Descriptor instead. -func (*HandshakeMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{174} -} - -func (x *HandshakeMessage) GetClientHello() *ClientHello { - if x != nil { - return x.ClientHello - } - return nil -} - -func (x *HandshakeMessage) GetServerHello() *ServerHello { - if x != nil { - return x.ServerHello - } - return nil -} - -func (x *HandshakeMessage) GetClientFinish() *ClientFinish { - if x != nil { - return x.ClientFinish - } - return nil -} - -type ServerHello struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Ephemeral []byte `protobuf:"bytes,1,opt,name=ephemeral" json:"ephemeral,omitempty"` - Static []byte `protobuf:"bytes,2,opt,name=static" json:"static,omitempty"` - Payload []byte `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` -} - -func (x *ServerHello) Reset() { - *x = ServerHello{} - if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[175] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServerHello) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerHello) ProtoMessage() {} - -func (x *ServerHello) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[175] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServerHello.ProtoReflect.Descriptor instead. -func (*ServerHello) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{175} -} - -func (x *ServerHello) GetEphemeral() []byte { - if x != nil { - return x.Ephemeral - } - return nil -} - -func (x *ServerHello) GetStatic() []byte { - if x != nil { - return x.Static - } - return nil -} - -func (x *ServerHello) GetPayload() []byte { - if x != nil { - return x.Payload - } - return nil + return nil } type ClientHello struct { @@ -18526,6 +18666,7 @@ type WebMessageInfo struct { AgentId *string `protobuf:"bytes,47,opt,name=agentId" json:"agentId,omitempty"` StatusAlreadyViewed *bool `protobuf:"varint,48,opt,name=statusAlreadyViewed" json:"statusAlreadyViewed,omitempty"` MessageSecret []byte `protobuf:"bytes,49,opt,name=messageSecret" json:"messageSecret,omitempty"` + KeepInChat *KeepInChat `protobuf:"bytes,50,opt,name=keepInChat" json:"keepInChat,omitempty"` } func (x *WebMessageInfo) Reset() { @@ -18840,6 +18981,13 @@ func (x *WebMessageInfo) GetMessageSecret() []byte { return nil } +func (x *WebMessageInfo) GetKeepInChat() *KeepInChat { + if x != nil { + return x.KeepInChat + } + return nil +} + type WebFeatures struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -19871,19 +20019,408 @@ func (x *MediaData) ProtoReflect() protoreflect.Message { } return ms } - return mi.MessageOf(x) + return mi.MessageOf(x) +} + +// Deprecated: Use MediaData.ProtoReflect.Descriptor instead. +func (*MediaData) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{195} +} + +func (x *MediaData) GetLocalPath() string { + if x != nil && x.LocalPath != nil { + return *x.LocalPath + } + return "" +} + +type KeepInChat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KeepType *KeepType `protobuf:"varint,1,opt,name=keepType,enum=proto.KeepType" json:"keepType,omitempty"` + ServerTimestamp *int64 `protobuf:"varint,2,opt,name=serverTimestamp" json:"serverTimestamp,omitempty"` + DeviceJid *string `protobuf:"bytes,3,opt,name=deviceJid" json:"deviceJid,omitempty"` +} + +func (x *KeepInChat) Reset() { + *x = KeepInChat{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[196] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepInChat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepInChat) ProtoMessage() {} + +func (x *KeepInChat) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[196] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KeepInChat.ProtoReflect.Descriptor instead. +func (*KeepInChat) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{196} +} + +func (x *KeepInChat) GetKeepType() KeepType { + if x != nil && x.KeepType != nil { + return *x.KeepType + } + return KeepType_UNKNOWN +} + +func (x *KeepInChat) GetServerTimestamp() int64 { + if x != nil && x.ServerTimestamp != nil { + return *x.ServerTimestamp + } + return 0 +} + +func (x *KeepInChat) GetDeviceJid() string { + if x != nil && x.DeviceJid != nil { + return *x.DeviceJid + } + return "" +} + +type NoiseCertificate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Details []byte `protobuf:"bytes,1,opt,name=details" json:"details,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` +} + +func (x *NoiseCertificate) Reset() { + *x = NoiseCertificate{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[197] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NoiseCertificate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NoiseCertificate) ProtoMessage() {} + +func (x *NoiseCertificate) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[197] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NoiseCertificate.ProtoReflect.Descriptor instead. +func (*NoiseCertificate) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{197} +} + +func (x *NoiseCertificate) GetDetails() []byte { + if x != nil { + return x.Details + } + return nil +} + +func (x *NoiseCertificate) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +// Renamed from NoiseCertificate$Details +type NoiseCertificateDetails struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Serial *uint32 `protobuf:"varint,1,opt,name=serial" json:"serial,omitempty"` + Issuer *string `protobuf:"bytes,2,opt,name=issuer" json:"issuer,omitempty"` + Expires *uint64 `protobuf:"varint,3,opt,name=expires" json:"expires,omitempty"` + Subject *string `protobuf:"bytes,4,opt,name=subject" json:"subject,omitempty"` + Key []byte `protobuf:"bytes,5,opt,name=key" json:"key,omitempty"` +} + +func (x *NoiseCertificateDetails) Reset() { + *x = NoiseCertificateDetails{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[198] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NoiseCertificateDetails) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NoiseCertificateDetails) ProtoMessage() {} + +func (x *NoiseCertificateDetails) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[198] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NoiseCertificateDetails.ProtoReflect.Descriptor instead. +func (*NoiseCertificateDetails) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{198} +} + +func (x *NoiseCertificateDetails) GetSerial() uint32 { + if x != nil && x.Serial != nil { + return *x.Serial + } + return 0 +} + +func (x *NoiseCertificateDetails) GetIssuer() string { + if x != nil && x.Issuer != nil { + return *x.Issuer + } + return "" +} + +func (x *NoiseCertificateDetails) GetExpires() uint64 { + if x != nil && x.Expires != nil { + return *x.Expires + } + return 0 +} + +func (x *NoiseCertificateDetails) GetSubject() string { + if x != nil && x.Subject != nil { + return *x.Subject + } + return "" +} + +func (x *NoiseCertificateDetails) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +type CertChain struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Leaf *CertChainNoiseCertificate `protobuf:"bytes,1,opt,name=leaf" json:"leaf,omitempty"` + Intermediate *CertChainNoiseCertificate `protobuf:"bytes,2,opt,name=intermediate" json:"intermediate,omitempty"` +} + +func (x *CertChain) Reset() { + *x = CertChain{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[199] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CertChain) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CertChain) ProtoMessage() {} + +func (x *CertChain) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[199] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CertChain.ProtoReflect.Descriptor instead. +func (*CertChain) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{199} +} + +func (x *CertChain) GetLeaf() *CertChainNoiseCertificate { + if x != nil { + return x.Leaf + } + return nil +} + +func (x *CertChain) GetIntermediate() *CertChainNoiseCertificate { + if x != nil { + return x.Intermediate + } + return nil +} + +// Renamed from CertChain$NoiseCertificate +type CertChainNoiseCertificate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Details []byte `protobuf:"bytes,1,opt,name=details" json:"details,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` +} + +func (x *CertChainNoiseCertificate) Reset() { + *x = CertChainNoiseCertificate{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[200] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CertChainNoiseCertificate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CertChainNoiseCertificate) ProtoMessage() {} + +func (x *CertChainNoiseCertificate) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[200] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CertChainNoiseCertificate.ProtoReflect.Descriptor instead. +func (*CertChainNoiseCertificate) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{200} +} + +func (x *CertChainNoiseCertificate) GetDetails() []byte { + if x != nil { + return x.Details + } + return nil +} + +func (x *CertChainNoiseCertificate) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +// Renamed from CertChain$NoiseCertificate$Details +type CertChainNoiseCertificateDetails struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Serial *uint32 `protobuf:"varint,1,opt,name=serial" json:"serial,omitempty"` + IssuerSerial *uint32 `protobuf:"varint,2,opt,name=issuerSerial" json:"issuerSerial,omitempty"` + Key []byte `protobuf:"bytes,3,opt,name=key" json:"key,omitempty"` + NotBefore *uint64 `protobuf:"varint,4,opt,name=notBefore" json:"notBefore,omitempty"` + NotAfter *uint64 `protobuf:"varint,5,opt,name=notAfter" json:"notAfter,omitempty"` +} + +func (x *CertChainNoiseCertificateDetails) Reset() { + *x = CertChainNoiseCertificateDetails{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[201] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CertChainNoiseCertificateDetails) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CertChainNoiseCertificateDetails) ProtoMessage() {} + +func (x *CertChainNoiseCertificateDetails) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[201] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CertChainNoiseCertificateDetails.ProtoReflect.Descriptor instead. +func (*CertChainNoiseCertificateDetails) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{201} +} + +func (x *CertChainNoiseCertificateDetails) GetSerial() uint32 { + if x != nil && x.Serial != nil { + return *x.Serial + } + return 0 +} + +func (x *CertChainNoiseCertificateDetails) GetIssuerSerial() uint32 { + if x != nil && x.IssuerSerial != nil { + return *x.IssuerSerial + } + return 0 } -// Deprecated: Use MediaData.ProtoReflect.Descriptor instead. -func (*MediaData) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{195} +func (x *CertChainNoiseCertificateDetails) GetKey() []byte { + if x != nil { + return x.Key + } + return nil } -func (x *MediaData) GetLocalPath() string { - if x != nil && x.LocalPath != nil { - return *x.LocalPath +func (x *CertChainNoiseCertificateDetails) GetNotBefore() uint64 { + if x != nil && x.NotBefore != nil { + return *x.NotBefore } - return "" + return 0 +} + +func (x *CertChainNoiseCertificateDetails) GetNotAfter() uint64 { + if x != nil && x.NotAfter != nil { + return *x.NotAfter + } + return 0 } var File_binary_proto_def_proto protoreflect.FileDescriptor @@ -19903,12 +20440,12 @@ func file_binary_proto_def_proto_rawDescGZIP() []byte { return file_binary_proto_def_proto_rawDescData } -var file_binary_proto_def_proto_enumTypes = make([]protoimpl.EnumInfo, 50) -var file_binary_proto_def_proto_msgTypes = make([]protoimpl.MessageInfo, 196) +var file_binary_proto_def_proto_enumTypes = make([]protoimpl.EnumInfo, 51) +var file_binary_proto_def_proto_msgTypes = make([]protoimpl.MessageInfo, 202) var file_binary_proto_def_proto_goTypes = []interface{}{ - (MediaVisibility)(0), // 0: proto.MediaVisibility - (CompanionProps_CompanionPropsPlatformType)(0), // 1: proto.CompanionProps.CompanionPropsPlatformType - (ProtocolMessage_ProtocolMessageType)(0), // 2: proto.ProtocolMessage.ProtocolMessageType + (KeepType)(0), // 0: proto.KeepType + (MediaVisibility)(0), // 1: proto.MediaVisibility + (DeviceProps_DevicePropsPlatformType)(0), // 2: proto.DeviceProps.DevicePropsPlatformType (PaymentInviteMessage_PaymentInviteMessageServiceType)(0), // 3: proto.PaymentInviteMessage.PaymentInviteMessageServiceType (OrderMessage_OrderMessageOrderStatus)(0), // 4: proto.OrderMessage.OrderMessageOrderStatus (OrderMessage_OrderMessageOrderSurface)(0), // 5: proto.OrderMessage.OrderMessageOrderSurface @@ -19931,44 +20468,44 @@ var file_binary_proto_def_proto_goTypes = []interface{}{ (AdReplyInfo_AdReplyInfoMediaType)(0), // 22: proto.AdReplyInfo.AdReplyInfoMediaType (PaymentBackground_PaymentBackgroundType)(0), // 23: proto.PaymentBackground.PaymentBackgroundType (VideoMessage_VideoMessageAttribution)(0), // 24: proto.VideoMessage.VideoMessageAttribution - (HistorySync_HistorySyncHistorySyncType)(0), // 25: proto.HistorySync.HistorySyncHistorySyncType - (GroupParticipant_GroupParticipantRank)(0), // 26: proto.GroupParticipant.GroupParticipantRank - (Conversation_ConversationEndOfHistoryTransferType)(0), // 27: proto.Conversation.ConversationEndOfHistoryTransferType - (MediaRetryNotification_MediaRetryNotificationResultType)(0), // 28: proto.MediaRetryNotification.MediaRetryNotificationResultType - (SyncdMutation_SyncdMutationSyncdOperation)(0), // 29: proto.SyncdMutation.SyncdMutationSyncdOperation - (BizIdentityInfo_BizIdentityInfoVerifiedLevelValue)(0), // 30: proto.BizIdentityInfo.BizIdentityInfoVerifiedLevelValue - (BizIdentityInfo_BizIdentityInfoHostStorageType)(0), // 31: proto.BizIdentityInfo.BizIdentityInfoHostStorageType - (BizIdentityInfo_BizIdentityInfoActualActorsType)(0), // 32: proto.BizIdentityInfo.BizIdentityInfoActualActorsType - (BizAccountLinkInfo_BizAccountLinkInfoHostStorageType)(0), // 33: proto.BizAccountLinkInfo.BizAccountLinkInfoHostStorageType - (BizAccountLinkInfo_BizAccountLinkInfoAccountType)(0), // 34: proto.BizAccountLinkInfo.BizAccountLinkInfoAccountType - (ClientPayload_ClientPayloadConnectType)(0), // 35: proto.ClientPayload.ClientPayloadConnectType - (ClientPayload_ClientPayloadConnectReason)(0), // 36: proto.ClientPayload.ClientPayloadConnectReason - (ClientPayload_ClientPayloadProduct)(0), // 37: proto.ClientPayload.ClientPayloadProduct - (ClientPayload_ClientPayloadIOSAppExtension)(0), // 38: proto.ClientPayload.ClientPayloadIOSAppExtension - (WebInfo_WebInfoWebSubPlatform)(0), // 39: proto.WebInfo.WebInfoWebSubPlatform - (UserAgent_UserAgentPlatform)(0), // 40: proto.UserAgent.UserAgentPlatform - (UserAgent_UserAgentReleaseChannel)(0), // 41: proto.UserAgent.UserAgentReleaseChannel - (DNSSource_DNSSourceDNSResolutionMethod)(0), // 42: proto.DNSSource.DNSSourceDNSResolutionMethod - (WebMessageInfo_WebMessageInfoStatus)(0), // 43: proto.WebMessageInfo.WebMessageInfoStatus - (WebMessageInfo_WebMessageInfoStubType)(0), // 44: proto.WebMessageInfo.WebMessageInfoStubType - (WebMessageInfo_WebMessageInfoBizPrivacyStatus)(0), // 45: proto.WebMessageInfo.WebMessageInfoBizPrivacyStatus - (WebFeatures_WebFeaturesFlag)(0), // 46: proto.WebFeatures.WebFeaturesFlag - (PaymentInfo_PaymentInfoCurrency)(0), // 47: proto.PaymentInfo.PaymentInfoCurrency - (PaymentInfo_PaymentInfoStatus)(0), // 48: proto.PaymentInfo.PaymentInfoStatus - (PaymentInfo_PaymentInfoTxnStatus)(0), // 49: proto.PaymentInfo.PaymentInfoTxnStatus - (*ADVSignedKeyIndexList)(nil), // 50: proto.ADVSignedKeyIndexList - (*ADVSignedDeviceIdentity)(nil), // 51: proto.ADVSignedDeviceIdentity - (*ADVSignedDeviceIdentityHMAC)(nil), // 52: proto.ADVSignedDeviceIdentityHMAC - (*ADVKeyIndexList)(nil), // 53: proto.ADVKeyIndexList - (*ADVDeviceIdentity)(nil), // 54: proto.ADVDeviceIdentity - (*CompanionProps)(nil), // 55: proto.CompanionProps - (*AppVersion)(nil), // 56: proto.AppVersion - (*ProtocolMessage)(nil), // 57: proto.ProtocolMessage - (*ProductMessage)(nil), // 58: proto.ProductMessage - (*ProductSnapshot)(nil), // 59: proto.ProductSnapshot - (*CatalogSnapshot)(nil), // 60: proto.CatalogSnapshot - (*PollVoteMessage)(nil), // 61: proto.PollVoteMessage - (*PollUpdateMessage)(nil), // 62: proto.PollUpdateMessage + (ProtocolMessage_ProtocolMessageType)(0), // 25: proto.ProtocolMessage.ProtocolMessageType + (HistorySync_HistorySyncHistorySyncType)(0), // 26: proto.HistorySync.HistorySyncHistorySyncType + (GroupParticipant_GroupParticipantRank)(0), // 27: proto.GroupParticipant.GroupParticipantRank + (Conversation_ConversationEndOfHistoryTransferType)(0), // 28: proto.Conversation.ConversationEndOfHistoryTransferType + (MediaRetryNotification_MediaRetryNotificationResultType)(0), // 29: proto.MediaRetryNotification.MediaRetryNotificationResultType + (SyncdMutation_SyncdMutationSyncdOperation)(0), // 30: proto.SyncdMutation.SyncdMutationSyncdOperation + (BizIdentityInfo_BizIdentityInfoVerifiedLevelValue)(0), // 31: proto.BizIdentityInfo.BizIdentityInfoVerifiedLevelValue + (BizIdentityInfo_BizIdentityInfoHostStorageType)(0), // 32: proto.BizIdentityInfo.BizIdentityInfoHostStorageType + (BizIdentityInfo_BizIdentityInfoActualActorsType)(0), // 33: proto.BizIdentityInfo.BizIdentityInfoActualActorsType + (BizAccountLinkInfo_BizAccountLinkInfoHostStorageType)(0), // 34: proto.BizAccountLinkInfo.BizAccountLinkInfoHostStorageType + (BizAccountLinkInfo_BizAccountLinkInfoAccountType)(0), // 35: proto.BizAccountLinkInfo.BizAccountLinkInfoAccountType + (ClientPayload_ClientPayloadConnectType)(0), // 36: proto.ClientPayload.ClientPayloadConnectType + (ClientPayload_ClientPayloadConnectReason)(0), // 37: proto.ClientPayload.ClientPayloadConnectReason + (ClientPayload_ClientPayloadProduct)(0), // 38: proto.ClientPayload.ClientPayloadProduct + (ClientPayload_ClientPayloadIOSAppExtension)(0), // 39: proto.ClientPayload.ClientPayloadIOSAppExtension + (WebInfo_WebInfoWebSubPlatform)(0), // 40: proto.WebInfo.WebInfoWebSubPlatform + (UserAgent_UserAgentPlatform)(0), // 41: proto.UserAgent.UserAgentPlatform + (UserAgent_UserAgentReleaseChannel)(0), // 42: proto.UserAgent.UserAgentReleaseChannel + (DNSSource_DNSSourceDNSResolutionMethod)(0), // 43: proto.DNSSource.DNSSourceDNSResolutionMethod + (WebMessageInfo_WebMessageInfoStatus)(0), // 44: proto.WebMessageInfo.WebMessageInfoStatus + (WebMessageInfo_WebMessageInfoStubType)(0), // 45: proto.WebMessageInfo.WebMessageInfoStubType + (WebMessageInfo_WebMessageInfoBizPrivacyStatus)(0), // 46: proto.WebMessageInfo.WebMessageInfoBizPrivacyStatus + (WebFeatures_WebFeaturesFlag)(0), // 47: proto.WebFeatures.WebFeaturesFlag + (PaymentInfo_PaymentInfoCurrency)(0), // 48: proto.PaymentInfo.PaymentInfoCurrency + (PaymentInfo_PaymentInfoStatus)(0), // 49: proto.PaymentInfo.PaymentInfoStatus + (PaymentInfo_PaymentInfoTxnStatus)(0), // 50: proto.PaymentInfo.PaymentInfoTxnStatus + (*ADVSignedKeyIndexList)(nil), // 51: proto.ADVSignedKeyIndexList + (*ADVSignedDeviceIdentity)(nil), // 52: proto.ADVSignedDeviceIdentity + (*ADVSignedDeviceIdentityHMAC)(nil), // 53: proto.ADVSignedDeviceIdentityHMAC + (*ADVKeyIndexList)(nil), // 54: proto.ADVKeyIndexList + (*ADVDeviceIdentity)(nil), // 55: proto.ADVDeviceIdentity + (*DeviceProps)(nil), // 56: proto.DeviceProps + (*AppVersion)(nil), // 57: proto.AppVersion + (*ProductSnapshot)(nil), // 58: proto.ProductSnapshot + (*CatalogSnapshot)(nil), // 59: proto.CatalogSnapshot + (*PollVoteMessage)(nil), // 60: proto.PollVoteMessage + (*PollUpdateMessage)(nil), // 61: proto.PollUpdateMessage + (*PollUpdateMessageMetadata)(nil), // 62: proto.PollUpdateMessageMetadata (*PollEncValue)(nil), // 63: proto.PollEncValue (*PollCreationMessage)(nil), // 64: proto.PollCreationMessage (*Option)(nil), // 65: proto.Option @@ -19985,542 +20522,557 @@ var file_binary_proto_def_proto_goTypes = []interface{}{ (*ProductSection)(nil), // 76: proto.ProductSection (*ProductListInfo)(nil), // 77: proto.ProductListInfo (*ProductListHeaderImage)(nil), // 78: proto.ProductListHeaderImage - (*InvoiceMessage)(nil), // 79: proto.InvoiceMessage - (*InteractiveResponseMessage)(nil), // 80: proto.InteractiveResponseMessage - (*NativeFlowResponseMessage)(nil), // 81: proto.NativeFlowResponseMessage - (*InteractiveResponseMessageBody)(nil), // 82: proto.InteractiveResponseMessageBody - (*InteractiveMessage)(nil), // 83: proto.InteractiveMessage - (*ShopMessage)(nil), // 84: proto.ShopMessage - (*NativeFlowMessage)(nil), // 85: proto.NativeFlowMessage - (*NativeFlowButton)(nil), // 86: proto.NativeFlowButton - (*Header)(nil), // 87: proto.Header - (*Footer)(nil), // 88: proto.Footer - (*CollectionMessage)(nil), // 89: proto.CollectionMessage - (*InteractiveMessageBody)(nil), // 90: proto.InteractiveMessageBody - (*InitialSecurityNotificationSettingSync)(nil), // 91: proto.InitialSecurityNotificationSettingSync - (*ImageMessage)(nil), // 92: proto.ImageMessage - (*HistorySyncNotification)(nil), // 93: proto.HistorySyncNotification - (*HighlyStructuredMessage)(nil), // 94: proto.HighlyStructuredMessage - (*HSMLocalizableParameter)(nil), // 95: proto.HSMLocalizableParameter - (*HSMDateTime)(nil), // 96: proto.HSMDateTime - (*HSMDateTimeUnixEpoch)(nil), // 97: proto.HSMDateTimeUnixEpoch - (*HSMDateTimeComponent)(nil), // 98: proto.HSMDateTimeComponent - (*HSMCurrency)(nil), // 99: proto.HSMCurrency - (*GroupInviteMessage)(nil), // 100: proto.GroupInviteMessage - (*FutureProofMessage)(nil), // 101: proto.FutureProofMessage - (*ExtendedTextMessage)(nil), // 102: proto.ExtendedTextMessage - (*DocumentMessage)(nil), // 103: proto.DocumentMessage - (*DeviceSentMessage)(nil), // 104: proto.DeviceSentMessage - (*DeclinePaymentRequestMessage)(nil), // 105: proto.DeclinePaymentRequestMessage - (*ContactsArrayMessage)(nil), // 106: proto.ContactsArrayMessage - (*ContactMessage)(nil), // 107: proto.ContactMessage - (*Chat)(nil), // 108: proto.Chat - (*CancelPaymentRequestMessage)(nil), // 109: proto.CancelPaymentRequestMessage - (*Call)(nil), // 110: proto.Call - (*ButtonsResponseMessage)(nil), // 111: proto.ButtonsResponseMessage - (*ButtonsMessage)(nil), // 112: proto.ButtonsMessage - (*Button)(nil), // 113: proto.Button - (*NativeFlowInfo)(nil), // 114: proto.NativeFlowInfo - (*ButtonText)(nil), // 115: proto.ButtonText - (*AudioMessage)(nil), // 116: proto.AudioMessage - (*AppStateSyncKey)(nil), // 117: proto.AppStateSyncKey - (*AppStateSyncKeyShare)(nil), // 118: proto.AppStateSyncKeyShare - (*AppStateSyncKeyRequest)(nil), // 119: proto.AppStateSyncKeyRequest - (*AppStateSyncKeyId)(nil), // 120: proto.AppStateSyncKeyId - (*AppStateSyncKeyFingerprint)(nil), // 121: proto.AppStateSyncKeyFingerprint - (*AppStateSyncKeyData)(nil), // 122: proto.AppStateSyncKeyData - (*AppStateFatalExceptionNotification)(nil), // 123: proto.AppStateFatalExceptionNotification - (*Location)(nil), // 124: proto.Location - (*InteractiveAnnotation)(nil), // 125: proto.InteractiveAnnotation - (*HydratedTemplateButton)(nil), // 126: proto.HydratedTemplateButton - (*HydratedURLButton)(nil), // 127: proto.HydratedURLButton - (*HydratedQuickReplyButton)(nil), // 128: proto.HydratedQuickReplyButton - (*HydratedCallButton)(nil), // 129: proto.HydratedCallButton - (*DisappearingMode)(nil), // 130: proto.DisappearingMode - (*DeviceListMetadata)(nil), // 131: proto.DeviceListMetadata - (*ContextInfo)(nil), // 132: proto.ContextInfo - (*ExternalAdReplyInfo)(nil), // 133: proto.ExternalAdReplyInfo - (*AdReplyInfo)(nil), // 134: proto.AdReplyInfo - (*ActionLink)(nil), // 135: proto.ActionLink - (*TemplateButton)(nil), // 136: proto.TemplateButton - (*URLButton)(nil), // 137: proto.URLButton - (*QuickReplyButton)(nil), // 138: proto.QuickReplyButton - (*CallButton)(nil), // 139: proto.CallButton - (*Point)(nil), // 140: proto.Point - (*PaymentBackground)(nil), // 141: proto.PaymentBackground - (*PBMediaData)(nil), // 142: proto.PBMediaData - (*Money)(nil), // 143: proto.Money - (*Message)(nil), // 144: proto.Message - (*MessageContextInfo)(nil), // 145: proto.MessageContextInfo - (*VideoMessage)(nil), // 146: proto.VideoMessage - (*TemplateMessage)(nil), // 147: proto.TemplateMessage - (*HydratedFourRowTemplate)(nil), // 148: proto.HydratedFourRowTemplate - (*FourRowTemplate)(nil), // 149: proto.FourRowTemplate - (*TemplateButtonReplyMessage)(nil), // 150: proto.TemplateButtonReplyMessage - (*StickerSyncRMRMessage)(nil), // 151: proto.StickerSyncRMRMessage - (*StickerMessage)(nil), // 152: proto.StickerMessage - (*SenderKeyDistributionMessage)(nil), // 153: proto.SenderKeyDistributionMessage - (*SendPaymentMessage)(nil), // 154: proto.SendPaymentMessage - (*RequestPaymentMessage)(nil), // 155: proto.RequestPaymentMessage - (*ReactionMessage)(nil), // 156: proto.ReactionMessage - (*EphemeralSetting)(nil), // 157: proto.EphemeralSetting - (*WallpaperSettings)(nil), // 158: proto.WallpaperSettings - (*Pushname)(nil), // 159: proto.Pushname - (*HistorySync)(nil), // 160: proto.HistorySync - (*HistorySyncMsg)(nil), // 161: proto.HistorySyncMsg - (*GroupParticipant)(nil), // 162: proto.GroupParticipant - (*GlobalSettings)(nil), // 163: proto.GlobalSettings - (*Conversation)(nil), // 164: proto.Conversation - (*AutoDownloadSettings)(nil), // 165: proto.AutoDownloadSettings - (*MsgRowOpaqueData)(nil), // 166: proto.MsgRowOpaqueData - (*MsgOpaqueData)(nil), // 167: proto.MsgOpaqueData - (*PollOption)(nil), // 168: proto.PollOption - (*ServerErrorReceipt)(nil), // 169: proto.ServerErrorReceipt - (*MediaRetryNotification)(nil), // 170: proto.MediaRetryNotification - (*MessageKey)(nil), // 171: proto.MessageKey - (*SyncdVersion)(nil), // 172: proto.SyncdVersion - (*SyncdValue)(nil), // 173: proto.SyncdValue - (*SyncdSnapshot)(nil), // 174: proto.SyncdSnapshot - (*SyncdRecord)(nil), // 175: proto.SyncdRecord - (*SyncdPatch)(nil), // 176: proto.SyncdPatch - (*SyncdMutations)(nil), // 177: proto.SyncdMutations - (*SyncdMutation)(nil), // 178: proto.SyncdMutation - (*SyncdIndex)(nil), // 179: proto.SyncdIndex - (*KeyId)(nil), // 180: proto.KeyId - (*ExternalBlobReference)(nil), // 181: proto.ExternalBlobReference - (*ExitCode)(nil), // 182: proto.ExitCode - (*SyncActionValue)(nil), // 183: proto.SyncActionValue - (*UserStatusMuteAction)(nil), // 184: proto.UserStatusMuteAction - (*UnarchiveChatsSetting)(nil), // 185: proto.UnarchiveChatsSetting - (*TimeFormatAction)(nil), // 186: proto.TimeFormatAction - (*SyncActionMessage)(nil), // 187: proto.SyncActionMessage - (*SyncActionMessageRange)(nil), // 188: proto.SyncActionMessageRange - (*SubscriptionAction)(nil), // 189: proto.SubscriptionAction - (*StarAction)(nil), // 190: proto.StarAction - (*SecurityNotificationSetting)(nil), // 191: proto.SecurityNotificationSetting - (*RecentStickerWeightsAction)(nil), // 192: proto.RecentStickerWeightsAction - (*RecentStickerMetadata)(nil), // 193: proto.RecentStickerMetadata - (*RecentEmojiWeightsAction)(nil), // 194: proto.RecentEmojiWeightsAction - (*QuickReplyAction)(nil), // 195: proto.QuickReplyAction - (*PushNameSetting)(nil), // 196: proto.PushNameSetting - (*PrimaryFeature)(nil), // 197: proto.PrimaryFeature - (*PinAction)(nil), // 198: proto.PinAction - (*MuteAction)(nil), // 199: proto.MuteAction - (*MarkChatAsReadAction)(nil), // 200: proto.MarkChatAsReadAction - (*LocaleSetting)(nil), // 201: proto.LocaleSetting - (*LabelEditAction)(nil), // 202: proto.LabelEditAction - (*LabelAssociationAction)(nil), // 203: proto.LabelAssociationAction - (*KeyExpiration)(nil), // 204: proto.KeyExpiration - (*FavoriteStickerAction)(nil), // 205: proto.FavoriteStickerAction - (*DeleteMessageForMeAction)(nil), // 206: proto.DeleteMessageForMeAction - (*DeleteChatAction)(nil), // 207: proto.DeleteChatAction - (*ContactAction)(nil), // 208: proto.ContactAction - (*ClearChatAction)(nil), // 209: proto.ClearChatAction - (*ArchiveChatAction)(nil), // 210: proto.ArchiveChatAction - (*AndroidUnsupportedActions)(nil), // 211: proto.AndroidUnsupportedActions - (*AgentAction)(nil), // 212: proto.AgentAction - (*SyncActionData)(nil), // 213: proto.SyncActionData - (*RecentStickerWeight)(nil), // 214: proto.RecentStickerWeight - (*RecentEmojiWeight)(nil), // 215: proto.RecentEmojiWeight - (*VerifiedNameCertificate)(nil), // 216: proto.VerifiedNameCertificate - (*VerifiedNameDetails)(nil), // 217: proto.VerifiedNameDetails - (*LocalizedName)(nil), // 218: proto.LocalizedName - (*BizIdentityInfo)(nil), // 219: proto.BizIdentityInfo - (*BizAccountPayload)(nil), // 220: proto.BizAccountPayload - (*BizAccountLinkInfo)(nil), // 221: proto.BizAccountLinkInfo - (*NoiseCertificate)(nil), // 222: proto.NoiseCertificate - (*NoiseCertificateDetails)(nil), // 223: proto.NoiseCertificateDetails - (*HandshakeMessage)(nil), // 224: proto.HandshakeMessage - (*ServerHello)(nil), // 225: proto.ServerHello - (*ClientHello)(nil), // 226: proto.ClientHello - (*ClientFinish)(nil), // 227: proto.ClientFinish - (*ClientPayload)(nil), // 228: proto.ClientPayload - (*WebInfo)(nil), // 229: proto.WebInfo - (*WebdPayload)(nil), // 230: proto.WebdPayload - (*UserAgent)(nil), // 231: proto.UserAgent - (*DevicePairingRegistrationData)(nil), // 232: proto.DevicePairingRegistrationData - (*DNSSource)(nil), // 233: proto.DNSSource - (*WebNotificationsInfo)(nil), // 234: proto.WebNotificationsInfo - (*WebMessageInfo)(nil), // 235: proto.WebMessageInfo - (*WebFeatures)(nil), // 236: proto.WebFeatures - (*UserReceipt)(nil), // 237: proto.UserReceipt - (*StatusPSA)(nil), // 238: proto.StatusPSA - (*Reaction)(nil), // 239: proto.Reaction - (*PollUpdate)(nil), // 240: proto.PollUpdate - (*PollAdditionalMetadata)(nil), // 241: proto.PollAdditionalMetadata - (*PhotoChange)(nil), // 242: proto.PhotoChange - (*PaymentInfo)(nil), // 243: proto.PaymentInfo - (*NotificationMessageInfo)(nil), // 244: proto.NotificationMessageInfo - (*MediaData)(nil), // 245: proto.MediaData + (*KeepInChatMessage)(nil), // 79: proto.KeepInChatMessage + (*InvoiceMessage)(nil), // 80: proto.InvoiceMessage + (*InteractiveResponseMessage)(nil), // 81: proto.InteractiveResponseMessage + (*NativeFlowResponseMessage)(nil), // 82: proto.NativeFlowResponseMessage + (*InteractiveResponseMessageBody)(nil), // 83: proto.InteractiveResponseMessageBody + (*InteractiveMessage)(nil), // 84: proto.InteractiveMessage + (*ShopMessage)(nil), // 85: proto.ShopMessage + (*NativeFlowMessage)(nil), // 86: proto.NativeFlowMessage + (*NativeFlowButton)(nil), // 87: proto.NativeFlowButton + (*Header)(nil), // 88: proto.Header + (*Footer)(nil), // 89: proto.Footer + (*CollectionMessage)(nil), // 90: proto.CollectionMessage + (*InteractiveMessageBody)(nil), // 91: proto.InteractiveMessageBody + (*InitialSecurityNotificationSettingSync)(nil), // 92: proto.InitialSecurityNotificationSettingSync + (*ImageMessage)(nil), // 93: proto.ImageMessage + (*HistorySyncNotification)(nil), // 94: proto.HistorySyncNotification + (*HighlyStructuredMessage)(nil), // 95: proto.HighlyStructuredMessage + (*HSMLocalizableParameter)(nil), // 96: proto.HSMLocalizableParameter + (*HSMDateTime)(nil), // 97: proto.HSMDateTime + (*HSMDateTimeUnixEpoch)(nil), // 98: proto.HSMDateTimeUnixEpoch + (*HSMDateTimeComponent)(nil), // 99: proto.HSMDateTimeComponent + (*HSMCurrency)(nil), // 100: proto.HSMCurrency + (*GroupInviteMessage)(nil), // 101: proto.GroupInviteMessage + (*FutureProofMessage)(nil), // 102: proto.FutureProofMessage + (*ExtendedTextMessage)(nil), // 103: proto.ExtendedTextMessage + (*DocumentMessage)(nil), // 104: proto.DocumentMessage + (*DeviceSentMessage)(nil), // 105: proto.DeviceSentMessage + (*DeclinePaymentRequestMessage)(nil), // 106: proto.DeclinePaymentRequestMessage + (*ContactsArrayMessage)(nil), // 107: proto.ContactsArrayMessage + (*ContactMessage)(nil), // 108: proto.ContactMessage + (*Chat)(nil), // 109: proto.Chat + (*CancelPaymentRequestMessage)(nil), // 110: proto.CancelPaymentRequestMessage + (*Call)(nil), // 111: proto.Call + (*ButtonsResponseMessage)(nil), // 112: proto.ButtonsResponseMessage + (*ButtonsMessage)(nil), // 113: proto.ButtonsMessage + (*Button)(nil), // 114: proto.Button + (*NativeFlowInfo)(nil), // 115: proto.NativeFlowInfo + (*ButtonText)(nil), // 116: proto.ButtonText + (*AudioMessage)(nil), // 117: proto.AudioMessage + (*AppStateSyncKey)(nil), // 118: proto.AppStateSyncKey + (*AppStateSyncKeyShare)(nil), // 119: proto.AppStateSyncKeyShare + (*AppStateSyncKeyRequest)(nil), // 120: proto.AppStateSyncKeyRequest + (*AppStateSyncKeyId)(nil), // 121: proto.AppStateSyncKeyId + (*AppStateSyncKeyFingerprint)(nil), // 122: proto.AppStateSyncKeyFingerprint + (*AppStateSyncKeyData)(nil), // 123: proto.AppStateSyncKeyData + (*AppStateFatalExceptionNotification)(nil), // 124: proto.AppStateFatalExceptionNotification + (*Location)(nil), // 125: proto.Location + (*InteractiveAnnotation)(nil), // 126: proto.InteractiveAnnotation + (*HydratedTemplateButton)(nil), // 127: proto.HydratedTemplateButton + (*HydratedURLButton)(nil), // 128: proto.HydratedURLButton + (*HydratedQuickReplyButton)(nil), // 129: proto.HydratedQuickReplyButton + (*HydratedCallButton)(nil), // 130: proto.HydratedCallButton + (*DisappearingMode)(nil), // 131: proto.DisappearingMode + (*DeviceListMetadata)(nil), // 132: proto.DeviceListMetadata + (*ContextInfo)(nil), // 133: proto.ContextInfo + (*ExternalAdReplyInfo)(nil), // 134: proto.ExternalAdReplyInfo + (*AdReplyInfo)(nil), // 135: proto.AdReplyInfo + (*ActionLink)(nil), // 136: proto.ActionLink + (*TemplateButton)(nil), // 137: proto.TemplateButton + (*URLButton)(nil), // 138: proto.URLButton + (*QuickReplyButton)(nil), // 139: proto.QuickReplyButton + (*CallButton)(nil), // 140: proto.CallButton + (*Point)(nil), // 141: proto.Point + (*PaymentBackground)(nil), // 142: proto.PaymentBackground + (*PBMediaData)(nil), // 143: proto.PBMediaData + (*Money)(nil), // 144: proto.Money + (*Message)(nil), // 145: proto.Message + (*MessageContextInfo)(nil), // 146: proto.MessageContextInfo + (*VideoMessage)(nil), // 147: proto.VideoMessage + (*TemplateMessage)(nil), // 148: proto.TemplateMessage + (*HydratedFourRowTemplate)(nil), // 149: proto.HydratedFourRowTemplate + (*FourRowTemplate)(nil), // 150: proto.FourRowTemplate + (*TemplateButtonReplyMessage)(nil), // 151: proto.TemplateButtonReplyMessage + (*StickerSyncRMRMessage)(nil), // 152: proto.StickerSyncRMRMessage + (*StickerMessage)(nil), // 153: proto.StickerMessage + (*SenderKeyDistributionMessage)(nil), // 154: proto.SenderKeyDistributionMessage + (*SendPaymentMessage)(nil), // 155: proto.SendPaymentMessage + (*RequestPaymentMessage)(nil), // 156: proto.RequestPaymentMessage + (*ReactionMessage)(nil), // 157: proto.ReactionMessage + (*ProtocolMessage)(nil), // 158: proto.ProtocolMessage + (*ProductMessage)(nil), // 159: proto.ProductMessage + (*EphemeralSetting)(nil), // 160: proto.EphemeralSetting + (*WallpaperSettings)(nil), // 161: proto.WallpaperSettings + (*Pushname)(nil), // 162: proto.Pushname + (*HistorySync)(nil), // 163: proto.HistorySync + (*HistorySyncMsg)(nil), // 164: proto.HistorySyncMsg + (*GroupParticipant)(nil), // 165: proto.GroupParticipant + (*GlobalSettings)(nil), // 166: proto.GlobalSettings + (*Conversation)(nil), // 167: proto.Conversation + (*AutoDownloadSettings)(nil), // 168: proto.AutoDownloadSettings + (*MsgRowOpaqueData)(nil), // 169: proto.MsgRowOpaqueData + (*MsgOpaqueData)(nil), // 170: proto.MsgOpaqueData + (*PollOption)(nil), // 171: proto.PollOption + (*ServerErrorReceipt)(nil), // 172: proto.ServerErrorReceipt + (*MediaRetryNotification)(nil), // 173: proto.MediaRetryNotification + (*MessageKey)(nil), // 174: proto.MessageKey + (*SyncdVersion)(nil), // 175: proto.SyncdVersion + (*SyncdValue)(nil), // 176: proto.SyncdValue + (*SyncdSnapshot)(nil), // 177: proto.SyncdSnapshot + (*SyncdRecord)(nil), // 178: proto.SyncdRecord + (*SyncdPatch)(nil), // 179: proto.SyncdPatch + (*SyncdMutations)(nil), // 180: proto.SyncdMutations + (*SyncdMutation)(nil), // 181: proto.SyncdMutation + (*SyncdIndex)(nil), // 182: proto.SyncdIndex + (*KeyId)(nil), // 183: proto.KeyId + (*ExternalBlobReference)(nil), // 184: proto.ExternalBlobReference + (*ExitCode)(nil), // 185: proto.ExitCode + (*SyncActionValue)(nil), // 186: proto.SyncActionValue + (*UserStatusMuteAction)(nil), // 187: proto.UserStatusMuteAction + (*UnarchiveChatsSetting)(nil), // 188: proto.UnarchiveChatsSetting + (*TimeFormatAction)(nil), // 189: proto.TimeFormatAction + (*SyncActionMessage)(nil), // 190: proto.SyncActionMessage + (*SyncActionMessageRange)(nil), // 191: proto.SyncActionMessageRange + (*SubscriptionAction)(nil), // 192: proto.SubscriptionAction + (*StarAction)(nil), // 193: proto.StarAction + (*SecurityNotificationSetting)(nil), // 194: proto.SecurityNotificationSetting + (*RecentStickerWeightsAction)(nil), // 195: proto.RecentStickerWeightsAction + (*RecentStickerMetadata)(nil), // 196: proto.RecentStickerMetadata + (*RecentEmojiWeightsAction)(nil), // 197: proto.RecentEmojiWeightsAction + (*QuickReplyAction)(nil), // 198: proto.QuickReplyAction + (*PushNameSetting)(nil), // 199: proto.PushNameSetting + (*PrimaryFeature)(nil), // 200: proto.PrimaryFeature + (*PinAction)(nil), // 201: proto.PinAction + (*MuteAction)(nil), // 202: proto.MuteAction + (*MarkChatAsReadAction)(nil), // 203: proto.MarkChatAsReadAction + (*LocaleSetting)(nil), // 204: proto.LocaleSetting + (*LabelEditAction)(nil), // 205: proto.LabelEditAction + (*LabelAssociationAction)(nil), // 206: proto.LabelAssociationAction + (*KeyExpiration)(nil), // 207: proto.KeyExpiration + (*FavoriteStickerAction)(nil), // 208: proto.FavoriteStickerAction + (*DeleteMessageForMeAction)(nil), // 209: proto.DeleteMessageForMeAction + (*DeleteChatAction)(nil), // 210: proto.DeleteChatAction + (*ContactAction)(nil), // 211: proto.ContactAction + (*ClearChatAction)(nil), // 212: proto.ClearChatAction + (*ArchiveChatAction)(nil), // 213: proto.ArchiveChatAction + (*AndroidUnsupportedActions)(nil), // 214: proto.AndroidUnsupportedActions + (*AgentAction)(nil), // 215: proto.AgentAction + (*SyncActionData)(nil), // 216: proto.SyncActionData + (*RecentStickerWeight)(nil), // 217: proto.RecentStickerWeight + (*RecentEmojiWeight)(nil), // 218: proto.RecentEmojiWeight + (*VerifiedNameCertificate)(nil), // 219: proto.VerifiedNameCertificate + (*VerifiedNameDetails)(nil), // 220: proto.VerifiedNameDetails + (*LocalizedName)(nil), // 221: proto.LocalizedName + (*BizIdentityInfo)(nil), // 222: proto.BizIdentityInfo + (*BizAccountPayload)(nil), // 223: proto.BizAccountPayload + (*BizAccountLinkInfo)(nil), // 224: proto.BizAccountLinkInfo + (*HandshakeMessage)(nil), // 225: proto.HandshakeMessage + (*ServerHello)(nil), // 226: proto.ServerHello + (*ClientHello)(nil), // 227: proto.ClientHello + (*ClientFinish)(nil), // 228: proto.ClientFinish + (*ClientPayload)(nil), // 229: proto.ClientPayload + (*WebInfo)(nil), // 230: proto.WebInfo + (*WebdPayload)(nil), // 231: proto.WebdPayload + (*UserAgent)(nil), // 232: proto.UserAgent + (*DevicePairingRegistrationData)(nil), // 233: proto.DevicePairingRegistrationData + (*DNSSource)(nil), // 234: proto.DNSSource + (*WebNotificationsInfo)(nil), // 235: proto.WebNotificationsInfo + (*WebMessageInfo)(nil), // 236: proto.WebMessageInfo + (*WebFeatures)(nil), // 237: proto.WebFeatures + (*UserReceipt)(nil), // 238: proto.UserReceipt + (*StatusPSA)(nil), // 239: proto.StatusPSA + (*Reaction)(nil), // 240: proto.Reaction + (*PollUpdate)(nil), // 241: proto.PollUpdate + (*PollAdditionalMetadata)(nil), // 242: proto.PollAdditionalMetadata + (*PhotoChange)(nil), // 243: proto.PhotoChange + (*PaymentInfo)(nil), // 244: proto.PaymentInfo + (*NotificationMessageInfo)(nil), // 245: proto.NotificationMessageInfo + (*MediaData)(nil), // 246: proto.MediaData + (*KeepInChat)(nil), // 247: proto.KeepInChat + (*NoiseCertificate)(nil), // 248: proto.NoiseCertificate + (*NoiseCertificateDetails)(nil), // 249: proto.NoiseCertificateDetails + (*CertChain)(nil), // 250: proto.CertChain + (*CertChainNoiseCertificate)(nil), // 251: proto.CertChainNoiseCertificate + (*CertChainNoiseCertificateDetails)(nil), // 252: proto.CertChainNoiseCertificateDetails } var file_binary_proto_def_proto_depIdxs = []int32{ - 56, // 0: proto.CompanionProps.version:type_name -> proto.AppVersion - 1, // 1: proto.CompanionProps.platformType:type_name -> proto.CompanionProps.CompanionPropsPlatformType - 171, // 2: proto.ProtocolMessage.key:type_name -> proto.MessageKey - 2, // 3: proto.ProtocolMessage.type:type_name -> proto.ProtocolMessage.ProtocolMessageType - 93, // 4: proto.ProtocolMessage.historySyncNotification:type_name -> proto.HistorySyncNotification - 118, // 5: proto.ProtocolMessage.appStateSyncKeyShare:type_name -> proto.AppStateSyncKeyShare - 119, // 6: proto.ProtocolMessage.appStateSyncKeyRequest:type_name -> proto.AppStateSyncKeyRequest - 91, // 7: proto.ProtocolMessage.initialSecurityNotificationSettingSync:type_name -> proto.InitialSecurityNotificationSettingSync - 123, // 8: proto.ProtocolMessage.appStateFatalExceptionNotification:type_name -> proto.AppStateFatalExceptionNotification - 130, // 9: proto.ProtocolMessage.disappearingMode:type_name -> proto.DisappearingMode - 59, // 10: proto.ProductMessage.product:type_name -> proto.ProductSnapshot - 60, // 11: proto.ProductMessage.catalog:type_name -> proto.CatalogSnapshot - 132, // 12: proto.ProductMessage.contextInfo:type_name -> proto.ContextInfo - 92, // 13: proto.ProductSnapshot.productImage:type_name -> proto.ImageMessage - 92, // 14: proto.CatalogSnapshot.catalogImage:type_name -> proto.ImageMessage - 171, // 15: proto.PollUpdateMessage.pollCreationMessageKey:type_name -> proto.MessageKey - 63, // 16: proto.PollUpdateMessage.vote:type_name -> proto.PollEncValue - 65, // 17: proto.PollCreationMessage.options:type_name -> proto.Option - 132, // 18: proto.PollCreationMessage.contextInfo:type_name -> proto.ContextInfo - 3, // 19: proto.PaymentInviteMessage.serviceType:type_name -> proto.PaymentInviteMessage.PaymentInviteMessageServiceType - 4, // 20: proto.OrderMessage.status:type_name -> proto.OrderMessage.OrderMessageOrderStatus - 5, // 21: proto.OrderMessage.surface:type_name -> proto.OrderMessage.OrderMessageOrderSurface - 132, // 22: proto.OrderMessage.contextInfo:type_name -> proto.ContextInfo - 132, // 23: proto.LocationMessage.contextInfo:type_name -> proto.ContextInfo - 132, // 24: proto.LiveLocationMessage.contextInfo:type_name -> proto.ContextInfo - 6, // 25: proto.ListResponseMessage.listType:type_name -> proto.ListResponseMessage.ListResponseMessageListType - 71, // 26: proto.ListResponseMessage.singleSelectReply:type_name -> proto.SingleSelectReply - 132, // 27: proto.ListResponseMessage.contextInfo:type_name -> proto.ContextInfo - 7, // 28: proto.ListMessage.listType:type_name -> proto.ListMessage.ListMessageListType - 73, // 29: proto.ListMessage.sections:type_name -> proto.Section - 77, // 30: proto.ListMessage.productListInfo:type_name -> proto.ProductListInfo - 132, // 31: proto.ListMessage.contextInfo:type_name -> proto.ContextInfo - 74, // 32: proto.Section.rows:type_name -> proto.Row - 75, // 33: proto.ProductSection.products:type_name -> proto.Product - 76, // 34: proto.ProductListInfo.productSections:type_name -> proto.ProductSection - 78, // 35: proto.ProductListInfo.headerImage:type_name -> proto.ProductListHeaderImage - 8, // 36: proto.InvoiceMessage.attachmentType:type_name -> proto.InvoiceMessage.InvoiceMessageAttachmentType - 82, // 37: proto.InteractiveResponseMessage.body:type_name -> proto.InteractiveResponseMessageBody - 132, // 38: proto.InteractiveResponseMessage.contextInfo:type_name -> proto.ContextInfo - 81, // 39: proto.InteractiveResponseMessage.nativeFlowResponseMessage:type_name -> proto.NativeFlowResponseMessage - 87, // 40: proto.InteractiveMessage.header:type_name -> proto.Header - 90, // 41: proto.InteractiveMessage.body:type_name -> proto.InteractiveMessageBody - 88, // 42: proto.InteractiveMessage.footer:type_name -> proto.Footer - 132, // 43: proto.InteractiveMessage.contextInfo:type_name -> proto.ContextInfo - 84, // 44: proto.InteractiveMessage.shopStorefrontMessage:type_name -> proto.ShopMessage - 89, // 45: proto.InteractiveMessage.collectionMessage:type_name -> proto.CollectionMessage - 85, // 46: proto.InteractiveMessage.nativeFlowMessage:type_name -> proto.NativeFlowMessage - 9, // 47: proto.ShopMessage.surface:type_name -> proto.ShopMessage.ShopMessageSurface - 86, // 48: proto.NativeFlowMessage.buttons:type_name -> proto.NativeFlowButton - 103, // 49: proto.Header.documentMessage:type_name -> proto.DocumentMessage - 92, // 50: proto.Header.imageMessage:type_name -> proto.ImageMessage - 146, // 51: proto.Header.videoMessage:type_name -> proto.VideoMessage - 125, // 52: proto.ImageMessage.interactiveAnnotations:type_name -> proto.InteractiveAnnotation - 132, // 53: proto.ImageMessage.contextInfo:type_name -> proto.ContextInfo - 10, // 54: proto.HistorySyncNotification.syncType:type_name -> proto.HistorySyncNotification.HistorySyncNotificationHistorySyncType - 95, // 55: proto.HighlyStructuredMessage.localizableParams:type_name -> proto.HSMLocalizableParameter - 147, // 56: proto.HighlyStructuredMessage.hydratedHsm:type_name -> proto.TemplateMessage - 99, // 57: proto.HSMLocalizableParameter.currency:type_name -> proto.HSMCurrency - 96, // 58: proto.HSMLocalizableParameter.dateTime:type_name -> proto.HSMDateTime - 98, // 59: proto.HSMDateTime.component:type_name -> proto.HSMDateTimeComponent - 97, // 60: proto.HSMDateTime.unixEpoch:type_name -> proto.HSMDateTimeUnixEpoch - 11, // 61: proto.HSMDateTimeComponent.dayOfWeek:type_name -> proto.HSMDateTimeComponent.HSMDateTimeComponentDayOfWeekType - 12, // 62: proto.HSMDateTimeComponent.calendar:type_name -> proto.HSMDateTimeComponent.HSMDateTimeComponentCalendarType - 132, // 63: proto.GroupInviteMessage.contextInfo:type_name -> proto.ContextInfo - 13, // 64: proto.GroupInviteMessage.groupType:type_name -> proto.GroupInviteMessage.GroupInviteMessageGroupType - 144, // 65: proto.FutureProofMessage.message:type_name -> proto.Message - 14, // 66: proto.ExtendedTextMessage.font:type_name -> proto.ExtendedTextMessage.ExtendedTextMessageFontType - 15, // 67: proto.ExtendedTextMessage.previewType:type_name -> proto.ExtendedTextMessage.ExtendedTextMessagePreviewType - 132, // 68: proto.ExtendedTextMessage.contextInfo:type_name -> proto.ContextInfo - 16, // 69: proto.ExtendedTextMessage.inviteLinkGroupType:type_name -> proto.ExtendedTextMessage.ExtendedTextMessageInviteLinkGroupType - 16, // 70: proto.ExtendedTextMessage.inviteLinkGroupTypeV2:type_name -> proto.ExtendedTextMessage.ExtendedTextMessageInviteLinkGroupType - 132, // 71: proto.DocumentMessage.contextInfo:type_name -> proto.ContextInfo - 144, // 72: proto.DeviceSentMessage.message:type_name -> proto.Message - 171, // 73: proto.DeclinePaymentRequestMessage.key:type_name -> proto.MessageKey - 107, // 74: proto.ContactsArrayMessage.contacts:type_name -> proto.ContactMessage - 132, // 75: proto.ContactsArrayMessage.contextInfo:type_name -> proto.ContextInfo - 132, // 76: proto.ContactMessage.contextInfo:type_name -> proto.ContextInfo - 171, // 77: proto.CancelPaymentRequestMessage.key:type_name -> proto.MessageKey - 132, // 78: proto.ButtonsResponseMessage.contextInfo:type_name -> proto.ContextInfo - 17, // 79: proto.ButtonsResponseMessage.type:type_name -> proto.ButtonsResponseMessage.ButtonsResponseMessageType - 132, // 80: proto.ButtonsMessage.contextInfo:type_name -> proto.ContextInfo - 113, // 81: proto.ButtonsMessage.buttons:type_name -> proto.Button - 18, // 82: proto.ButtonsMessage.headerType:type_name -> proto.ButtonsMessage.ButtonsMessageHeaderType - 103, // 83: proto.ButtonsMessage.documentMessage:type_name -> proto.DocumentMessage - 92, // 84: proto.ButtonsMessage.imageMessage:type_name -> proto.ImageMessage - 146, // 85: proto.ButtonsMessage.videoMessage:type_name -> proto.VideoMessage - 68, // 86: proto.ButtonsMessage.locationMessage:type_name -> proto.LocationMessage - 115, // 87: proto.Button.buttonText:type_name -> proto.ButtonText - 19, // 88: proto.Button.type:type_name -> proto.Button.ButtonType - 114, // 89: proto.Button.nativeFlowInfo:type_name -> proto.NativeFlowInfo - 132, // 90: proto.AudioMessage.contextInfo:type_name -> proto.ContextInfo - 120, // 91: proto.AppStateSyncKey.keyId:type_name -> proto.AppStateSyncKeyId - 122, // 92: proto.AppStateSyncKey.keyData:type_name -> proto.AppStateSyncKeyData - 117, // 93: proto.AppStateSyncKeyShare.keys:type_name -> proto.AppStateSyncKey - 120, // 94: proto.AppStateSyncKeyRequest.keyIds:type_name -> proto.AppStateSyncKeyId - 121, // 95: proto.AppStateSyncKeyData.fingerprint:type_name -> proto.AppStateSyncKeyFingerprint - 140, // 96: proto.InteractiveAnnotation.polygonVertices:type_name -> proto.Point - 124, // 97: proto.InteractiveAnnotation.location:type_name -> proto.Location - 128, // 98: proto.HydratedTemplateButton.quickReplyButton:type_name -> proto.HydratedQuickReplyButton - 127, // 99: proto.HydratedTemplateButton.urlButton:type_name -> proto.HydratedURLButton - 129, // 100: proto.HydratedTemplateButton.callButton:type_name -> proto.HydratedCallButton - 20, // 101: proto.DisappearingMode.initiator:type_name -> proto.DisappearingMode.DisappearingModeInitiator - 144, // 102: proto.ContextInfo.quotedMessage:type_name -> proto.Message - 134, // 103: proto.ContextInfo.quotedAd:type_name -> proto.AdReplyInfo - 171, // 104: proto.ContextInfo.placeholderKey:type_name -> proto.MessageKey - 133, // 105: proto.ContextInfo.externalAdReply:type_name -> proto.ExternalAdReplyInfo - 130, // 106: proto.ContextInfo.disappearingMode:type_name -> proto.DisappearingMode - 135, // 107: proto.ContextInfo.actionLink:type_name -> proto.ActionLink - 21, // 108: proto.ExternalAdReplyInfo.mediaType:type_name -> proto.ExternalAdReplyInfo.ExternalAdReplyInfoMediaType - 22, // 109: proto.AdReplyInfo.mediaType:type_name -> proto.AdReplyInfo.AdReplyInfoMediaType - 138, // 110: proto.TemplateButton.quickReplyButton:type_name -> proto.QuickReplyButton - 137, // 111: proto.TemplateButton.urlButton:type_name -> proto.URLButton - 139, // 112: proto.TemplateButton.callButton:type_name -> proto.CallButton - 94, // 113: proto.URLButton.displayText:type_name -> proto.HighlyStructuredMessage - 94, // 114: proto.URLButton.url:type_name -> proto.HighlyStructuredMessage - 94, // 115: proto.QuickReplyButton.displayText:type_name -> proto.HighlyStructuredMessage - 94, // 116: proto.CallButton.displayText:type_name -> proto.HighlyStructuredMessage - 94, // 117: proto.CallButton.phoneNumber:type_name -> proto.HighlyStructuredMessage - 142, // 118: proto.PaymentBackground.mediaData:type_name -> proto.PBMediaData - 23, // 119: proto.PaymentBackground.type:type_name -> proto.PaymentBackground.PaymentBackgroundType - 153, // 120: proto.Message.senderKeyDistributionMessage:type_name -> proto.SenderKeyDistributionMessage - 92, // 121: proto.Message.imageMessage:type_name -> proto.ImageMessage - 107, // 122: proto.Message.contactMessage:type_name -> proto.ContactMessage - 68, // 123: proto.Message.locationMessage:type_name -> proto.LocationMessage - 102, // 124: proto.Message.extendedTextMessage:type_name -> proto.ExtendedTextMessage - 103, // 125: proto.Message.documentMessage:type_name -> proto.DocumentMessage - 116, // 126: proto.Message.audioMessage:type_name -> proto.AudioMessage - 146, // 127: proto.Message.videoMessage:type_name -> proto.VideoMessage - 110, // 128: proto.Message.call:type_name -> proto.Call - 108, // 129: proto.Message.chat:type_name -> proto.Chat - 57, // 130: proto.Message.protocolMessage:type_name -> proto.ProtocolMessage - 106, // 131: proto.Message.contactsArrayMessage:type_name -> proto.ContactsArrayMessage - 94, // 132: proto.Message.highlyStructuredMessage:type_name -> proto.HighlyStructuredMessage - 153, // 133: proto.Message.fastRatchetKeySenderKeyDistributionMessage:type_name -> proto.SenderKeyDistributionMessage - 154, // 134: proto.Message.sendPaymentMessage:type_name -> proto.SendPaymentMessage - 69, // 135: proto.Message.liveLocationMessage:type_name -> proto.LiveLocationMessage - 155, // 136: proto.Message.requestPaymentMessage:type_name -> proto.RequestPaymentMessage - 105, // 137: proto.Message.declinePaymentRequestMessage:type_name -> proto.DeclinePaymentRequestMessage - 109, // 138: proto.Message.cancelPaymentRequestMessage:type_name -> proto.CancelPaymentRequestMessage - 147, // 139: proto.Message.templateMessage:type_name -> proto.TemplateMessage - 152, // 140: proto.Message.stickerMessage:type_name -> proto.StickerMessage - 100, // 141: proto.Message.groupInviteMessage:type_name -> proto.GroupInviteMessage - 150, // 142: proto.Message.templateButtonReplyMessage:type_name -> proto.TemplateButtonReplyMessage - 58, // 143: proto.Message.productMessage:type_name -> proto.ProductMessage - 104, // 144: proto.Message.deviceSentMessage:type_name -> proto.DeviceSentMessage - 145, // 145: proto.Message.messageContextInfo:type_name -> proto.MessageContextInfo - 72, // 146: proto.Message.listMessage:type_name -> proto.ListMessage - 101, // 147: proto.Message.viewOnceMessage:type_name -> proto.FutureProofMessage - 67, // 148: proto.Message.orderMessage:type_name -> proto.OrderMessage - 70, // 149: proto.Message.listResponseMessage:type_name -> proto.ListResponseMessage - 101, // 150: proto.Message.ephemeralMessage:type_name -> proto.FutureProofMessage - 79, // 151: proto.Message.invoiceMessage:type_name -> proto.InvoiceMessage - 112, // 152: proto.Message.buttonsMessage:type_name -> proto.ButtonsMessage - 111, // 153: proto.Message.buttonsResponseMessage:type_name -> proto.ButtonsResponseMessage - 66, // 154: proto.Message.paymentInviteMessage:type_name -> proto.PaymentInviteMessage - 83, // 155: proto.Message.interactiveMessage:type_name -> proto.InteractiveMessage - 156, // 156: proto.Message.reactionMessage:type_name -> proto.ReactionMessage - 151, // 157: proto.Message.stickerSyncRmrMessage:type_name -> proto.StickerSyncRMRMessage - 80, // 158: proto.Message.interactiveResponseMessage:type_name -> proto.InteractiveResponseMessage - 64, // 159: proto.Message.pollCreationMessage:type_name -> proto.PollCreationMessage - 62, // 160: proto.Message.pollUpdateMessage:type_name -> proto.PollUpdateMessage - 131, // 161: proto.MessageContextInfo.deviceListMetadata:type_name -> proto.DeviceListMetadata - 125, // 162: proto.VideoMessage.interactiveAnnotations:type_name -> proto.InteractiveAnnotation - 132, // 163: proto.VideoMessage.contextInfo:type_name -> proto.ContextInfo - 24, // 164: proto.VideoMessage.gifAttribution:type_name -> proto.VideoMessage.VideoMessageAttribution - 132, // 165: proto.TemplateMessage.contextInfo:type_name -> proto.ContextInfo - 148, // 166: proto.TemplateMessage.hydratedTemplate:type_name -> proto.HydratedFourRowTemplate - 149, // 167: proto.TemplateMessage.fourRowTemplate:type_name -> proto.FourRowTemplate - 148, // 168: proto.TemplateMessage.hydratedFourRowTemplate:type_name -> proto.HydratedFourRowTemplate - 126, // 169: proto.HydratedFourRowTemplate.hydratedButtons:type_name -> proto.HydratedTemplateButton - 103, // 170: proto.HydratedFourRowTemplate.documentMessage:type_name -> proto.DocumentMessage - 92, // 171: proto.HydratedFourRowTemplate.imageMessage:type_name -> proto.ImageMessage - 146, // 172: proto.HydratedFourRowTemplate.videoMessage:type_name -> proto.VideoMessage - 68, // 173: proto.HydratedFourRowTemplate.locationMessage:type_name -> proto.LocationMessage - 94, // 174: proto.FourRowTemplate.content:type_name -> proto.HighlyStructuredMessage - 94, // 175: proto.FourRowTemplate.footer:type_name -> proto.HighlyStructuredMessage - 136, // 176: proto.FourRowTemplate.buttons:type_name -> proto.TemplateButton - 103, // 177: proto.FourRowTemplate.documentMessage:type_name -> proto.DocumentMessage - 94, // 178: proto.FourRowTemplate.highlyStructuredMessage:type_name -> proto.HighlyStructuredMessage - 92, // 179: proto.FourRowTemplate.imageMessage:type_name -> proto.ImageMessage - 146, // 180: proto.FourRowTemplate.videoMessage:type_name -> proto.VideoMessage - 68, // 181: proto.FourRowTemplate.locationMessage:type_name -> proto.LocationMessage - 132, // 182: proto.TemplateButtonReplyMessage.contextInfo:type_name -> proto.ContextInfo - 132, // 183: proto.StickerMessage.contextInfo:type_name -> proto.ContextInfo - 144, // 184: proto.SendPaymentMessage.noteMessage:type_name -> proto.Message - 171, // 185: proto.SendPaymentMessage.requestMessageKey:type_name -> proto.MessageKey - 141, // 186: proto.SendPaymentMessage.background:type_name -> proto.PaymentBackground - 144, // 187: proto.RequestPaymentMessage.noteMessage:type_name -> proto.Message - 143, // 188: proto.RequestPaymentMessage.amount:type_name -> proto.Money - 141, // 189: proto.RequestPaymentMessage.background:type_name -> proto.PaymentBackground - 171, // 190: proto.ReactionMessage.key:type_name -> proto.MessageKey - 25, // 191: proto.HistorySync.syncType:type_name -> proto.HistorySync.HistorySyncHistorySyncType - 164, // 192: proto.HistorySync.conversations:type_name -> proto.Conversation - 235, // 193: proto.HistorySync.statusV3Messages:type_name -> proto.WebMessageInfo - 159, // 194: proto.HistorySync.pushnames:type_name -> proto.Pushname - 163, // 195: proto.HistorySync.globalSettings:type_name -> proto.GlobalSettings - 235, // 196: proto.HistorySyncMsg.message:type_name -> proto.WebMessageInfo - 26, // 197: proto.GroupParticipant.rank:type_name -> proto.GroupParticipant.GroupParticipantRank - 158, // 198: proto.GlobalSettings.lightThemeWallpaper:type_name -> proto.WallpaperSettings - 0, // 199: proto.GlobalSettings.mediaVisibility:type_name -> proto.MediaVisibility - 158, // 200: proto.GlobalSettings.darkThemeWallpaper:type_name -> proto.WallpaperSettings - 165, // 201: proto.GlobalSettings.autoDownloadWiFi:type_name -> proto.AutoDownloadSettings - 165, // 202: proto.GlobalSettings.autoDownloadCellular:type_name -> proto.AutoDownloadSettings - 165, // 203: proto.GlobalSettings.autoDownloadRoaming:type_name -> proto.AutoDownloadSettings - 161, // 204: proto.Conversation.messages:type_name -> proto.HistorySyncMsg - 27, // 205: proto.Conversation.endOfHistoryTransferType:type_name -> proto.Conversation.ConversationEndOfHistoryTransferType - 130, // 206: proto.Conversation.disappearingMode:type_name -> proto.DisappearingMode - 162, // 207: proto.Conversation.participant:type_name -> proto.GroupParticipant - 158, // 208: proto.Conversation.wallpaper:type_name -> proto.WallpaperSettings - 0, // 209: proto.Conversation.mediaVisibility:type_name -> proto.MediaVisibility - 167, // 210: proto.MsgRowOpaqueData.currentMsg:type_name -> proto.MsgOpaqueData - 167, // 211: proto.MsgRowOpaqueData.quotedMsg:type_name -> proto.MsgOpaqueData - 168, // 212: proto.MsgOpaqueData.pollOptions:type_name -> proto.PollOption - 28, // 213: proto.MediaRetryNotification.result:type_name -> proto.MediaRetryNotification.MediaRetryNotificationResultType - 172, // 214: proto.SyncdSnapshot.version:type_name -> proto.SyncdVersion - 175, // 215: proto.SyncdSnapshot.records:type_name -> proto.SyncdRecord - 180, // 216: proto.SyncdSnapshot.keyId:type_name -> proto.KeyId - 179, // 217: proto.SyncdRecord.index:type_name -> proto.SyncdIndex - 173, // 218: proto.SyncdRecord.value:type_name -> proto.SyncdValue - 180, // 219: proto.SyncdRecord.keyId:type_name -> proto.KeyId - 172, // 220: proto.SyncdPatch.version:type_name -> proto.SyncdVersion - 178, // 221: proto.SyncdPatch.mutations:type_name -> proto.SyncdMutation - 181, // 222: proto.SyncdPatch.externalMutations:type_name -> proto.ExternalBlobReference - 180, // 223: proto.SyncdPatch.keyId:type_name -> proto.KeyId - 182, // 224: proto.SyncdPatch.exitCode:type_name -> proto.ExitCode - 178, // 225: proto.SyncdMutations.mutations:type_name -> proto.SyncdMutation - 29, // 226: proto.SyncdMutation.operation:type_name -> proto.SyncdMutation.SyncdMutationSyncdOperation - 175, // 227: proto.SyncdMutation.record:type_name -> proto.SyncdRecord - 190, // 228: proto.SyncActionValue.starAction:type_name -> proto.StarAction - 208, // 229: proto.SyncActionValue.contactAction:type_name -> proto.ContactAction - 199, // 230: proto.SyncActionValue.muteAction:type_name -> proto.MuteAction - 198, // 231: proto.SyncActionValue.pinAction:type_name -> proto.PinAction - 191, // 232: proto.SyncActionValue.securityNotificationSetting:type_name -> proto.SecurityNotificationSetting - 196, // 233: proto.SyncActionValue.pushNameSetting:type_name -> proto.PushNameSetting - 195, // 234: proto.SyncActionValue.quickReplyAction:type_name -> proto.QuickReplyAction - 192, // 235: proto.SyncActionValue.recentStickerWeightsAction:type_name -> proto.RecentStickerWeightsAction - 193, // 236: proto.SyncActionValue.recentStickerMetadata:type_name -> proto.RecentStickerMetadata - 194, // 237: proto.SyncActionValue.recentEmojiWeightsAction:type_name -> proto.RecentEmojiWeightsAction - 202, // 238: proto.SyncActionValue.labelEditAction:type_name -> proto.LabelEditAction - 203, // 239: proto.SyncActionValue.labelAssociationAction:type_name -> proto.LabelAssociationAction - 201, // 240: proto.SyncActionValue.localeSetting:type_name -> proto.LocaleSetting - 210, // 241: proto.SyncActionValue.archiveChatAction:type_name -> proto.ArchiveChatAction - 206, // 242: proto.SyncActionValue.deleteMessageForMeAction:type_name -> proto.DeleteMessageForMeAction - 204, // 243: proto.SyncActionValue.keyExpiration:type_name -> proto.KeyExpiration - 200, // 244: proto.SyncActionValue.markChatAsReadAction:type_name -> proto.MarkChatAsReadAction - 209, // 245: proto.SyncActionValue.clearChatAction:type_name -> proto.ClearChatAction - 207, // 246: proto.SyncActionValue.deleteChatAction:type_name -> proto.DeleteChatAction - 185, // 247: proto.SyncActionValue.unarchiveChatsSetting:type_name -> proto.UnarchiveChatsSetting - 197, // 248: proto.SyncActionValue.primaryFeature:type_name -> proto.PrimaryFeature - 205, // 249: proto.SyncActionValue.favoriteStickerAction:type_name -> proto.FavoriteStickerAction - 211, // 250: proto.SyncActionValue.androidUnsupportedActions:type_name -> proto.AndroidUnsupportedActions - 212, // 251: proto.SyncActionValue.agentAction:type_name -> proto.AgentAction - 189, // 252: proto.SyncActionValue.subscriptionAction:type_name -> proto.SubscriptionAction - 184, // 253: proto.SyncActionValue.userStatusMuteAction:type_name -> proto.UserStatusMuteAction - 186, // 254: proto.SyncActionValue.timeFormatAction:type_name -> proto.TimeFormatAction - 171, // 255: proto.SyncActionMessage.key:type_name -> proto.MessageKey - 187, // 256: proto.SyncActionMessageRange.messages:type_name -> proto.SyncActionMessage - 214, // 257: proto.RecentStickerWeightsAction.weights:type_name -> proto.RecentStickerWeight - 215, // 258: proto.RecentEmojiWeightsAction.weights:type_name -> proto.RecentEmojiWeight - 188, // 259: proto.MarkChatAsReadAction.messageRange:type_name -> proto.SyncActionMessageRange - 188, // 260: proto.DeleteChatAction.messageRange:type_name -> proto.SyncActionMessageRange - 188, // 261: proto.ClearChatAction.messageRange:type_name -> proto.SyncActionMessageRange - 188, // 262: proto.ArchiveChatAction.messageRange:type_name -> proto.SyncActionMessageRange - 183, // 263: proto.SyncActionData.value:type_name -> proto.SyncActionValue - 218, // 264: proto.VerifiedNameDetails.localizedNames:type_name -> proto.LocalizedName - 30, // 265: proto.BizIdentityInfo.vlevel:type_name -> proto.BizIdentityInfo.BizIdentityInfoVerifiedLevelValue - 216, // 266: proto.BizIdentityInfo.vnameCert:type_name -> proto.VerifiedNameCertificate - 31, // 267: proto.BizIdentityInfo.hostStorage:type_name -> proto.BizIdentityInfo.BizIdentityInfoHostStorageType - 32, // 268: proto.BizIdentityInfo.actualActors:type_name -> proto.BizIdentityInfo.BizIdentityInfoActualActorsType - 216, // 269: proto.BizAccountPayload.vnameCert:type_name -> proto.VerifiedNameCertificate - 33, // 270: proto.BizAccountLinkInfo.hostStorage:type_name -> proto.BizAccountLinkInfo.BizAccountLinkInfoHostStorageType - 34, // 271: proto.BizAccountLinkInfo.accountType:type_name -> proto.BizAccountLinkInfo.BizAccountLinkInfoAccountType - 226, // 272: proto.HandshakeMessage.clientHello:type_name -> proto.ClientHello - 225, // 273: proto.HandshakeMessage.serverHello:type_name -> proto.ServerHello - 227, // 274: proto.HandshakeMessage.clientFinish:type_name -> proto.ClientFinish - 231, // 275: proto.ClientPayload.userAgent:type_name -> proto.UserAgent - 229, // 276: proto.ClientPayload.webInfo:type_name -> proto.WebInfo - 35, // 277: proto.ClientPayload.connectType:type_name -> proto.ClientPayload.ClientPayloadConnectType - 36, // 278: proto.ClientPayload.connectReason:type_name -> proto.ClientPayload.ClientPayloadConnectReason - 233, // 279: proto.ClientPayload.dnsSource:type_name -> proto.DNSSource - 232, // 280: proto.ClientPayload.devicePairingData:type_name -> proto.DevicePairingRegistrationData - 37, // 281: proto.ClientPayload.product:type_name -> proto.ClientPayload.ClientPayloadProduct - 38, // 282: proto.ClientPayload.iosAppExtension:type_name -> proto.ClientPayload.ClientPayloadIOSAppExtension - 230, // 283: proto.WebInfo.webdPayload:type_name -> proto.WebdPayload - 39, // 284: proto.WebInfo.webSubPlatform:type_name -> proto.WebInfo.WebInfoWebSubPlatform - 40, // 285: proto.UserAgent.platform:type_name -> proto.UserAgent.UserAgentPlatform - 56, // 286: proto.UserAgent.appVersion:type_name -> proto.AppVersion - 41, // 287: proto.UserAgent.releaseChannel:type_name -> proto.UserAgent.UserAgentReleaseChannel - 42, // 288: proto.DNSSource.dnsMethod:type_name -> proto.DNSSource.DNSSourceDNSResolutionMethod - 235, // 289: proto.WebNotificationsInfo.notifyMessages:type_name -> proto.WebMessageInfo - 171, // 290: proto.WebMessageInfo.key:type_name -> proto.MessageKey - 144, // 291: proto.WebMessageInfo.message:type_name -> proto.Message - 43, // 292: proto.WebMessageInfo.status:type_name -> proto.WebMessageInfo.WebMessageInfoStatus - 44, // 293: proto.WebMessageInfo.messageStubType:type_name -> proto.WebMessageInfo.WebMessageInfoStubType - 243, // 294: proto.WebMessageInfo.paymentInfo:type_name -> proto.PaymentInfo - 69, // 295: proto.WebMessageInfo.finalLiveLocation:type_name -> proto.LiveLocationMessage - 243, // 296: proto.WebMessageInfo.quotedPaymentInfo:type_name -> proto.PaymentInfo - 45, // 297: proto.WebMessageInfo.bizPrivacyStatus:type_name -> proto.WebMessageInfo.WebMessageInfoBizPrivacyStatus - 245, // 298: proto.WebMessageInfo.mediaData:type_name -> proto.MediaData - 242, // 299: proto.WebMessageInfo.photoChange:type_name -> proto.PhotoChange - 237, // 300: proto.WebMessageInfo.userReceipt:type_name -> proto.UserReceipt - 239, // 301: proto.WebMessageInfo.reactions:type_name -> proto.Reaction - 245, // 302: proto.WebMessageInfo.quotedStickerData:type_name -> proto.MediaData - 238, // 303: proto.WebMessageInfo.statusPsa:type_name -> proto.StatusPSA - 240, // 304: proto.WebMessageInfo.pollUpdates:type_name -> proto.PollUpdate - 241, // 305: proto.WebMessageInfo.pollAdditionalMetadata:type_name -> proto.PollAdditionalMetadata - 46, // 306: proto.WebFeatures.labelsDisplay:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 307: proto.WebFeatures.voipIndividualOutgoing:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 308: proto.WebFeatures.groupsV3:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 309: proto.WebFeatures.groupsV3Create:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 310: proto.WebFeatures.changeNumberV2:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 311: proto.WebFeatures.queryStatusV3Thumbnail:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 312: proto.WebFeatures.liveLocations:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 313: proto.WebFeatures.queryVname:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 314: proto.WebFeatures.voipIndividualIncoming:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 315: proto.WebFeatures.quickRepliesQuery:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 316: proto.WebFeatures.payments:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 317: proto.WebFeatures.stickerPackQuery:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 318: proto.WebFeatures.liveLocationsFinal:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 319: proto.WebFeatures.labelsEdit:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 320: proto.WebFeatures.mediaUpload:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 321: proto.WebFeatures.mediaUploadRichQuickReplies:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 322: proto.WebFeatures.vnameV2:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 323: proto.WebFeatures.videoPlaybackUrl:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 324: proto.WebFeatures.statusRanking:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 325: proto.WebFeatures.voipIndividualVideo:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 326: proto.WebFeatures.thirdPartyStickers:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 327: proto.WebFeatures.frequentlyForwardedSetting:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 328: proto.WebFeatures.groupsV4JoinPermission:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 329: proto.WebFeatures.recentStickers:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 330: proto.WebFeatures.catalog:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 331: proto.WebFeatures.starredStickers:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 332: proto.WebFeatures.voipGroupCall:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 333: proto.WebFeatures.templateMessage:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 334: proto.WebFeatures.templateMessageInteractivity:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 335: proto.WebFeatures.ephemeralMessages:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 336: proto.WebFeatures.e2ENotificationSync:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 337: proto.WebFeatures.recentStickersV2:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 338: proto.WebFeatures.recentStickersV3:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 339: proto.WebFeatures.userNotice:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 340: proto.WebFeatures.support:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 341: proto.WebFeatures.groupUiiCleanup:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 342: proto.WebFeatures.groupDogfoodingInternalOnly:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 343: proto.WebFeatures.settingsSync:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 344: proto.WebFeatures.archiveV2:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 345: proto.WebFeatures.ephemeralAllowGroupMembers:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 346: proto.WebFeatures.ephemeral24HDuration:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 347: proto.WebFeatures.mdForceUpgrade:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 348: proto.WebFeatures.disappearingMode:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 349: proto.WebFeatures.externalMdOptInAvailable:type_name -> proto.WebFeatures.WebFeaturesFlag - 46, // 350: proto.WebFeatures.noDeleteMessageTimeLimit:type_name -> proto.WebFeatures.WebFeaturesFlag - 171, // 351: proto.Reaction.key:type_name -> proto.MessageKey - 171, // 352: proto.PollUpdate.pollUpdateMessageKey:type_name -> proto.MessageKey - 61, // 353: proto.PollUpdate.vote:type_name -> proto.PollVoteMessage - 47, // 354: proto.PaymentInfo.currencyDeprecated:type_name -> proto.PaymentInfo.PaymentInfoCurrency - 48, // 355: proto.PaymentInfo.status:type_name -> proto.PaymentInfo.PaymentInfoStatus - 171, // 356: proto.PaymentInfo.requestMessageKey:type_name -> proto.MessageKey - 49, // 357: proto.PaymentInfo.txnStatus:type_name -> proto.PaymentInfo.PaymentInfoTxnStatus - 143, // 358: proto.PaymentInfo.primaryAmount:type_name -> proto.Money - 143, // 359: proto.PaymentInfo.exchangeAmount:type_name -> proto.Money - 171, // 360: proto.NotificationMessageInfo.key:type_name -> proto.MessageKey - 144, // 361: proto.NotificationMessageInfo.message:type_name -> proto.Message - 362, // [362:362] is the sub-list for method output_type - 362, // [362:362] is the sub-list for method input_type - 362, // [362:362] is the sub-list for extension type_name - 362, // [362:362] is the sub-list for extension extendee - 0, // [0:362] is the sub-list for field type_name + 57, // 0: proto.DeviceProps.version:type_name -> proto.AppVersion + 2, // 1: proto.DeviceProps.platformType:type_name -> proto.DeviceProps.DevicePropsPlatformType + 93, // 2: proto.ProductSnapshot.productImage:type_name -> proto.ImageMessage + 93, // 3: proto.CatalogSnapshot.catalogImage:type_name -> proto.ImageMessage + 174, // 4: proto.PollUpdateMessage.pollCreationMessageKey:type_name -> proto.MessageKey + 63, // 5: proto.PollUpdateMessage.vote:type_name -> proto.PollEncValue + 62, // 6: proto.PollUpdateMessage.metadata:type_name -> proto.PollUpdateMessageMetadata + 65, // 7: proto.PollCreationMessage.options:type_name -> proto.Option + 133, // 8: proto.PollCreationMessage.contextInfo:type_name -> proto.ContextInfo + 3, // 9: proto.PaymentInviteMessage.serviceType:type_name -> proto.PaymentInviteMessage.PaymentInviteMessageServiceType + 4, // 10: proto.OrderMessage.status:type_name -> proto.OrderMessage.OrderMessageOrderStatus + 5, // 11: proto.OrderMessage.surface:type_name -> proto.OrderMessage.OrderMessageOrderSurface + 133, // 12: proto.OrderMessage.contextInfo:type_name -> proto.ContextInfo + 133, // 13: proto.LocationMessage.contextInfo:type_name -> proto.ContextInfo + 133, // 14: proto.LiveLocationMessage.contextInfo:type_name -> proto.ContextInfo + 6, // 15: proto.ListResponseMessage.listType:type_name -> proto.ListResponseMessage.ListResponseMessageListType + 71, // 16: proto.ListResponseMessage.singleSelectReply:type_name -> proto.SingleSelectReply + 133, // 17: proto.ListResponseMessage.contextInfo:type_name -> proto.ContextInfo + 7, // 18: proto.ListMessage.listType:type_name -> proto.ListMessage.ListMessageListType + 73, // 19: proto.ListMessage.sections:type_name -> proto.Section + 77, // 20: proto.ListMessage.productListInfo:type_name -> proto.ProductListInfo + 133, // 21: proto.ListMessage.contextInfo:type_name -> proto.ContextInfo + 74, // 22: proto.Section.rows:type_name -> proto.Row + 75, // 23: proto.ProductSection.products:type_name -> proto.Product + 76, // 24: proto.ProductListInfo.productSections:type_name -> proto.ProductSection + 78, // 25: proto.ProductListInfo.headerImage:type_name -> proto.ProductListHeaderImage + 174, // 26: proto.KeepInChatMessage.key:type_name -> proto.MessageKey + 0, // 27: proto.KeepInChatMessage.keepType:type_name -> proto.KeepType + 8, // 28: proto.InvoiceMessage.attachmentType:type_name -> proto.InvoiceMessage.InvoiceMessageAttachmentType + 83, // 29: proto.InteractiveResponseMessage.body:type_name -> proto.InteractiveResponseMessageBody + 133, // 30: proto.InteractiveResponseMessage.contextInfo:type_name -> proto.ContextInfo + 82, // 31: proto.InteractiveResponseMessage.nativeFlowResponseMessage:type_name -> proto.NativeFlowResponseMessage + 88, // 32: proto.InteractiveMessage.header:type_name -> proto.Header + 91, // 33: proto.InteractiveMessage.body:type_name -> proto.InteractiveMessageBody + 89, // 34: proto.InteractiveMessage.footer:type_name -> proto.Footer + 133, // 35: proto.InteractiveMessage.contextInfo:type_name -> proto.ContextInfo + 85, // 36: proto.InteractiveMessage.shopStorefrontMessage:type_name -> proto.ShopMessage + 90, // 37: proto.InteractiveMessage.collectionMessage:type_name -> proto.CollectionMessage + 86, // 38: proto.InteractiveMessage.nativeFlowMessage:type_name -> proto.NativeFlowMessage + 9, // 39: proto.ShopMessage.surface:type_name -> proto.ShopMessage.ShopMessageSurface + 87, // 40: proto.NativeFlowMessage.buttons:type_name -> proto.NativeFlowButton + 104, // 41: proto.Header.documentMessage:type_name -> proto.DocumentMessage + 93, // 42: proto.Header.imageMessage:type_name -> proto.ImageMessage + 147, // 43: proto.Header.videoMessage:type_name -> proto.VideoMessage + 126, // 44: proto.ImageMessage.interactiveAnnotations:type_name -> proto.InteractiveAnnotation + 133, // 45: proto.ImageMessage.contextInfo:type_name -> proto.ContextInfo + 10, // 46: proto.HistorySyncNotification.syncType:type_name -> proto.HistorySyncNotification.HistorySyncNotificationHistorySyncType + 96, // 47: proto.HighlyStructuredMessage.localizableParams:type_name -> proto.HSMLocalizableParameter + 148, // 48: proto.HighlyStructuredMessage.hydratedHsm:type_name -> proto.TemplateMessage + 100, // 49: proto.HSMLocalizableParameter.currency:type_name -> proto.HSMCurrency + 97, // 50: proto.HSMLocalizableParameter.dateTime:type_name -> proto.HSMDateTime + 99, // 51: proto.HSMDateTime.component:type_name -> proto.HSMDateTimeComponent + 98, // 52: proto.HSMDateTime.unixEpoch:type_name -> proto.HSMDateTimeUnixEpoch + 11, // 53: proto.HSMDateTimeComponent.dayOfWeek:type_name -> proto.HSMDateTimeComponent.HSMDateTimeComponentDayOfWeekType + 12, // 54: proto.HSMDateTimeComponent.calendar:type_name -> proto.HSMDateTimeComponent.HSMDateTimeComponentCalendarType + 133, // 55: proto.GroupInviteMessage.contextInfo:type_name -> proto.ContextInfo + 13, // 56: proto.GroupInviteMessage.groupType:type_name -> proto.GroupInviteMessage.GroupInviteMessageGroupType + 145, // 57: proto.FutureProofMessage.message:type_name -> proto.Message + 14, // 58: proto.ExtendedTextMessage.font:type_name -> proto.ExtendedTextMessage.ExtendedTextMessageFontType + 15, // 59: proto.ExtendedTextMessage.previewType:type_name -> proto.ExtendedTextMessage.ExtendedTextMessagePreviewType + 133, // 60: proto.ExtendedTextMessage.contextInfo:type_name -> proto.ContextInfo + 16, // 61: proto.ExtendedTextMessage.inviteLinkGroupType:type_name -> proto.ExtendedTextMessage.ExtendedTextMessageInviteLinkGroupType + 16, // 62: proto.ExtendedTextMessage.inviteLinkGroupTypeV2:type_name -> proto.ExtendedTextMessage.ExtendedTextMessageInviteLinkGroupType + 133, // 63: proto.DocumentMessage.contextInfo:type_name -> proto.ContextInfo + 145, // 64: proto.DeviceSentMessage.message:type_name -> proto.Message + 174, // 65: proto.DeclinePaymentRequestMessage.key:type_name -> proto.MessageKey + 108, // 66: proto.ContactsArrayMessage.contacts:type_name -> proto.ContactMessage + 133, // 67: proto.ContactsArrayMessage.contextInfo:type_name -> proto.ContextInfo + 133, // 68: proto.ContactMessage.contextInfo:type_name -> proto.ContextInfo + 174, // 69: proto.CancelPaymentRequestMessage.key:type_name -> proto.MessageKey + 133, // 70: proto.ButtonsResponseMessage.contextInfo:type_name -> proto.ContextInfo + 17, // 71: proto.ButtonsResponseMessage.type:type_name -> proto.ButtonsResponseMessage.ButtonsResponseMessageType + 133, // 72: proto.ButtonsMessage.contextInfo:type_name -> proto.ContextInfo + 114, // 73: proto.ButtonsMessage.buttons:type_name -> proto.Button + 18, // 74: proto.ButtonsMessage.headerType:type_name -> proto.ButtonsMessage.ButtonsMessageHeaderType + 104, // 75: proto.ButtonsMessage.documentMessage:type_name -> proto.DocumentMessage + 93, // 76: proto.ButtonsMessage.imageMessage:type_name -> proto.ImageMessage + 147, // 77: proto.ButtonsMessage.videoMessage:type_name -> proto.VideoMessage + 68, // 78: proto.ButtonsMessage.locationMessage:type_name -> proto.LocationMessage + 116, // 79: proto.Button.buttonText:type_name -> proto.ButtonText + 19, // 80: proto.Button.type:type_name -> proto.Button.ButtonType + 115, // 81: proto.Button.nativeFlowInfo:type_name -> proto.NativeFlowInfo + 133, // 82: proto.AudioMessage.contextInfo:type_name -> proto.ContextInfo + 121, // 83: proto.AppStateSyncKey.keyId:type_name -> proto.AppStateSyncKeyId + 123, // 84: proto.AppStateSyncKey.keyData:type_name -> proto.AppStateSyncKeyData + 118, // 85: proto.AppStateSyncKeyShare.keys:type_name -> proto.AppStateSyncKey + 121, // 86: proto.AppStateSyncKeyRequest.keyIds:type_name -> proto.AppStateSyncKeyId + 122, // 87: proto.AppStateSyncKeyData.fingerprint:type_name -> proto.AppStateSyncKeyFingerprint + 141, // 88: proto.InteractiveAnnotation.polygonVertices:type_name -> proto.Point + 125, // 89: proto.InteractiveAnnotation.location:type_name -> proto.Location + 129, // 90: proto.HydratedTemplateButton.quickReplyButton:type_name -> proto.HydratedQuickReplyButton + 128, // 91: proto.HydratedTemplateButton.urlButton:type_name -> proto.HydratedURLButton + 130, // 92: proto.HydratedTemplateButton.callButton:type_name -> proto.HydratedCallButton + 20, // 93: proto.DisappearingMode.initiator:type_name -> proto.DisappearingMode.DisappearingModeInitiator + 145, // 94: proto.ContextInfo.quotedMessage:type_name -> proto.Message + 135, // 95: proto.ContextInfo.quotedAd:type_name -> proto.AdReplyInfo + 174, // 96: proto.ContextInfo.placeholderKey:type_name -> proto.MessageKey + 134, // 97: proto.ContextInfo.externalAdReply:type_name -> proto.ExternalAdReplyInfo + 131, // 98: proto.ContextInfo.disappearingMode:type_name -> proto.DisappearingMode + 136, // 99: proto.ContextInfo.actionLink:type_name -> proto.ActionLink + 21, // 100: proto.ExternalAdReplyInfo.mediaType:type_name -> proto.ExternalAdReplyInfo.ExternalAdReplyInfoMediaType + 22, // 101: proto.AdReplyInfo.mediaType:type_name -> proto.AdReplyInfo.AdReplyInfoMediaType + 139, // 102: proto.TemplateButton.quickReplyButton:type_name -> proto.QuickReplyButton + 138, // 103: proto.TemplateButton.urlButton:type_name -> proto.URLButton + 140, // 104: proto.TemplateButton.callButton:type_name -> proto.CallButton + 95, // 105: proto.URLButton.displayText:type_name -> proto.HighlyStructuredMessage + 95, // 106: proto.URLButton.url:type_name -> proto.HighlyStructuredMessage + 95, // 107: proto.QuickReplyButton.displayText:type_name -> proto.HighlyStructuredMessage + 95, // 108: proto.CallButton.displayText:type_name -> proto.HighlyStructuredMessage + 95, // 109: proto.CallButton.phoneNumber:type_name -> proto.HighlyStructuredMessage + 143, // 110: proto.PaymentBackground.mediaData:type_name -> proto.PBMediaData + 23, // 111: proto.PaymentBackground.type:type_name -> proto.PaymentBackground.PaymentBackgroundType + 154, // 112: proto.Message.senderKeyDistributionMessage:type_name -> proto.SenderKeyDistributionMessage + 93, // 113: proto.Message.imageMessage:type_name -> proto.ImageMessage + 108, // 114: proto.Message.contactMessage:type_name -> proto.ContactMessage + 68, // 115: proto.Message.locationMessage:type_name -> proto.LocationMessage + 103, // 116: proto.Message.extendedTextMessage:type_name -> proto.ExtendedTextMessage + 104, // 117: proto.Message.documentMessage:type_name -> proto.DocumentMessage + 117, // 118: proto.Message.audioMessage:type_name -> proto.AudioMessage + 147, // 119: proto.Message.videoMessage:type_name -> proto.VideoMessage + 111, // 120: proto.Message.call:type_name -> proto.Call + 109, // 121: proto.Message.chat:type_name -> proto.Chat + 158, // 122: proto.Message.protocolMessage:type_name -> proto.ProtocolMessage + 107, // 123: proto.Message.contactsArrayMessage:type_name -> proto.ContactsArrayMessage + 95, // 124: proto.Message.highlyStructuredMessage:type_name -> proto.HighlyStructuredMessage + 154, // 125: proto.Message.fastRatchetKeySenderKeyDistributionMessage:type_name -> proto.SenderKeyDistributionMessage + 155, // 126: proto.Message.sendPaymentMessage:type_name -> proto.SendPaymentMessage + 69, // 127: proto.Message.liveLocationMessage:type_name -> proto.LiveLocationMessage + 156, // 128: proto.Message.requestPaymentMessage:type_name -> proto.RequestPaymentMessage + 106, // 129: proto.Message.declinePaymentRequestMessage:type_name -> proto.DeclinePaymentRequestMessage + 110, // 130: proto.Message.cancelPaymentRequestMessage:type_name -> proto.CancelPaymentRequestMessage + 148, // 131: proto.Message.templateMessage:type_name -> proto.TemplateMessage + 153, // 132: proto.Message.stickerMessage:type_name -> proto.StickerMessage + 101, // 133: proto.Message.groupInviteMessage:type_name -> proto.GroupInviteMessage + 151, // 134: proto.Message.templateButtonReplyMessage:type_name -> proto.TemplateButtonReplyMessage + 159, // 135: proto.Message.productMessage:type_name -> proto.ProductMessage + 105, // 136: proto.Message.deviceSentMessage:type_name -> proto.DeviceSentMessage + 146, // 137: proto.Message.messageContextInfo:type_name -> proto.MessageContextInfo + 72, // 138: proto.Message.listMessage:type_name -> proto.ListMessage + 102, // 139: proto.Message.viewOnceMessage:type_name -> proto.FutureProofMessage + 67, // 140: proto.Message.orderMessage:type_name -> proto.OrderMessage + 70, // 141: proto.Message.listResponseMessage:type_name -> proto.ListResponseMessage + 102, // 142: proto.Message.ephemeralMessage:type_name -> proto.FutureProofMessage + 80, // 143: proto.Message.invoiceMessage:type_name -> proto.InvoiceMessage + 113, // 144: proto.Message.buttonsMessage:type_name -> proto.ButtonsMessage + 112, // 145: proto.Message.buttonsResponseMessage:type_name -> proto.ButtonsResponseMessage + 66, // 146: proto.Message.paymentInviteMessage:type_name -> proto.PaymentInviteMessage + 84, // 147: proto.Message.interactiveMessage:type_name -> proto.InteractiveMessage + 157, // 148: proto.Message.reactionMessage:type_name -> proto.ReactionMessage + 152, // 149: proto.Message.stickerSyncRmrMessage:type_name -> proto.StickerSyncRMRMessage + 81, // 150: proto.Message.interactiveResponseMessage:type_name -> proto.InteractiveResponseMessage + 64, // 151: proto.Message.pollCreationMessage:type_name -> proto.PollCreationMessage + 61, // 152: proto.Message.pollUpdateMessage:type_name -> proto.PollUpdateMessage + 79, // 153: proto.Message.keepInChatMessage:type_name -> proto.KeepInChatMessage + 132, // 154: proto.MessageContextInfo.deviceListMetadata:type_name -> proto.DeviceListMetadata + 126, // 155: proto.VideoMessage.interactiveAnnotations:type_name -> proto.InteractiveAnnotation + 133, // 156: proto.VideoMessage.contextInfo:type_name -> proto.ContextInfo + 24, // 157: proto.VideoMessage.gifAttribution:type_name -> proto.VideoMessage.VideoMessageAttribution + 133, // 158: proto.TemplateMessage.contextInfo:type_name -> proto.ContextInfo + 149, // 159: proto.TemplateMessage.hydratedTemplate:type_name -> proto.HydratedFourRowTemplate + 150, // 160: proto.TemplateMessage.fourRowTemplate:type_name -> proto.FourRowTemplate + 149, // 161: proto.TemplateMessage.hydratedFourRowTemplate:type_name -> proto.HydratedFourRowTemplate + 127, // 162: proto.HydratedFourRowTemplate.hydratedButtons:type_name -> proto.HydratedTemplateButton + 104, // 163: proto.HydratedFourRowTemplate.documentMessage:type_name -> proto.DocumentMessage + 93, // 164: proto.HydratedFourRowTemplate.imageMessage:type_name -> proto.ImageMessage + 147, // 165: proto.HydratedFourRowTemplate.videoMessage:type_name -> proto.VideoMessage + 68, // 166: proto.HydratedFourRowTemplate.locationMessage:type_name -> proto.LocationMessage + 95, // 167: proto.FourRowTemplate.content:type_name -> proto.HighlyStructuredMessage + 95, // 168: proto.FourRowTemplate.footer:type_name -> proto.HighlyStructuredMessage + 137, // 169: proto.FourRowTemplate.buttons:type_name -> proto.TemplateButton + 104, // 170: proto.FourRowTemplate.documentMessage:type_name -> proto.DocumentMessage + 95, // 171: proto.FourRowTemplate.highlyStructuredMessage:type_name -> proto.HighlyStructuredMessage + 93, // 172: proto.FourRowTemplate.imageMessage:type_name -> proto.ImageMessage + 147, // 173: proto.FourRowTemplate.videoMessage:type_name -> proto.VideoMessage + 68, // 174: proto.FourRowTemplate.locationMessage:type_name -> proto.LocationMessage + 133, // 175: proto.TemplateButtonReplyMessage.contextInfo:type_name -> proto.ContextInfo + 133, // 176: proto.StickerMessage.contextInfo:type_name -> proto.ContextInfo + 145, // 177: proto.SendPaymentMessage.noteMessage:type_name -> proto.Message + 174, // 178: proto.SendPaymentMessage.requestMessageKey:type_name -> proto.MessageKey + 142, // 179: proto.SendPaymentMessage.background:type_name -> proto.PaymentBackground + 145, // 180: proto.RequestPaymentMessage.noteMessage:type_name -> proto.Message + 144, // 181: proto.RequestPaymentMessage.amount:type_name -> proto.Money + 142, // 182: proto.RequestPaymentMessage.background:type_name -> proto.PaymentBackground + 174, // 183: proto.ReactionMessage.key:type_name -> proto.MessageKey + 174, // 184: proto.ProtocolMessage.key:type_name -> proto.MessageKey + 25, // 185: proto.ProtocolMessage.type:type_name -> proto.ProtocolMessage.ProtocolMessageType + 94, // 186: proto.ProtocolMessage.historySyncNotification:type_name -> proto.HistorySyncNotification + 119, // 187: proto.ProtocolMessage.appStateSyncKeyShare:type_name -> proto.AppStateSyncKeyShare + 120, // 188: proto.ProtocolMessage.appStateSyncKeyRequest:type_name -> proto.AppStateSyncKeyRequest + 92, // 189: proto.ProtocolMessage.initialSecurityNotificationSettingSync:type_name -> proto.InitialSecurityNotificationSettingSync + 124, // 190: proto.ProtocolMessage.appStateFatalExceptionNotification:type_name -> proto.AppStateFatalExceptionNotification + 131, // 191: proto.ProtocolMessage.disappearingMode:type_name -> proto.DisappearingMode + 58, // 192: proto.ProductMessage.product:type_name -> proto.ProductSnapshot + 59, // 193: proto.ProductMessage.catalog:type_name -> proto.CatalogSnapshot + 133, // 194: proto.ProductMessage.contextInfo:type_name -> proto.ContextInfo + 26, // 195: proto.HistorySync.syncType:type_name -> proto.HistorySync.HistorySyncHistorySyncType + 167, // 196: proto.HistorySync.conversations:type_name -> proto.Conversation + 236, // 197: proto.HistorySync.statusV3Messages:type_name -> proto.WebMessageInfo + 162, // 198: proto.HistorySync.pushnames:type_name -> proto.Pushname + 166, // 199: proto.HistorySync.globalSettings:type_name -> proto.GlobalSettings + 236, // 200: proto.HistorySyncMsg.message:type_name -> proto.WebMessageInfo + 27, // 201: proto.GroupParticipant.rank:type_name -> proto.GroupParticipant.GroupParticipantRank + 161, // 202: proto.GlobalSettings.lightThemeWallpaper:type_name -> proto.WallpaperSettings + 1, // 203: proto.GlobalSettings.mediaVisibility:type_name -> proto.MediaVisibility + 161, // 204: proto.GlobalSettings.darkThemeWallpaper:type_name -> proto.WallpaperSettings + 168, // 205: proto.GlobalSettings.autoDownloadWiFi:type_name -> proto.AutoDownloadSettings + 168, // 206: proto.GlobalSettings.autoDownloadCellular:type_name -> proto.AutoDownloadSettings + 168, // 207: proto.GlobalSettings.autoDownloadRoaming:type_name -> proto.AutoDownloadSettings + 164, // 208: proto.Conversation.messages:type_name -> proto.HistorySyncMsg + 28, // 209: proto.Conversation.endOfHistoryTransferType:type_name -> proto.Conversation.ConversationEndOfHistoryTransferType + 131, // 210: proto.Conversation.disappearingMode:type_name -> proto.DisappearingMode + 165, // 211: proto.Conversation.participant:type_name -> proto.GroupParticipant + 161, // 212: proto.Conversation.wallpaper:type_name -> proto.WallpaperSettings + 1, // 213: proto.Conversation.mediaVisibility:type_name -> proto.MediaVisibility + 170, // 214: proto.MsgRowOpaqueData.currentMsg:type_name -> proto.MsgOpaqueData + 170, // 215: proto.MsgRowOpaqueData.quotedMsg:type_name -> proto.MsgOpaqueData + 171, // 216: proto.MsgOpaqueData.pollOptions:type_name -> proto.PollOption + 29, // 217: proto.MediaRetryNotification.result:type_name -> proto.MediaRetryNotification.MediaRetryNotificationResultType + 175, // 218: proto.SyncdSnapshot.version:type_name -> proto.SyncdVersion + 178, // 219: proto.SyncdSnapshot.records:type_name -> proto.SyncdRecord + 183, // 220: proto.SyncdSnapshot.keyId:type_name -> proto.KeyId + 182, // 221: proto.SyncdRecord.index:type_name -> proto.SyncdIndex + 176, // 222: proto.SyncdRecord.value:type_name -> proto.SyncdValue + 183, // 223: proto.SyncdRecord.keyId:type_name -> proto.KeyId + 175, // 224: proto.SyncdPatch.version:type_name -> proto.SyncdVersion + 181, // 225: proto.SyncdPatch.mutations:type_name -> proto.SyncdMutation + 184, // 226: proto.SyncdPatch.externalMutations:type_name -> proto.ExternalBlobReference + 183, // 227: proto.SyncdPatch.keyId:type_name -> proto.KeyId + 185, // 228: proto.SyncdPatch.exitCode:type_name -> proto.ExitCode + 181, // 229: proto.SyncdMutations.mutations:type_name -> proto.SyncdMutation + 30, // 230: proto.SyncdMutation.operation:type_name -> proto.SyncdMutation.SyncdMutationSyncdOperation + 178, // 231: proto.SyncdMutation.record:type_name -> proto.SyncdRecord + 193, // 232: proto.SyncActionValue.starAction:type_name -> proto.StarAction + 211, // 233: proto.SyncActionValue.contactAction:type_name -> proto.ContactAction + 202, // 234: proto.SyncActionValue.muteAction:type_name -> proto.MuteAction + 201, // 235: proto.SyncActionValue.pinAction:type_name -> proto.PinAction + 194, // 236: proto.SyncActionValue.securityNotificationSetting:type_name -> proto.SecurityNotificationSetting + 199, // 237: proto.SyncActionValue.pushNameSetting:type_name -> proto.PushNameSetting + 198, // 238: proto.SyncActionValue.quickReplyAction:type_name -> proto.QuickReplyAction + 195, // 239: proto.SyncActionValue.recentStickerWeightsAction:type_name -> proto.RecentStickerWeightsAction + 196, // 240: proto.SyncActionValue.recentStickerMetadata:type_name -> proto.RecentStickerMetadata + 197, // 241: proto.SyncActionValue.recentEmojiWeightsAction:type_name -> proto.RecentEmojiWeightsAction + 205, // 242: proto.SyncActionValue.labelEditAction:type_name -> proto.LabelEditAction + 206, // 243: proto.SyncActionValue.labelAssociationAction:type_name -> proto.LabelAssociationAction + 204, // 244: proto.SyncActionValue.localeSetting:type_name -> proto.LocaleSetting + 213, // 245: proto.SyncActionValue.archiveChatAction:type_name -> proto.ArchiveChatAction + 209, // 246: proto.SyncActionValue.deleteMessageForMeAction:type_name -> proto.DeleteMessageForMeAction + 207, // 247: proto.SyncActionValue.keyExpiration:type_name -> proto.KeyExpiration + 203, // 248: proto.SyncActionValue.markChatAsReadAction:type_name -> proto.MarkChatAsReadAction + 212, // 249: proto.SyncActionValue.clearChatAction:type_name -> proto.ClearChatAction + 210, // 250: proto.SyncActionValue.deleteChatAction:type_name -> proto.DeleteChatAction + 188, // 251: proto.SyncActionValue.unarchiveChatsSetting:type_name -> proto.UnarchiveChatsSetting + 200, // 252: proto.SyncActionValue.primaryFeature:type_name -> proto.PrimaryFeature + 208, // 253: proto.SyncActionValue.favoriteStickerAction:type_name -> proto.FavoriteStickerAction + 214, // 254: proto.SyncActionValue.androidUnsupportedActions:type_name -> proto.AndroidUnsupportedActions + 215, // 255: proto.SyncActionValue.agentAction:type_name -> proto.AgentAction + 192, // 256: proto.SyncActionValue.subscriptionAction:type_name -> proto.SubscriptionAction + 187, // 257: proto.SyncActionValue.userStatusMuteAction:type_name -> proto.UserStatusMuteAction + 189, // 258: proto.SyncActionValue.timeFormatAction:type_name -> proto.TimeFormatAction + 174, // 259: proto.SyncActionMessage.key:type_name -> proto.MessageKey + 190, // 260: proto.SyncActionMessageRange.messages:type_name -> proto.SyncActionMessage + 217, // 261: proto.RecentStickerWeightsAction.weights:type_name -> proto.RecentStickerWeight + 218, // 262: proto.RecentEmojiWeightsAction.weights:type_name -> proto.RecentEmojiWeight + 191, // 263: proto.MarkChatAsReadAction.messageRange:type_name -> proto.SyncActionMessageRange + 191, // 264: proto.DeleteChatAction.messageRange:type_name -> proto.SyncActionMessageRange + 191, // 265: proto.ClearChatAction.messageRange:type_name -> proto.SyncActionMessageRange + 191, // 266: proto.ArchiveChatAction.messageRange:type_name -> proto.SyncActionMessageRange + 186, // 267: proto.SyncActionData.value:type_name -> proto.SyncActionValue + 221, // 268: proto.VerifiedNameDetails.localizedNames:type_name -> proto.LocalizedName + 31, // 269: proto.BizIdentityInfo.vlevel:type_name -> proto.BizIdentityInfo.BizIdentityInfoVerifiedLevelValue + 219, // 270: proto.BizIdentityInfo.vnameCert:type_name -> proto.VerifiedNameCertificate + 32, // 271: proto.BizIdentityInfo.hostStorage:type_name -> proto.BizIdentityInfo.BizIdentityInfoHostStorageType + 33, // 272: proto.BizIdentityInfo.actualActors:type_name -> proto.BizIdentityInfo.BizIdentityInfoActualActorsType + 219, // 273: proto.BizAccountPayload.vnameCert:type_name -> proto.VerifiedNameCertificate + 34, // 274: proto.BizAccountLinkInfo.hostStorage:type_name -> proto.BizAccountLinkInfo.BizAccountLinkInfoHostStorageType + 35, // 275: proto.BizAccountLinkInfo.accountType:type_name -> proto.BizAccountLinkInfo.BizAccountLinkInfoAccountType + 227, // 276: proto.HandshakeMessage.clientHello:type_name -> proto.ClientHello + 226, // 277: proto.HandshakeMessage.serverHello:type_name -> proto.ServerHello + 228, // 278: proto.HandshakeMessage.clientFinish:type_name -> proto.ClientFinish + 232, // 279: proto.ClientPayload.userAgent:type_name -> proto.UserAgent + 230, // 280: proto.ClientPayload.webInfo:type_name -> proto.WebInfo + 36, // 281: proto.ClientPayload.connectType:type_name -> proto.ClientPayload.ClientPayloadConnectType + 37, // 282: proto.ClientPayload.connectReason:type_name -> proto.ClientPayload.ClientPayloadConnectReason + 234, // 283: proto.ClientPayload.dnsSource:type_name -> proto.DNSSource + 233, // 284: proto.ClientPayload.devicePairingData:type_name -> proto.DevicePairingRegistrationData + 38, // 285: proto.ClientPayload.product:type_name -> proto.ClientPayload.ClientPayloadProduct + 39, // 286: proto.ClientPayload.iosAppExtension:type_name -> proto.ClientPayload.ClientPayloadIOSAppExtension + 231, // 287: proto.WebInfo.webdPayload:type_name -> proto.WebdPayload + 40, // 288: proto.WebInfo.webSubPlatform:type_name -> proto.WebInfo.WebInfoWebSubPlatform + 41, // 289: proto.UserAgent.platform:type_name -> proto.UserAgent.UserAgentPlatform + 57, // 290: proto.UserAgent.appVersion:type_name -> proto.AppVersion + 42, // 291: proto.UserAgent.releaseChannel:type_name -> proto.UserAgent.UserAgentReleaseChannel + 43, // 292: proto.DNSSource.dnsMethod:type_name -> proto.DNSSource.DNSSourceDNSResolutionMethod + 236, // 293: proto.WebNotificationsInfo.notifyMessages:type_name -> proto.WebMessageInfo + 174, // 294: proto.WebMessageInfo.key:type_name -> proto.MessageKey + 145, // 295: proto.WebMessageInfo.message:type_name -> proto.Message + 44, // 296: proto.WebMessageInfo.status:type_name -> proto.WebMessageInfo.WebMessageInfoStatus + 45, // 297: proto.WebMessageInfo.messageStubType:type_name -> proto.WebMessageInfo.WebMessageInfoStubType + 244, // 298: proto.WebMessageInfo.paymentInfo:type_name -> proto.PaymentInfo + 69, // 299: proto.WebMessageInfo.finalLiveLocation:type_name -> proto.LiveLocationMessage + 244, // 300: proto.WebMessageInfo.quotedPaymentInfo:type_name -> proto.PaymentInfo + 46, // 301: proto.WebMessageInfo.bizPrivacyStatus:type_name -> proto.WebMessageInfo.WebMessageInfoBizPrivacyStatus + 246, // 302: proto.WebMessageInfo.mediaData:type_name -> proto.MediaData + 243, // 303: proto.WebMessageInfo.photoChange:type_name -> proto.PhotoChange + 238, // 304: proto.WebMessageInfo.userReceipt:type_name -> proto.UserReceipt + 240, // 305: proto.WebMessageInfo.reactions:type_name -> proto.Reaction + 246, // 306: proto.WebMessageInfo.quotedStickerData:type_name -> proto.MediaData + 239, // 307: proto.WebMessageInfo.statusPsa:type_name -> proto.StatusPSA + 241, // 308: proto.WebMessageInfo.pollUpdates:type_name -> proto.PollUpdate + 242, // 309: proto.WebMessageInfo.pollAdditionalMetadata:type_name -> proto.PollAdditionalMetadata + 247, // 310: proto.WebMessageInfo.keepInChat:type_name -> proto.KeepInChat + 47, // 311: proto.WebFeatures.labelsDisplay:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 312: proto.WebFeatures.voipIndividualOutgoing:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 313: proto.WebFeatures.groupsV3:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 314: proto.WebFeatures.groupsV3Create:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 315: proto.WebFeatures.changeNumberV2:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 316: proto.WebFeatures.queryStatusV3Thumbnail:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 317: proto.WebFeatures.liveLocations:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 318: proto.WebFeatures.queryVname:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 319: proto.WebFeatures.voipIndividualIncoming:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 320: proto.WebFeatures.quickRepliesQuery:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 321: proto.WebFeatures.payments:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 322: proto.WebFeatures.stickerPackQuery:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 323: proto.WebFeatures.liveLocationsFinal:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 324: proto.WebFeatures.labelsEdit:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 325: proto.WebFeatures.mediaUpload:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 326: proto.WebFeatures.mediaUploadRichQuickReplies:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 327: proto.WebFeatures.vnameV2:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 328: proto.WebFeatures.videoPlaybackUrl:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 329: proto.WebFeatures.statusRanking:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 330: proto.WebFeatures.voipIndividualVideo:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 331: proto.WebFeatures.thirdPartyStickers:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 332: proto.WebFeatures.frequentlyForwardedSetting:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 333: proto.WebFeatures.groupsV4JoinPermission:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 334: proto.WebFeatures.recentStickers:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 335: proto.WebFeatures.catalog:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 336: proto.WebFeatures.starredStickers:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 337: proto.WebFeatures.voipGroupCall:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 338: proto.WebFeatures.templateMessage:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 339: proto.WebFeatures.templateMessageInteractivity:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 340: proto.WebFeatures.ephemeralMessages:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 341: proto.WebFeatures.e2ENotificationSync:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 342: proto.WebFeatures.recentStickersV2:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 343: proto.WebFeatures.recentStickersV3:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 344: proto.WebFeatures.userNotice:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 345: proto.WebFeatures.support:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 346: proto.WebFeatures.groupUiiCleanup:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 347: proto.WebFeatures.groupDogfoodingInternalOnly:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 348: proto.WebFeatures.settingsSync:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 349: proto.WebFeatures.archiveV2:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 350: proto.WebFeatures.ephemeralAllowGroupMembers:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 351: proto.WebFeatures.ephemeral24HDuration:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 352: proto.WebFeatures.mdForceUpgrade:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 353: proto.WebFeatures.disappearingMode:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 354: proto.WebFeatures.externalMdOptInAvailable:type_name -> proto.WebFeatures.WebFeaturesFlag + 47, // 355: proto.WebFeatures.noDeleteMessageTimeLimit:type_name -> proto.WebFeatures.WebFeaturesFlag + 174, // 356: proto.Reaction.key:type_name -> proto.MessageKey + 174, // 357: proto.PollUpdate.pollUpdateMessageKey:type_name -> proto.MessageKey + 60, // 358: proto.PollUpdate.vote:type_name -> proto.PollVoteMessage + 48, // 359: proto.PaymentInfo.currencyDeprecated:type_name -> proto.PaymentInfo.PaymentInfoCurrency + 49, // 360: proto.PaymentInfo.status:type_name -> proto.PaymentInfo.PaymentInfoStatus + 174, // 361: proto.PaymentInfo.requestMessageKey:type_name -> proto.MessageKey + 50, // 362: proto.PaymentInfo.txnStatus:type_name -> proto.PaymentInfo.PaymentInfoTxnStatus + 144, // 363: proto.PaymentInfo.primaryAmount:type_name -> proto.Money + 144, // 364: proto.PaymentInfo.exchangeAmount:type_name -> proto.Money + 174, // 365: proto.NotificationMessageInfo.key:type_name -> proto.MessageKey + 145, // 366: proto.NotificationMessageInfo.message:type_name -> proto.Message + 0, // 367: proto.KeepInChat.keepType:type_name -> proto.KeepType + 251, // 368: proto.CertChain.leaf:type_name -> proto.CertChainNoiseCertificate + 251, // 369: proto.CertChain.intermediate:type_name -> proto.CertChainNoiseCertificate + 370, // [370:370] is the sub-list for method output_type + 370, // [370:370] is the sub-list for method input_type + 370, // [370:370] is the sub-list for extension type_name + 370, // [370:370] is the sub-list for extension extendee + 0, // [0:370] is the sub-list for field type_name } func init() { file_binary_proto_def_proto_init() } @@ -20590,7 +21142,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CompanionProps); i { + switch v := v.(*DeviceProps); i { case 0: return &v.state case 1: @@ -20614,7 +21166,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtocolMessage); i { + switch v := v.(*ProductSnapshot); i { case 0: return &v.state case 1: @@ -20626,7 +21178,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProductMessage); i { + switch v := v.(*CatalogSnapshot); i { case 0: return &v.state case 1: @@ -20638,7 +21190,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProductSnapshot); i { + switch v := v.(*PollVoteMessage); i { case 0: return &v.state case 1: @@ -20650,7 +21202,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CatalogSnapshot); i { + switch v := v.(*PollUpdateMessage); i { case 0: return &v.state case 1: @@ -20662,7 +21214,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollVoteMessage); i { + switch v := v.(*PollUpdateMessageMetadata); i { case 0: return &v.state case 1: @@ -20674,7 +21226,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollUpdateMessage); i { + switch v := v.(*PollEncValue); i { case 0: return &v.state case 1: @@ -20686,7 +21238,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollEncValue); i { + switch v := v.(*PollCreationMessage); i { case 0: return &v.state case 1: @@ -20698,7 +21250,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollCreationMessage); i { + switch v := v.(*Option); i { case 0: return &v.state case 1: @@ -20710,7 +21262,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Option); i { + switch v := v.(*PaymentInviteMessage); i { case 0: return &v.state case 1: @@ -20722,7 +21274,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PaymentInviteMessage); i { + switch v := v.(*OrderMessage); i { case 0: return &v.state case 1: @@ -20734,7 +21286,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OrderMessage); i { + switch v := v.(*LocationMessage); i { case 0: return &v.state case 1: @@ -20746,7 +21298,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LocationMessage); i { + switch v := v.(*LiveLocationMessage); i { case 0: return &v.state case 1: @@ -20758,7 +21310,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LiveLocationMessage); i { + switch v := v.(*ListResponseMessage); i { case 0: return &v.state case 1: @@ -20770,7 +21322,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListResponseMessage); i { + switch v := v.(*SingleSelectReply); i { case 0: return &v.state case 1: @@ -20782,7 +21334,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SingleSelectReply); i { + switch v := v.(*ListMessage); i { case 0: return &v.state case 1: @@ -20794,7 +21346,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListMessage); i { + switch v := v.(*Section); i { case 0: return &v.state case 1: @@ -20806,7 +21358,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Section); i { + switch v := v.(*Row); i { case 0: return &v.state case 1: @@ -20818,7 +21370,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Row); i { + switch v := v.(*Product); i { case 0: return &v.state case 1: @@ -20830,7 +21382,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Product); i { + switch v := v.(*ProductSection); i { case 0: return &v.state case 1: @@ -20842,7 +21394,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProductSection); i { + switch v := v.(*ProductListInfo); i { case 0: return &v.state case 1: @@ -20854,7 +21406,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProductListInfo); i { + switch v := v.(*ProductListHeaderImage); i { case 0: return &v.state case 1: @@ -20866,7 +21418,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProductListHeaderImage); i { + switch v := v.(*KeepInChatMessage); i { case 0: return &v.state case 1: @@ -21814,7 +22366,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[107].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EphemeralSetting); i { + switch v := v.(*ProtocolMessage); i { case 0: return &v.state case 1: @@ -21826,7 +22378,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[108].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WallpaperSettings); i { + switch v := v.(*ProductMessage); i { case 0: return &v.state case 1: @@ -21838,7 +22390,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[109].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Pushname); i { + switch v := v.(*EphemeralSetting); i { case 0: return &v.state case 1: @@ -21850,7 +22402,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[110].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HistorySync); i { + switch v := v.(*WallpaperSettings); i { case 0: return &v.state case 1: @@ -21862,7 +22414,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[111].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HistorySyncMsg); i { + switch v := v.(*Pushname); i { case 0: return &v.state case 1: @@ -21874,7 +22426,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[112].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GroupParticipant); i { + switch v := v.(*HistorySync); i { case 0: return &v.state case 1: @@ -21886,7 +22438,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[113].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GlobalSettings); i { + switch v := v.(*HistorySyncMsg); i { case 0: return &v.state case 1: @@ -21898,7 +22450,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[114].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Conversation); i { + switch v := v.(*GroupParticipant); i { case 0: return &v.state case 1: @@ -21910,7 +22462,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[115].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AutoDownloadSettings); i { + switch v := v.(*GlobalSettings); i { case 0: return &v.state case 1: @@ -21922,7 +22474,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[116].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgRowOpaqueData); i { + switch v := v.(*Conversation); i { case 0: return &v.state case 1: @@ -21934,7 +22486,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[117].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgOpaqueData); i { + switch v := v.(*AutoDownloadSettings); i { case 0: return &v.state case 1: @@ -21946,7 +22498,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[118].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollOption); i { + switch v := v.(*MsgRowOpaqueData); i { case 0: return &v.state case 1: @@ -21958,7 +22510,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[119].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServerErrorReceipt); i { + switch v := v.(*MsgOpaqueData); i { case 0: return &v.state case 1: @@ -21970,7 +22522,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[120].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MediaRetryNotification); i { + switch v := v.(*PollOption); i { case 0: return &v.state case 1: @@ -21982,7 +22534,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[121].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageKey); i { + switch v := v.(*ServerErrorReceipt); i { case 0: return &v.state case 1: @@ -21994,7 +22546,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[122].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdVersion); i { + switch v := v.(*MediaRetryNotification); i { case 0: return &v.state case 1: @@ -22006,7 +22558,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[123].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdValue); i { + switch v := v.(*MessageKey); i { case 0: return &v.state case 1: @@ -22018,7 +22570,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[124].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdSnapshot); i { + switch v := v.(*SyncdVersion); i { case 0: return &v.state case 1: @@ -22030,7 +22582,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[125].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdRecord); i { + switch v := v.(*SyncdValue); i { case 0: return &v.state case 1: @@ -22042,7 +22594,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[126].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdPatch); i { + switch v := v.(*SyncdSnapshot); i { case 0: return &v.state case 1: @@ -22054,7 +22606,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[127].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdMutations); i { + switch v := v.(*SyncdRecord); i { case 0: return &v.state case 1: @@ -22066,7 +22618,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[128].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdMutation); i { + switch v := v.(*SyncdPatch); i { case 0: return &v.state case 1: @@ -22078,7 +22630,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[129].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdIndex); i { + switch v := v.(*SyncdMutations); i { case 0: return &v.state case 1: @@ -22090,7 +22642,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[130].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeyId); i { + switch v := v.(*SyncdMutation); i { case 0: return &v.state case 1: @@ -22102,7 +22654,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[131].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExternalBlobReference); i { + switch v := v.(*SyncdIndex); i { case 0: return &v.state case 1: @@ -22114,7 +22666,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[132].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExitCode); i { + switch v := v.(*KeyId); i { case 0: return &v.state case 1: @@ -22126,7 +22678,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[133].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncActionValue); i { + switch v := v.(*ExternalBlobReference); i { case 0: return &v.state case 1: @@ -22138,7 +22690,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[134].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserStatusMuteAction); i { + switch v := v.(*ExitCode); i { case 0: return &v.state case 1: @@ -22150,7 +22702,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[135].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnarchiveChatsSetting); i { + switch v := v.(*SyncActionValue); i { case 0: return &v.state case 1: @@ -22162,7 +22714,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[136].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TimeFormatAction); i { + switch v := v.(*UserStatusMuteAction); i { case 0: return &v.state case 1: @@ -22174,7 +22726,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[137].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncActionMessage); i { + switch v := v.(*UnarchiveChatsSetting); i { case 0: return &v.state case 1: @@ -22186,7 +22738,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[138].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncActionMessageRange); i { + switch v := v.(*TimeFormatAction); i { case 0: return &v.state case 1: @@ -22198,7 +22750,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[139].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubscriptionAction); i { + switch v := v.(*SyncActionMessage); i { case 0: return &v.state case 1: @@ -22210,7 +22762,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[140].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StarAction); i { + switch v := v.(*SyncActionMessageRange); i { case 0: return &v.state case 1: @@ -22222,7 +22774,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[141].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SecurityNotificationSetting); i { + switch v := v.(*SubscriptionAction); i { case 0: return &v.state case 1: @@ -22234,7 +22786,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[142].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RecentStickerWeightsAction); i { + switch v := v.(*StarAction); i { case 0: return &v.state case 1: @@ -22246,7 +22798,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[143].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RecentStickerMetadata); i { + switch v := v.(*SecurityNotificationSetting); i { case 0: return &v.state case 1: @@ -22258,7 +22810,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[144].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RecentEmojiWeightsAction); i { + switch v := v.(*RecentStickerWeightsAction); i { case 0: return &v.state case 1: @@ -22270,7 +22822,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[145].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QuickReplyAction); i { + switch v := v.(*RecentStickerMetadata); i { case 0: return &v.state case 1: @@ -22282,7 +22834,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[146].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PushNameSetting); i { + switch v := v.(*RecentEmojiWeightsAction); i { case 0: return &v.state case 1: @@ -22294,7 +22846,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[147].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PrimaryFeature); i { + switch v := v.(*QuickReplyAction); i { case 0: return &v.state case 1: @@ -22306,7 +22858,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[148].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PinAction); i { + switch v := v.(*PushNameSetting); i { case 0: return &v.state case 1: @@ -22318,7 +22870,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[149].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MuteAction); i { + switch v := v.(*PrimaryFeature); i { case 0: return &v.state case 1: @@ -22330,7 +22882,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[150].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MarkChatAsReadAction); i { + switch v := v.(*PinAction); i { case 0: return &v.state case 1: @@ -22342,7 +22894,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[151].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LocaleSetting); i { + switch v := v.(*MuteAction); i { case 0: return &v.state case 1: @@ -22354,7 +22906,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[152].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LabelEditAction); i { + switch v := v.(*MarkChatAsReadAction); i { case 0: return &v.state case 1: @@ -22366,7 +22918,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[153].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LabelAssociationAction); i { + switch v := v.(*LocaleSetting); i { case 0: return &v.state case 1: @@ -22378,7 +22930,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[154].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeyExpiration); i { + switch v := v.(*LabelEditAction); i { case 0: return &v.state case 1: @@ -22390,7 +22942,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[155].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FavoriteStickerAction); i { + switch v := v.(*LabelAssociationAction); i { case 0: return &v.state case 1: @@ -22402,7 +22954,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[156].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteMessageForMeAction); i { + switch v := v.(*KeyExpiration); i { case 0: return &v.state case 1: @@ -22414,7 +22966,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[157].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteChatAction); i { + switch v := v.(*FavoriteStickerAction); i { case 0: return &v.state case 1: @@ -22426,7 +22978,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[158].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContactAction); i { + switch v := v.(*DeleteMessageForMeAction); i { case 0: return &v.state case 1: @@ -22438,7 +22990,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[159].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClearChatAction); i { + switch v := v.(*DeleteChatAction); i { case 0: return &v.state case 1: @@ -22450,7 +23002,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[160].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ArchiveChatAction); i { + switch v := v.(*ContactAction); i { case 0: return &v.state case 1: @@ -22462,7 +23014,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[161].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AndroidUnsupportedActions); i { + switch v := v.(*ClearChatAction); i { case 0: return &v.state case 1: @@ -22474,7 +23026,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[162].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AgentAction); i { + switch v := v.(*ArchiveChatAction); i { case 0: return &v.state case 1: @@ -22486,7 +23038,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[163].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncActionData); i { + switch v := v.(*AndroidUnsupportedActions); i { case 0: return &v.state case 1: @@ -22498,7 +23050,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[164].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RecentStickerWeight); i { + switch v := v.(*AgentAction); i { case 0: return &v.state case 1: @@ -22510,7 +23062,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[165].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RecentEmojiWeight); i { + switch v := v.(*SyncActionData); i { case 0: return &v.state case 1: @@ -22522,7 +23074,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[166].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VerifiedNameCertificate); i { + switch v := v.(*RecentStickerWeight); i { case 0: return &v.state case 1: @@ -22534,7 +23086,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[167].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VerifiedNameDetails); i { + switch v := v.(*RecentEmojiWeight); i { case 0: return &v.state case 1: @@ -22546,7 +23098,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[168].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LocalizedName); i { + switch v := v.(*VerifiedNameCertificate); i { case 0: return &v.state case 1: @@ -22558,7 +23110,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[169].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BizIdentityInfo); i { + switch v := v.(*VerifiedNameDetails); i { case 0: return &v.state case 1: @@ -22570,7 +23122,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[170].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BizAccountPayload); i { + switch v := v.(*LocalizedName); i { case 0: return &v.state case 1: @@ -22582,7 +23134,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[171].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BizAccountLinkInfo); i { + switch v := v.(*BizIdentityInfo); i { case 0: return &v.state case 1: @@ -22594,7 +23146,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[172].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NoiseCertificate); i { + switch v := v.(*BizAccountPayload); i { case 0: return &v.state case 1: @@ -22606,7 +23158,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[173].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NoiseCertificateDetails); i { + switch v := v.(*BizAccountLinkInfo); i { case 0: return &v.state case 1: @@ -22881,6 +23433,78 @@ func file_binary_proto_def_proto_init() { return nil } } + file_binary_proto_def_proto_msgTypes[196].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeepInChat); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_binary_proto_def_proto_msgTypes[197].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NoiseCertificate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_binary_proto_def_proto_msgTypes[198].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NoiseCertificateDetails); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_binary_proto_def_proto_msgTypes[199].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CertChain); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_binary_proto_def_proto_msgTypes[200].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CertChainNoiseCertificate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_binary_proto_def_proto_msgTypes[201].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CertChainNoiseCertificateDetails); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_binary_proto_def_proto_msgTypes[30].OneofWrappers = []interface{}{ (*InteractiveResponseMessage_NativeFlowResponseMessage)(nil), @@ -22950,8 +23574,8 @@ func file_binary_proto_def_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_binary_proto_def_proto_rawDesc, - NumEnums: 50, - NumMessages: 196, + NumEnums: 51, + NumMessages: 202, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.raw b/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.raw index 9fb85cdd..3b8cdce2 100644 Binary files a/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.raw and b/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.raw differ diff --git a/vendor/go.mau.fi/whatsmeow/binary/proto/def.proto b/vendor/go.mau.fi/whatsmeow/binary/proto/def.proto index 93531585..33f27d42 100644 --- a/vendor/go.mau.fi/whatsmeow/binary/proto/def.proto +++ b/vendor/go.mau.fi/whatsmeow/binary/proto/def.proto @@ -31,10 +31,10 @@ message ADVDeviceIdentity { optional uint32 keyIndex = 3; } -message CompanionProps { +message DeviceProps { optional string os = 1; optional AppVersion version = 2; - enum CompanionPropsPlatformType { + enum DevicePropsPlatformType { UNKNOWN = 0; CHROME = 1; FIREFOX = 2; @@ -50,7 +50,7 @@ message CompanionProps { CATALINA = 12; TCL_TV = 13; } - optional CompanionPropsPlatformType platformType = 3; + optional DevicePropsPlatformType platformType = 3; optional bool requireFullSync = 4; } @@ -62,39 +62,6 @@ message AppVersion { optional uint32 quinary = 5; } -message ProtocolMessage { - optional MessageKey key = 1; - enum ProtocolMessageType { - REVOKE = 0; - EPHEMERAL_SETTING = 3; - EPHEMERAL_SYNC_RESPONSE = 4; - HISTORY_SYNC_NOTIFICATION = 5; - APP_STATE_SYNC_KEY_SHARE = 6; - APP_STATE_SYNC_KEY_REQUEST = 7; - MSG_FANOUT_BACKFILL_REQUEST = 8; - INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC = 9; - APP_STATE_FATAL_EXCEPTION_NOTIFICATION = 10; - } - optional ProtocolMessageType type = 2; - optional uint32 ephemeralExpiration = 4; - optional int64 ephemeralSettingTimestamp = 5; - optional HistorySyncNotification historySyncNotification = 6; - optional AppStateSyncKeyShare appStateSyncKeyShare = 7; - optional AppStateSyncKeyRequest appStateSyncKeyRequest = 8; - optional InitialSecurityNotificationSettingSync initialSecurityNotificationSettingSync = 9; - optional AppStateFatalExceptionNotification appStateFatalExceptionNotification = 10; - optional DisappearingMode disappearingMode = 11; -} - -message ProductMessage { - optional ProductSnapshot product = 1; - optional string businessOwnerJid = 2; - optional CatalogSnapshot catalog = 4; - optional string body = 5; - optional string footer = 6; - optional ContextInfo contextInfo = 17; -} - message ProductSnapshot { optional ImageMessage productImage = 1; optional string productId = 2; @@ -123,6 +90,10 @@ message PollVoteMessage { message PollUpdateMessage { optional MessageKey pollCreationMessageKey = 1; optional PollEncValue vote = 2; + optional PollUpdateMessageMetadata metadata = 3; +} + +message PollUpdateMessageMetadata { } message PollEncValue { @@ -265,6 +236,12 @@ message ProductListHeaderImage { optional bytes jpegThumbnail = 2; } +message KeepInChatMessage { + optional MessageKey key = 1; + optional KeepType keepType = 2; + optional int64 timestampMs = 3; +} + message InvoiceMessage { optional string note = 1; optional string token = 2; @@ -708,6 +685,11 @@ message Location { optional string name = 3; } +enum KeepType { + UNKNOWN = 0; + KEEP_FOR_ALL = 1; + UNDO_KEEP_FOR_ALL = 2; +} message InteractiveAnnotation { repeated Point polygonVertices = 1; oneof action { @@ -926,12 +908,14 @@ message Message { optional InteractiveResponseMessage interactiveResponseMessage = 48; optional PollCreationMessage pollCreationMessage = 49; optional PollUpdateMessage pollUpdateMessage = 50; + optional KeepInChatMessage keepInChatMessage = 51; } message MessageContextInfo { optional DeviceListMetadata deviceListMetadata = 1; optional int32 deviceListMetadataVersion = 2; optional bytes messageSecret = 3; + optional bytes paddingBytes = 4; } message VideoMessage { @@ -1060,6 +1044,39 @@ message ReactionMessage { optional int64 senderTimestampMs = 4; } +message ProtocolMessage { + optional MessageKey key = 1; + enum ProtocolMessageType { + REVOKE = 0; + EPHEMERAL_SETTING = 3; + EPHEMERAL_SYNC_RESPONSE = 4; + HISTORY_SYNC_NOTIFICATION = 5; + APP_STATE_SYNC_KEY_SHARE = 6; + APP_STATE_SYNC_KEY_REQUEST = 7; + MSG_FANOUT_BACKFILL_REQUEST = 8; + INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC = 9; + APP_STATE_FATAL_EXCEPTION_NOTIFICATION = 10; + } + optional ProtocolMessageType type = 2; + optional uint32 ephemeralExpiration = 4; + optional int64 ephemeralSettingTimestamp = 5; + optional HistorySyncNotification historySyncNotification = 6; + optional AppStateSyncKeyShare appStateSyncKeyShare = 7; + optional AppStateSyncKeyRequest appStateSyncKeyRequest = 8; + optional InitialSecurityNotificationSettingSync initialSecurityNotificationSettingSync = 9; + optional AppStateFatalExceptionNotification appStateFatalExceptionNotification = 10; + optional DisappearingMode disappearingMode = 11; +} + +message ProductMessage { + optional ProductSnapshot product = 1; + optional string businessOwnerJid = 2; + optional CatalogSnapshot catalog = 4; + optional string body = 5; + optional string footer = 6; + optional ContextInfo contextInfo = 17; +} + message EphemeralSetting { optional sfixed32 duration = 1; optional sfixed64 timestamp = 2; @@ -1161,6 +1178,17 @@ message Conversation { optional MediaVisibility mediaVisibility = 27; optional uint64 tcTokenSenderTimestamp = 28; optional bool suspended = 29; + optional bool terminated = 30; + optional uint64 createdAt = 31; + optional string createdBy = 32; + optional string description = 33; + optional bool support = 34; + optional bool isParentGroup = 35; + optional bool isDefaultSubgroup = 36; + optional string parentGroupId = 37; + optional string displayName = 38; + optional string pnJid = 39; + optional bool selfMasked = 40; } message AutoDownloadSettings { @@ -1192,8 +1220,8 @@ message MsgOpaqueData { optional string loc = 16; optional string pollName = 17; repeated PollOption pollOptions = 18; - optional bytes pollEncKey = 19; optional uint32 pollSelectableOptionsCount = 20; + optional bytes messageSecret = 21; } message PollOption { @@ -1559,20 +1587,6 @@ message BizAccountLinkInfo { optional BizAccountLinkInfoAccountType accountType = 5; } -message NoiseCertificate { - optional bytes details = 1; - optional bytes signature = 2; -} - -// Renamed from NoiseCertificate$Details -message NoiseCertificateDetails { - optional uint32 serial = 1; - optional string issuer = 2; - optional uint64 expires = 3; - optional string subject = 4; - optional bytes key = 5; -} - message HandshakeMessage { optional ClientHello clientHello = 2; optional ServerHello serverHello = 3; @@ -1943,6 +1957,7 @@ message WebMessageInfo { GROUP_PARTICIPANT_ACCEPT = 140; GROUP_PARTICIPANT_LINKED_GROUP_JOIN = 141; COMMUNITY_CREATE = 142; + EPHEMERAL_KEEP_IN_CHAT = 143; } optional WebMessageInfoStubType messageStubType = 24; optional bool clearMedia = 25; @@ -1976,6 +1991,7 @@ message WebMessageInfo { optional string agentId = 47; optional bool statusAlreadyViewed = 48; optional bytes messageSecret = 49; + optional KeepInChat keepInChat = 50; } message WebFeatures { @@ -2148,3 +2164,43 @@ message MediaData { optional string localPath = 1; } +message KeepInChat { + optional KeepType keepType = 1; + optional int64 serverTimestamp = 2; + optional string deviceJid = 3; +} + +message NoiseCertificate { + optional bytes details = 1; + optional bytes signature = 2; +} + +// Renamed from NoiseCertificate$Details +message NoiseCertificateDetails { + optional uint32 serial = 1; + optional string issuer = 2; + optional uint64 expires = 3; + optional string subject = 4; + optional bytes key = 5; +} + +message CertChain { + optional CertChainNoiseCertificate leaf = 1; + optional CertChainNoiseCertificate intermediate = 2; +} + +// Renamed from CertChain$NoiseCertificate +message CertChainNoiseCertificate { + optional bytes details = 1; + optional bytes signature = 2; +} + +// Renamed from CertChain$NoiseCertificate$Details +message CertChainNoiseCertificateDetails { + optional uint32 serial = 1; + optional uint32 issuerSerial = 2; + optional bytes key = 3; + optional uint64 notBefore = 4; + optional uint64 notAfter = 5; +} + diff --git a/vendor/go.mau.fi/whatsmeow/message.go b/vendor/go.mau.fi/whatsmeow/message.go index 24c1c6c6..7df4bfbb 100644 --- a/vendor/go.mau.fi/whatsmeow/message.go +++ b/vendor/go.mau.fi/whatsmeow/message.go @@ -40,6 +40,9 @@ func (cli *Client) handleEncryptedMessage(node *waBinary.Node) { if err != nil { cli.Log.Warnf("Failed to parse message: %v", err) } else { + if info.VerifiedName != nil && len(info.VerifiedName.Details.GetVerifiedName()) > 0 { + go cli.updateBusinessName(info.Sender, info, info.VerifiedName.Details.GetVerifiedName()) + } if len(info.PushName) > 0 && info.PushName != "-" { go cli.updatePushName(info.Sender, info, info.PushName) } @@ -47,13 +50,17 @@ func (cli *Client) handleEncryptedMessage(node *waBinary.Node) { } } -func (cli *Client) parseMessageSource(node *waBinary.Node) (source types.MessageSource, err error) { +func (cli *Client) parseMessageSource(node *waBinary.Node, requireParticipant bool) (source types.MessageSource, err error) { ag := node.AttrGetter() from := ag.JID("from") if from.Server == types.GroupServer || from.Server == types.BroadcastServer { source.IsGroup = true source.Chat = from - source.Sender = ag.JID("participant") + if requireParticipant { + source.Sender = ag.JID("participant") + } else { + source.Sender = ag.OptionalJIDOrEmpty("participant") + } if source.Sender.User == cli.Store.ID.User { source.IsFromMe = true } @@ -80,7 +87,7 @@ func (cli *Client) parseMessageSource(node *waBinary.Node) (source types.Message func (cli *Client) parseMessageInfo(node *waBinary.Node) (*types.MessageInfo, error) { var info types.MessageInfo var err error - info.MessageSource, err = cli.parseMessageSource(node) + info.MessageSource, err = cli.parseMessageSource(node, true) if err != nil { return nil, err } @@ -96,6 +103,11 @@ func (cli *Client) parseMessageInfo(node *waBinary.Node) (*types.MessageInfo, er for _, child := range node.GetChildren() { if child.Tag == "multicast" { info.Multicast = true + } else if child.Tag == "verified_name" { + info.VerifiedName, err = parseVerifiedNameContent(child) + if err != nil { + cli.Log.Warnf("Failed to parse verified_name node in %s: %v", info.ID, err) + } } else if mediaType, ok := child.AttrGetter().GetString("mediatype", false); ok { info.MediaType = mediaType } diff --git a/vendor/go.mau.fi/whatsmeow/presence.go b/vendor/go.mau.fi/whatsmeow/presence.go index 2943c7da..d5462a9b 100644 --- a/vendor/go.mau.fi/whatsmeow/presence.go +++ b/vendor/go.mau.fi/whatsmeow/presence.go @@ -15,7 +15,7 @@ import ( ) func (cli *Client) handleChatState(node *waBinary.Node) { - source, err := cli.parseMessageSource(node) + source, err := cli.parseMessageSource(node, true) if err != nil { cli.Log.Warnf("Failed to parse chat state update: %v", err) } else if len(node.GetChildren()) != 1 { diff --git a/vendor/go.mau.fi/whatsmeow/receipt.go b/vendor/go.mau.fi/whatsmeow/receipt.go index 3335583c..fbfdbc2d 100644 --- a/vendor/go.mau.fi/whatsmeow/receipt.go +++ b/vendor/go.mau.fi/whatsmeow/receipt.go @@ -20,7 +20,7 @@ func (cli *Client) handleReceipt(node *waBinary.Node) { receipt, err := cli.parseReceipt(node) if err != nil { cli.Log.Warnf("Failed to parse receipt: %v", err) - } else { + } else if receipt != nil { if receipt.Type == events.ReceiptTypeRetry { go func() { err := cli.handleRetryReceipt(receipt, node) @@ -34,9 +34,29 @@ func (cli *Client) handleReceipt(node *waBinary.Node) { go cli.sendAck(node) } +func (cli *Client) handleGroupedReceipt(partialReceipt events.Receipt, participants *waBinary.Node) { + pag := participants.AttrGetter() + partialReceipt.MessageIDs = []types.MessageID{pag.String("key")} + for _, child := range participants.GetChildren() { + if child.Tag != "user" { + cli.Log.Warnf("Unexpected node in grouped receipt participants: %s", child.XMLString()) + continue + } + ag := child.AttrGetter() + receipt := partialReceipt + receipt.Timestamp = ag.UnixTime("t") + receipt.MessageSource.Sender = ag.JID("jid") + if !ag.OK() { + cli.Log.Warnf("Failed to parse user node %s in grouped receipt: %v", child.XMLString(), ag.Error()) + continue + } + go cli.dispatchEvent(&receipt) + } +} + func (cli *Client) parseReceipt(node *waBinary.Node) (*events.Receipt, error) { ag := node.AttrGetter() - source, err := cli.parseMessageSource(node) + source, err := cli.parseMessageSource(node, false) if err != nil { return nil, err } @@ -45,6 +65,16 @@ func (cli *Client) parseReceipt(node *waBinary.Node) (*events.Receipt, error) { Timestamp: ag.UnixTime("t"), Type: events.ReceiptType(ag.OptionalString("type")), } + if source.IsGroup && source.Sender.IsEmpty() { + participantTags := node.GetChildrenByTag("participants") + if len(participantTags) == 0 { + return nil, &ElementMissingError{Tag: "participants", In: "grouped receipt"} + } + for _, pcp := range participantTags { + cli.handleGroupedReceipt(receipt, &pcp) + } + return nil, nil + } mainMessageID := ag.String("id") if !ag.OK() { return nil, fmt.Errorf("failed to parse read receipt attrs: %+v", ag.Errors) diff --git a/vendor/go.mau.fi/whatsmeow/store/clientpayload.go b/vendor/go.mau.fi/whatsmeow/store/clientpayload.go index 6ebf5d99..6e148181 100644 --- a/vendor/go.mau.fi/whatsmeow/store/clientpayload.go +++ b/vendor/go.mau.fi/whatsmeow/store/clientpayload.go @@ -74,7 +74,7 @@ func (vc WAVersionContainer) ProtoAppVersion() *waProto.AppVersion { } // waVersion is the WhatsApp web client version -var waVersion = WAVersionContainer{2, 2218, 8} +var waVersion = WAVersionContainer{2, 2222, 11} // waVersionHash is the md5 hash of a dot-separated waVersion var waVersionHash [16]byte @@ -125,14 +125,14 @@ var BaseClientPayload = &waProto.ClientPayload{ // Deprecated: renamed to DeviceProps var CompanionProps = DeviceProps -var DeviceProps = &waProto.CompanionProps{ +var DeviceProps = &waProto.DeviceProps{ Os: proto.String("whatsmeow"), Version: &waProto.AppVersion{ Primary: proto.Uint32(0), Secondary: proto.Uint32(1), Tertiary: proto.Uint32(0), }, - PlatformType: waProto.CompanionProps_UNKNOWN.Enum(), + PlatformType: waProto.DeviceProps_UNKNOWN.Enum(), RequireFullSync: proto.Bool(false), } diff --git a/vendor/go.mau.fi/whatsmeow/store/sqlstore/container.go b/vendor/go.mau.fi/whatsmeow/store/sqlstore/container.go index b7c0a7c4..8a26fc53 100644 --- a/vendor/go.mau.fi/whatsmeow/store/sqlstore/container.go +++ b/vendor/go.mau.fi/whatsmeow/store/sqlstore/container.go @@ -181,7 +181,8 @@ const ( adv_key, adv_details, adv_account_sig, adv_account_sig_key, adv_device_sig, platform, business_name, push_name) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15) - ON CONFLICT (jid) DO UPDATE SET platform=$12, business_name=$13, push_name=$14 + ON CONFLICT (jid) DO UPDATE + SET platform=excluded.platform, business_name=excluded.business_name, push_name=excluded.push_name ` deleteDeviceQuery = `DELETE FROM whatsmeow_device WHERE jid=$1` ) diff --git a/vendor/go.mau.fi/whatsmeow/store/sqlstore/store.go b/vendor/go.mau.fi/whatsmeow/store/sqlstore/store.go index 01ec2056..abea5fe2 100644 --- a/vendor/go.mau.fi/whatsmeow/store/sqlstore/store.go +++ b/vendor/go.mau.fi/whatsmeow/store/sqlstore/store.go @@ -67,7 +67,7 @@ var _ store.ContactStore = (*SQLStore)(nil) const ( putIdentityQuery = ` INSERT INTO whatsmeow_identity_keys (our_jid, their_id, identity) VALUES ($1, $2, $3) - ON CONFLICT (our_jid, their_id) DO UPDATE SET identity=$3 + ON CONFLICT (our_jid, their_id) DO UPDATE SET identity=excluded.identity ` deleteAllIdentitiesQuery = `DELETE FROM whatsmeow_identity_keys WHERE our_jid=$1 AND their_id LIKE $2` deleteIdentityQuery = `DELETE FROM whatsmeow_identity_keys WHERE our_jid=$1 AND their_id=$2` @@ -108,7 +108,7 @@ const ( hasSessionQuery = `SELECT true FROM whatsmeow_sessions WHERE our_jid=$1 AND their_id=$2` putSessionQuery = ` INSERT INTO whatsmeow_sessions (our_jid, their_id, session) VALUES ($1, $2, $3) - ON CONFLICT (our_jid, their_id) DO UPDATE SET session=$3 + ON CONFLICT (our_jid, their_id) DO UPDATE SET session=excluded.session ` deleteAllSessionsQuery = `DELETE FROM whatsmeow_sessions WHERE our_jid=$1 AND their_id LIKE $2` deleteSessionQuery = `DELETE FROM whatsmeow_sessions WHERE our_jid=$1 AND their_id=$2` @@ -259,7 +259,7 @@ const ( getSenderKeyQuery = `SELECT sender_key FROM whatsmeow_sender_keys WHERE our_jid=$1 AND chat_id=$2 AND sender_id=$3` putSenderKeyQuery = ` INSERT INTO whatsmeow_sender_keys (our_jid, chat_id, sender_id, sender_key) VALUES ($1, $2, $3, $4) - ON CONFLICT (our_jid, chat_id, sender_id) DO UPDATE SET sender_key=$4 + ON CONFLICT (our_jid, chat_id, sender_id) DO UPDATE SET sender_key=excluded.sender_key ` ) @@ -279,7 +279,8 @@ func (s *SQLStore) GetSenderKey(group, user string) (key []byte, err error) { const ( putAppStateSyncKeyQuery = ` INSERT INTO whatsmeow_app_state_sync_keys (jid, key_id, key_data, timestamp, fingerprint) VALUES ($1, $2, $3, $4, $5) - ON CONFLICT (jid, key_id) DO UPDATE SET key_data=$3, timestamp=$4, fingerprint=$5 + ON CONFLICT (jid, key_id) DO UPDATE + SET key_data=excluded.key_data, timestamp=excluded.timestamp, fingerprint=excluded.fingerprint ` getAppStateSyncKeyQuery = `SELECT key_data, timestamp, fingerprint FROM whatsmeow_app_state_sync_keys WHERE jid=$1 AND key_id=$2` ) @@ -301,7 +302,7 @@ func (s *SQLStore) GetAppStateSyncKey(id []byte) (*store.AppStateSyncKey, error) const ( putAppStateVersionQuery = ` INSERT INTO whatsmeow_app_state_version (jid, name, version, hash) VALUES ($1, $2, $3, $4) - ON CONFLICT (jid, name) DO UPDATE SET version=$3, hash=$4 + ON CONFLICT (jid, name) DO UPDATE SET version=excluded.version, hash=excluded.hash ` getAppStateVersionQuery = `SELECT version, hash FROM whatsmeow_app_state_version WHERE jid=$1 AND name=$2` deleteAppStateVersionQuery = `DELETE FROM whatsmeow_app_state_version WHERE jid=$1 AND name=$2` @@ -435,11 +436,11 @@ const ( ` putPushNameQuery = ` INSERT INTO whatsmeow_contacts (our_jid, their_jid, push_name) VALUES ($1, $2, $3) - ON CONFLICT (our_jid, their_jid) DO UPDATE SET push_name=$3 + ON CONFLICT (our_jid, their_jid) DO UPDATE SET push_name=excluded.push_name ` putBusinessNameQuery = ` INSERT INTO whatsmeow_contacts (our_jid, their_jid, business_name) VALUES ($1, $2, $3) - ON CONFLICT (our_jid, their_jid) DO UPDATE SET business_name=$3 + ON CONFLICT (our_jid, their_jid) DO UPDATE SET business_name=excluded.business_name ` getContactQuery = ` SELECT first_name, full_name, push_name, business_name FROM whatsmeow_contacts WHERE our_jid=$1 AND their_jid=$2 @@ -470,23 +471,25 @@ func (s *SQLStore) PutPushName(user types.JID, pushName string) (bool, string, e return false, "", nil } -func (s *SQLStore) PutBusinessName(user types.JID, businessName string) error { +func (s *SQLStore) PutBusinessName(user types.JID, businessName string) (bool, string, error) { s.contactCacheLock.Lock() defer s.contactCacheLock.Unlock() cached, err := s.getContact(user) if err != nil { - return err + return false, "", err } if cached.BusinessName != businessName { _, err = s.db.Exec(putBusinessNameQuery, s.JID, user, businessName) if err != nil { - return err + return false, "", err } + previousName := cached.BusinessName cached.BusinessName = businessName cached.Found = true + return true, previousName, nil } - return nil + return false, "", nil } func (s *SQLStore) PutContactName(user types.JID, firstName, fullName string) error { @@ -643,7 +646,7 @@ func (s *SQLStore) GetAllContacts() (map[types.JID]types.ContactInfo, error) { const ( putChatSettingQuery = ` INSERT INTO whatsmeow_chat_settings (our_jid, chat_jid, %[1]s) VALUES ($1, $2, $3) - ON CONFLICT (our_jid, chat_jid) DO UPDATE SET %[1]s=$3 + ON CONFLICT (our_jid, chat_jid) DO UPDATE SET %[1]s=excluded.%[1]s ` getChatSettingsQuery = ` SELECT muted_until, pinned, archived FROM whatsmeow_chat_settings WHERE our_jid=$1 AND chat_jid=$2 diff --git a/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrade.go b/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrade.go index 37bd7c29..4a4b2ca7 100644 --- a/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrade.go +++ b/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrade.go @@ -239,7 +239,7 @@ func upgradeV2(tx *sql.Tx, container *Container) error { if err != nil { return err } - if container.dialect == "postgres" { + if container.dialect == "postgres" || container.dialect == "pgx" { _, err = tx.Exec(fillSigKeyPostgres) } else { _, err = tx.Exec(fillSigKeySQLite) diff --git a/vendor/go.mau.fi/whatsmeow/store/store.go b/vendor/go.mau.fi/whatsmeow/store/store.go index 19feeb7f..76087e46 100644 --- a/vendor/go.mau.fi/whatsmeow/store/store.go +++ b/vendor/go.mau.fi/whatsmeow/store/store.go @@ -80,7 +80,7 @@ type ContactEntry struct { type ContactStore interface { PutPushName(user types.JID, pushName string) (bool, string, error) - PutBusinessName(user types.JID, businessName string) error + PutBusinessName(user types.JID, businessName string) (bool, string, error) PutContactName(user types.JID, fullName, firstName string) error PutAllContactNames(contacts []ContactEntry) error GetContact(user types.JID) (types.ContactInfo, error) diff --git a/vendor/go.mau.fi/whatsmeow/types/events/appstate.go b/vendor/go.mau.fi/whatsmeow/types/events/appstate.go index 324d8895..2f1d9cbd 100644 --- a/vendor/go.mau.fi/whatsmeow/types/events/appstate.go +++ b/vendor/go.mau.fi/whatsmeow/types/events/appstate.go @@ -30,6 +30,14 @@ type PushName struct { NewPushName string // The new push name that was included in the message. } +// BusinessName is emitted when a message is received with a different verified business name than the previous value cached for the same user. +type BusinessName struct { + JID types.JID + Message *types.MessageInfo // This is only present if the change was detected in a message. + OldBusinessName string + NewBusinessName string +} + // Pin is emitted when a chat is pinned or unpinned from another device. type Pin struct { JID types.JID // The chat which was pinned or unpinned. diff --git a/vendor/go.mau.fi/whatsmeow/types/message.go b/vendor/go.mau.fi/whatsmeow/types/message.go index d4b93ac5..0681268c 100644 --- a/vendor/go.mau.fi/whatsmeow/types/message.go +++ b/vendor/go.mau.fi/whatsmeow/types/message.go @@ -47,6 +47,7 @@ type MessageInfo struct { Multicast bool MediaType string + VerifiedName *VerifiedName DeviceSentMeta *DeviceSentMeta // Metadata for direct messages sent from another one of the user's own devices. } diff --git a/vendor/go.mau.fi/whatsmeow/user.go b/vendor/go.mau.fi/whatsmeow/user.go index bbddd405..eadb6d6e 100644 --- a/vendor/go.mau.fi/whatsmeow/user.go +++ b/vendor/go.mau.fi/whatsmeow/user.go @@ -133,7 +133,7 @@ func (cli *Client) GetUserInfo(jids []types.JID) (map[types.JID]types.UserInfo, info.PictureID, _ = child.GetChildByTag("picture").Attrs["id"].(string) info.Devices = parseDeviceList(jid.User, child.GetChildByTag("devices")) if verifiedName != nil { - cli.updateBusinessName(jid, verifiedName.Details.GetVerifiedName()) + cli.updateBusinessName(jid, nil, verifiedName.Details.GetVerifiedName()) } respData[jid] = info } @@ -262,13 +262,21 @@ func (cli *Client) updatePushName(user types.JID, messageInfo *types.MessageInfo } } -func (cli *Client) updateBusinessName(user types.JID, name string) { +func (cli *Client) updateBusinessName(user types.JID, messageInfo *types.MessageInfo, name string) { if cli.Store.Contacts == nil { return } - err := cli.Store.Contacts.PutBusinessName(user, name) + changed, previousName, err := cli.Store.Contacts.PutBusinessName(user, name) if err != nil { cli.Log.Errorf("Failed to save business name of %s in device store: %v", user, err) + } else if changed { + cli.Log.Debugf("Business name of %s changed from %s to %s, dispatching event", user, previousName, name) + cli.dispatchEvent(&events.BusinessName{ + JID: user, + Message: messageInfo, + OldBusinessName: previousName, + NewBusinessName: name, + }) } } @@ -280,6 +288,10 @@ func parseVerifiedName(businessNode waBinary.Node) (*types.VerifiedName, error) if !ok { return nil, nil } + return parseVerifiedNameContent(verifiedNameNode) +} + +func parseVerifiedNameContent(verifiedNameNode waBinary.Node) (*types.VerifiedName, error) { rawCert, ok := verifiedNameNode.Content.([]byte) if !ok { return nil, nil diff --git a/vendor/gopkg.in/yaml.v3/parserc.go b/vendor/gopkg.in/yaml.v3/parserc.go index ac66fccc..268558a0 100644 --- a/vendor/gopkg.in/yaml.v3/parserc.go +++ b/vendor/gopkg.in/yaml.v3/parserc.go @@ -687,6 +687,9 @@ func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, i func yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) + if token == nil { + return false + } parser.marks = append(parser.marks, token.start_mark) skip_token(parser) } @@ -786,7 +789,7 @@ func yaml_parser_split_stem_comment(parser *yaml_parser_t, stem_len int) { } token := peek_token(parser) - if token.typ != yaml_BLOCK_SEQUENCE_START_TOKEN && token.typ != yaml_BLOCK_MAPPING_START_TOKEN { + if token == nil || token.typ != yaml_BLOCK_SEQUENCE_START_TOKEN && token.typ != yaml_BLOCK_MAPPING_START_TOKEN { return } @@ -813,6 +816,9 @@ func yaml_parser_split_stem_comment(parser *yaml_parser_t, stem_len int) { func yaml_parser_parse_block_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) + if token == nil { + return false + } parser.marks = append(parser.marks, token.start_mark) skip_token(parser) } @@ -922,6 +928,9 @@ func yaml_parser_parse_block_mapping_value(parser *yaml_parser_t, event *yaml_ev func yaml_parser_parse_flow_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) + if token == nil { + return false + } parser.marks = append(parser.marks, token.start_mark) skip_token(parser) } diff --git a/vendor/modules.txt b/vendor/modules.txt index 0d560089..89012565 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -38,7 +38,7 @@ github.com/Rhymen/go-whatsapp/binary/token github.com/Rhymen/go-whatsapp/crypto/cbc github.com/Rhymen/go-whatsapp/crypto/curve25519 github.com/Rhymen/go-whatsapp/crypto/hkdf -# github.com/SevereCloud/vksdk/v2 v2.14.0 +# github.com/SevereCloud/vksdk/v2 v2.14.1 ## explicit; go 1.16 github.com/SevereCloud/vksdk/v2 github.com/SevereCloud/vksdk/v2/api @@ -58,7 +58,7 @@ github.com/blang/semver # github.com/bwmarrin/discordgo v0.25.0 ## explicit; go 1.13 github.com/bwmarrin/discordgo -# github.com/d5/tengo/v2 v2.10.1 +# github.com/d5/tengo/v2 v2.12.0 ## explicit; go 1.13 github.com/d5/tengo/v2 github.com/d5/tengo/v2/parser @@ -93,7 +93,7 @@ github.com/golang-jwt/jwt ## explicit; go 1.9 github.com/golang/protobuf/proto github.com/golang/protobuf/protoc-gen-go/descriptor -# github.com/gomarkdown/markdown v0.0.0-20220603122033-8f3b341fef32 +# github.com/gomarkdown/markdown v0.0.0-20220607163217-45f7c050e2d1 ## explicit; go 1.12 github.com/gomarkdown/markdown github.com/gomarkdown/markdown/ast @@ -183,11 +183,12 @@ github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1 github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1 github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1 github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1 -# github.com/klauspost/compress v1.15.1 -## explicit; go 1.15 +# github.com/klauspost/compress v1.15.6 +## explicit; go 1.16 github.com/klauspost/compress github.com/klauspost/compress/fse github.com/klauspost/compress/huff0 +github.com/klauspost/compress/internal/cpuinfo github.com/klauspost/compress/internal/snapref github.com/klauspost/compress/s2 github.com/klauspost/compress/zstd @@ -403,12 +404,11 @@ github.com/sizeofint/webpanimation github.com/skip2/go-qrcode github.com/skip2/go-qrcode/bitset github.com/skip2/go-qrcode/reedsolomon -# github.com/slack-go/slack v0.10.3 +# github.com/slack-go/slack v0.11.0 ## explicit; go 1.16 github.com/slack-go/slack github.com/slack-go/slack/internal/backoff github.com/slack-go/slack/internal/errorsx -github.com/slack-go/slack/internal/misc github.com/slack-go/slack/internal/timex github.com/slack-go/slack/slackutilsx # github.com/spf13/afero v1.8.2 @@ -435,7 +435,7 @@ github.com/spf13/viper/internal/encoding/javaproperties github.com/spf13/viper/internal/encoding/json github.com/spf13/viper/internal/encoding/toml github.com/spf13/viper/internal/encoding/yaml -# github.com/stretchr/testify v1.7.1 +# github.com/stretchr/testify v1.7.2 ## explicit; go 1.13 github.com/stretchr/testify/assert github.com/stretchr/testify/require @@ -514,7 +514,7 @@ go.mau.fi/libsignal/util/errorhelper go.mau.fi/libsignal/util/keyhelper go.mau.fi/libsignal/util/medium go.mau.fi/libsignal/util/optional -# go.mau.fi/whatsmeow v0.0.0-20220601182603-a8d86cf1812c +# go.mau.fi/whatsmeow v0.0.0-20220624184947-57a69a641154 ## explicit; go 1.17 go.mau.fi/whatsmeow go.mau.fi/whatsmeow/appstate @@ -567,7 +567,7 @@ golang.org/x/crypto/scrypt golang.org/x/crypto/ssh golang.org/x/crypto/ssh/internal/bcrypt_pbkdf golang.org/x/crypto/ssh/terminal -# golang.org/x/image v0.0.0-20220601225756-64ec528b34cd +# golang.org/x/image v0.0.0-20220617043117-41969df76e82 ## explicit; go 1.12 golang.org/x/image/riff golang.org/x/image/vp8 @@ -589,8 +589,8 @@ golang.org/x/net/http2/hpack golang.org/x/net/idna golang.org/x/net/publicsuffix golang.org/x/net/websocket -# golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 -## explicit; go 1.11 +# golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 +## explicit; go 1.15 golang.org/x/oauth2 golang.org/x/oauth2/clientcredentials golang.org/x/oauth2/internal @@ -705,7 +705,7 @@ gopkg.in/olahol/melody.v1 # gopkg.in/yaml.v2 v2.4.0 ## explicit; go 1.15 gopkg.in/yaml.v2 -# gopkg.in/yaml.v3 v3.0.0 +# gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 # layeh.com/gumble v0.0.0-20200818122324-146f9205029b -- cgit v1.2.3