AmlPkglength.pk.enc.pick: def of bend-osdev-acpi@0.1.2.0 Import: import bend-osdev-acpi@0.1.2.0/aml_pkglength.bend as AmlPkglength Lines 32-45 of bend-osdev-acpi@0.1.2.0/aml_pkglength.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-acpi@0.1.2.0/aml_pkglength.bend&start_line=32&end_line=45 import Base def pk.enc.pick(s1: Bool, s2: Bool, s3: Bool, +v: U32) -> List<&2, U32>: match s1: case True{}: [U32.and(63, v)] case False{}: match s2: case True{}: [U32.or(64, U32.and(15, v)), U32.and(255, U32.shrn(v, 4n))] case False{}: match s3: case True{}: [U32.or(128, U32.and(15, v)), U32.and(255, U32.shrn(v, 4n)), U32.and(255, U32.shrn(v, 12n))] case False{}: [U32.or(192, U32.and(15, v)), U32.and(255, U32.shrn(v, 4n)), U32.and(255, U32.shrn(v, 12n)), U32.and(255, U32.shrn(v, 20n))] Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shrn