<commit_before>{{with .}}i := 2{{end}}
{{range $_, $param := .}}
{{if eq .Type "VARIANT"}}
  {{if eq (index .Variant 0).ParamOffset 255}}
  val.{{ToGoName .Name}} = payload[i:]
  {{else}}
  val.{{ToGoName .Name}} = payload[i:i+{{(index .Variant 0).ParamOffset}}]
  i += {{(index .Variant 0).ParamOffset}}
  {{end}}
{{else if eq .Type "STRUCT_BYTE"}}
  {{range $_, $subVal := .BitField}}
    val.{{ToGoName .FieldName}} = (payload[i]{{with .FieldMask}}&{{.}}{{end}}){{with .Shifter}}<<{{.}}{{end}}
  {{end}}
  {{range $_, $subVal := .BitFlag}}
    if payload[i] & {{.FlagMask}} == {{.FlagMask}} {
      val.{{ToGoName .FlagName}} = true
    } else {
      val.{{ToGoName .FlagName}} = false
    }
  {{end}}
  i += 1
{{else if eq .Type "BIT_24"}}
  val.{{ToGoName .Name}} = binary.BigEndian.Uint32(payload[i:i+3])
  i += 3
{{else}}<commit_msg>Add support for parsing more types<commit_after>{{with .}}i := 2{{end}}
{{range $_, $param := .}}
{{if eq .Type "VARIANT"}}
  {{if eq (index .Variant 0).ParamOffset 255}}
  val.{{ToGoName .Name}} = payload[i:]
  {{else}}
  val.{{ToGoName .Name}} = payload[i:i+{{(index .Variant 0).ParamOffset}}]
  i += {{(index .Variant 0).ParamOffset}}
  {{end}}
{{else if eq .Type "STRUCT_BYTE"}}
  {{range $_, $subVal := .BitField}}
    val.{{ToGoName .FieldName}} = (payload[i]{{with .FieldMask}}&{{.}}{{end}}){{with .Shifter}}<<{{.}}{{end}}
  {{end}}
  {{range $_, $subVal := .BitFlag}}
    if payload[i] & {{.FlagMask}} == {{.FlagMask}} {
      val.{{ToGoName .FlagName}} = true
    } else {
      val.{{ToGoName .FlagName}} = false
    }
  {{end}}
  i += 1
{{else if eq .Type "ARRAY"}}
  {{if (index .ArrayAttrib 0).IsAscii}}
  val.{{ToGoName .Name}} = string(payload[i:i+{{(index .ArrayAttrib 0).Length}}])
  {{else}}
  val.{{ToGoName .Name}} = payload[i:i+{{(index .ArrayAttrib 0).Length}}]
  {{end}}
  i += {{(index .ArrayAttrib 0).Length}}
{{else if eq .Type "DWORD"}}
  val.{{ToGoName .Name}} = binary.BigEndian.Uint32(payload[i:i+4])
  i += 4
{{else if eq .Type "BIT_24"}}
  val.{{ToGoName .Name}} = binary.BigEndian.Uint32(payload[i:i+3])
  i += 3
{{else if eq .Type "WORD"}}
  val.{{ToGoName .Name}} = binary.BigEndian.Uint16(payload[i:i+2])
  i += 2
{{else if eq .Type "MARKER"}}
  // MARKER HERE
{{else}}
{'fraction_non_alphanumeric': 0.2591273374888691, 'fraction_numerical': 0.017809439002671415, 'mean_word_length': 3.740506329113924, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4544138', 'n_tokens_mistral': 927, 'n_tokens_neox': 892, 'n_words': 198}