3BE42RZGZGKB6BMNUTRK3M64P6FZF6FBPK2S64DCQXYIY7VHNWCQC
BEUUKQVQ6TPUDVH74NCKA43MMPHOI5X5MF5UNR7WTCAST2HCMBJAC
EFKQM5UNVCK623Y6L2OBSBD4W3E6DHMDPMXORFLCSJGOXHKPAFHQC
O2DTNJ3ZOJJKDHGPNE2DZSZF7CFU4G5D65RIDOYZHYYBH3JZAAIAC
F7J2TR37FEVHXRP522LY6Q3PNL42H4I77QFPAK6ZLSCX7I2X4L7QC
ISDVVVJ4Q47MFFMWYC3XP3KZXLAKRA2VGRQ56MSD44475UNYBWDAC
ZAJWKHWLSWW6A7LVNRQ26EAEGY63KMZXHIICF6G426WQX53FZTWQC
4GYCBWZMY2PYTEPBYHRM5QB5DKYEVFRBIA6YNGKTWBKRTAG63IWQC
F2TD63MB77RLDLPHPNCOYEMW7QSWV6BXXR27SC2Y2OY42CGUQIKAC
SUOEGUZAT4SORFQGSFKE5M45JGIGIFQEDX5VJSYX6XMRYHF522JAC
defp u32(<<0::1, _::bitstring>> = binary) do
<<v::binary-size(1), rest::binary>> = binary
val = WaParser.LEB128.decode_unsigned(v)
{val, rest}
end
defp i32(binary) do
i32(binary, [])
end
defp i32(<<0::1, _::bitstring>> = binary, acc) do
<<v::binary-size(1), rest::binary>> = binary
val = [v | acc] |> Enum.reverse() |> Enum.into(<<>>)
val = WaParser.LEB128.decode_signed(val)
{val, rest}
end
defp i32(<<1::1, _::bitstring>> = binary, acc) do
<<v::binary-size(1), rest::binary>> = binary
i32(rest, [v | acc])
end
defmodule WaParser.Types.Atomic do
def u32(<<0::1, _::bitstring>> = binary) do
<<v::binary-size(1), rest::binary>> = binary
val = WaParser.LEB128.decode_unsigned(v)
{val, rest}
end
def i32(binary) do
i32(binary, [])
end
defp i32(<<0::1, _::bitstring>> = binary, acc) do
<<v::binary-size(1), rest::binary>> = binary
val = [v | acc] |> Enum.reverse() |> Enum.into(<<>>)
val = WaParser.LEB128.decode_signed(val)
{val, rest}
end
defp i32(<<1::1, _::bitstring>> = binary, acc) do
<<v::binary-size(1), rest::binary>> = binary
i32(rest, [v | acc])
end
end