fn(text$0, bytes$1, index$2, count$3, fields$4) =>
match @core.less-than-or-equal(left: $3, right: 1) {
true =>
match @core.less-than-or-equal(left: $3, right: 0) {
true =>
#some({fields: $4, next: $2}),
false =>
match @core.decode-value-at(text: $0, bytes: $1, index: $2) {
#some(key$5) =>
match $5.value {
#string(name$6) =>
match @core.decode-value-at(text: $0, bytes: $1, index: $5.next) {
#some(read$7) =>
#some({fields: @core.list-append(list: $4, item: {key: $6, value: $7.value}), next: $7.next}),
#none(_) =>
#none
},
_ =>
#none
},
#none(_) =>
#none
}
},
false =>
let half$8 = @core.divide(left: $3, right: 2);
match @core.decode-value-fields(text: $0, bytes: $1, index: $2, count: $8, fields: $4) {
#some(first$9) =>
@core.decode-value-fields(text: $0, bytes: $1, index: $9.next, count: @core.minus(left: $3, right: $8), fields: $9.fields),
#none(_) =>
#none
}
}