pub fn parse_memory_instruction(input: &[u8]) -> IResult<&[u8], MemoryInstruction> {
    alt((
        alt((
            map(
                preceded(match_byte(0x28), parse_memory_argument),
                |memarg| MemoryInstruction::Load(NumberType::I32, memarg),
            ),
            map(
                preceded(match_byte(0x29), parse_memory_argument),
                |memarg| MemoryInstruction::Load(NumberType::I64, memarg),
            ),
            map(
                preceded(match_byte(0x2A), parse_memory_argument),
                |memarg| MemoryInstruction::Load(NumberType::F32, memarg),
            ),
            map(
                preceded(match_byte(0x2B), parse_memory_argument),
                |memarg| MemoryInstruction::Load(NumberType::F64, memarg),
            ),
            map(
                preceded(match_byte(0x2C), parse_memory_argument),
                |memarg| MemoryInstruction::Load8(IntegerType::I32, SignExtension::Signed, memarg),
            ),
            map(
                preceded(match_byte(0x2D), parse_memory_argument),
                |memarg| {
                    MemoryInstruction::Load8(IntegerType::I32, SignExtension::Unsigned, memarg)
                },
            ),
            map(
                preceded(match_byte(0x2E), parse_memory_argument),
                |memarg| MemoryInstruction::Load16(IntegerType::I32, SignExtension::Signed, memarg),
            ),
            map(
                preceded(match_byte(0x2F), parse_memory_argument),
                |memarg| {
                    MemoryInstruction::Load16(IntegerType::I32, SignExtension::Unsigned, memarg)
                },
            ),
            map(
                preceded(match_byte(0x30), parse_memory_argument),
                |memarg| MemoryInstruction::Load8(IntegerType::I64, SignExtension::Signed, memarg),
            ),
            map(
                preceded(match_byte(0x31), parse_memory_argument),
                |memarg| {
                    MemoryInstruction::Load8(IntegerType::I64, SignExtension::Unsigned, memarg)
                },
            ),
            map(
                preceded(match_byte(0x32), parse_memory_argument),
                |memarg| MemoryInstruction::Load16(IntegerType::I64, SignExtension::Signed, memarg),
            ),
            map(
                preceded(match_byte(0x33), parse_memory_argument),
                |memarg| {
                    MemoryInstruction::Load16(IntegerType::I64, SignExtension::Unsigned, memarg)
                },
            ),
            map(
                preceded(match_byte(0x34), parse_memory_argument),
                |memarg| MemoryInstruction::Load32(SignExtension::Signed, memarg),
            ),
            map(
                preceded(match_byte(0x35), parse_memory_argument),
                |memarg| MemoryInstruction::Load32(SignExtension::Unsigned, memarg),
            ),
        )),
        alt((
            map(
                preceded(match_byte(0x36), parse_memory_argument),
                |memarg| MemoryInstruction::Store(NumberType::I32, memarg),
            ),
            map(
                preceded(match_byte(0x37), parse_memory_argument),
                |memarg| MemoryInstruction::Store(NumberType::I64, memarg),
            ),
            map(
                preceded(match_byte(0x38), parse_memory_argument),
                |memarg| MemoryInstruction::Store(NumberType::F32, memarg),
            ),
            map(
                preceded(match_byte(0x39), parse_memory_argument),
                |memarg| MemoryInstruction::Store(NumberType::F64, memarg),
            ),
            map(
                preceded(match_byte(0x3A), parse_memory_argument),
                |memarg| MemoryInstruction::Store8(IntegerType::I32, memarg),
            ),
            map(
                preceded(match_byte(0x3B), parse_memory_argument),
                |memarg| MemoryInstruction::Store16(IntegerType::I32, memarg),
            ),
            map(
                preceded(match_byte(0x3C), parse_memory_argument),
                |memarg| MemoryInstruction::Store8(IntegerType::I64, memarg),
            ),
            map(
                preceded(match_byte(0x3D), parse_memory_argument),
                |memarg| MemoryInstruction::Store16(IntegerType::I64, memarg),
            ),
            map(
                preceded(match_byte(0x3E), parse_memory_argument),
                MemoryInstruction::Store32,
            ),
        )),
        map(tag([0x3F, 0x00]), |_| MemoryInstruction::Size),
        map(tag([0x40, 0x00]), |_| MemoryInstruction::Grow),
        map(
            delimited(tag([0xFC, 8u8]), parse_u32, match_byte(0x00)),
            MemoryInstruction::Init,
        ),
        map(
            preceded(tag([0xFC, 9u8]), parse_u32),
            MemoryInstruction::DataDrop,
        ),
        map(tag([0xFC, 10u8, 0x00, 0x00]), |_| MemoryInstruction::Copy),
        map(tag([0xFC, 11u8, 0x00]), |_| MemoryInstruction::Fill),
    ))(input)
}
/// Parses a WebAssembly memory instruction from the input.
///
/// See <https://webassembly.github.io/spec/core/binary/instructions.html#memory-instructions>
Parses a WebAssembly memory instruction from the input.
See
Parses a WebAssembly memory instruction from the input . See
pub fn parse_memory_instruction(input: &[u8]) -> IResult<&[u8], MemoryInstruction> {
    alt((
        alt((
            map(
                preceded(match_byte(0x28), parse_memory_argument),
                |memarg| MemoryInstruction::Load(NumberType::I32, memarg),
            ),
            map(
                preceded(match_byte(0x29), parse_memory_argument),
                |memarg| MemoryInstruction::Load(NumberType::I64, memarg),
            ),
            map(
                preceded(match_byte(0x2A), parse_memory_argument),
                |memarg| MemoryInstruction::Load(NumberType::F32, memarg),
            ),
            map(
                preceded(match_byte(0x2B), parse_memory_argument),
                |memarg| MemoryInstruction::Load(NumberType::F64, memarg),
            ),
            map(
                preceded(match_byte(0x2C), parse_memory_argument),
                |memarg| MemoryInstruction::Load8(IntegerType::I32, SignExtension::Signed, memarg),
            ),
            map(
                preceded(match_byte(0x2D), parse_memory_argument),
                |memarg| {
                    MemoryInstruction::Load8(IntegerType::I32, SignExtension::Unsigned, memarg)
                },
            ),
            map(
                preceded(match_byte(0x2E), parse_memory_argument),
                |memarg| MemoryInstruction::Load16(IntegerType::I32, SignExtension::Signed, memarg),
            ),
            map(
                preceded(match_byte(0x2F), parse_memory_argument),
                |memarg| {
                    MemoryInstruction::Load16(IntegerType::I32, SignExtension::Unsigned, memarg)
                },
            ),
            map(
                preceded(match_byte(0x30), parse_memory_argument),
                |memarg| MemoryInstruction::Load8(IntegerType::I64, SignExtension::Signed, memarg),
            ),
            map(
                preceded(match_byte(0x31), parse_memory_argument),
                |memarg| {
                    MemoryInstruction::Load8(IntegerType::I64, SignExtension::Unsigned, memarg)
                },
            ),
            map(
                preceded(match_byte(0x32), parse_memory_argument),
                |memarg| MemoryInstruction::Load16(IntegerType::I64, SignExtension::Signed, memarg),
            ),
            map(
                preceded(match_byte(0x33), parse_memory_argument),
                |memarg| {
                    MemoryInstruction::Load16(IntegerType::I64, SignExtension::Unsigned, memarg)
                },
            ),
            map(
                preceded(match_byte(0x34), parse_memory_argument),
                |memarg| MemoryInstruction::Load32(SignExtension::Signed, memarg),
            ),
            map(
                preceded(match_byte(0x35), parse_memory_argument),
                |memarg| MemoryInstruction::Load32(SignExtension::Unsigned, memarg),
            ),
        )),
        alt((
            map(
                preceded(match_byte(0x36), parse_memory_argument),
                |memarg| MemoryInstruction::Store(NumberType::I32, memarg),
            ),
            map(
                preceded(match_byte(0x37), parse_memory_argument),
                |memarg| MemoryInstruction::Store(NumberType::I64, memarg),
            ),
            map(
                preceded(match_byte(0x38), parse_memory_argument),
                |memarg| MemoryInstruction::Store(NumberType::F32, memarg),
            ),
            map(
                preceded(match_byte(0x39), parse_memory_argument),
                |memarg| MemoryInstruction::Store(NumberType::F64, memarg),
            ),
            map(
                preceded(match_byte(0x3A), parse_memory_argument),
                |memarg| MemoryInstruction::Store8(IntegerType::I32, memarg),
            ),
            map(
                preceded(match_byte(0x3B), parse_memory_argument),
                |memarg| MemoryInstruction::Store16(IntegerType::I32, memarg),
            ),
            map(
                preceded(match_byte(0x3C), parse_memory_argument),
                |memarg| MemoryInstruction::Store8(IntegerType::I64, memarg),
            ),
            map(
                preceded(match_byte(0x3D), parse_memory_argument),
                |memarg| MemoryInstruction::Store16(IntegerType::I64, memarg),
            ),
            map(
                preceded(match_byte(0x3E), parse_memory_argument),
                MemoryInstruction::Store32,
            ),
        )),
        map(tag([0x3F, 0x00]), |_| MemoryInstruction::Size),
        map(tag([0x40, 0x00]), |_| MemoryInstruction::Grow),
        map(
            delimited(tag([0xFC, 8u8]), parse_u32, match_byte(0x00)),
            MemoryInstruction::Init,
        ),
        map(
            preceded(tag([0xFC, 9u8]), parse_u32),
            MemoryInstruction::DataDrop,
        ),
        map(tag([0xFC, 10u8, 0x00, 0x00]), |_| MemoryInstruction::Copy),
        map(tag([0xFC, 11u8, 0x00]), |_| MemoryInstruction::Fill),
    ))(input)
}
pub fn parse_memory_instruction ( input : & [ u8 ] ) -> IResult < & [ u8 ] , MemoryInstruction > { alt ( ( alt ( ( map ( preceded ( match_byte ( 0x28 ) , parse_memory_argument ) , | memarg | MemoryInstruction :: Load ( NumberType :: I32 , memarg ) , ) , map ( preceded ( match_byte ( 0x29 ) , parse_memory_argument ) , | memarg | MemoryInstruction :: Load ( NumberType :: I64 , memarg ) , ) , map ( preceded ( match_byte ( 0x2A ) , parse_memory_argument ) , | memarg | MemoryInstruction :: Load ( NumberType :: F32 , memarg ) , ) , map ( preceded ( match_byte ( 0x2B ) , parse_memory_argument ) , | memarg | MemoryInstruction :: Load ( NumberType :: F64 , memarg ) , ) , map ( preceded ( match_byte ( 0x2C ) , parse_memory_argument ) , | memarg | MemoryInstruction :: Load8 ( IntegerType :: I32 , SignExtension :: Signed , memarg ) , ) , map ( preceded ( match_byte ( 0x2D ) , parse_memory_argument ) , | memarg | { MemoryInstruction :: Load8 ( IntegerType :: I32 , SignExtension :: Unsigned , memarg ) } , ) , map ( preceded ( match_byte ( 0x2E ) , parse_memory_argument ) , | memarg | MemoryInstruction :: Load16 ( IntegerType :: I32 , SignExtension :: Signed , memarg ) , ) , map ( preceded ( match_byte ( 0x2F ) , parse_memory_argument ) , | memarg | { MemoryInstruction :: Load16 ( IntegerType :: I32 , SignExtension :: Unsigned , memarg ) } , ) , map ( preceded ( match_byte ( 0x30 ) , parse_memory_argument ) , | memarg | MemoryInstruction :: Load8 ( IntegerType :: I64 , SignExtension :: Signed , memarg ) , ) , map ( preceded ( match_byte ( 0x31 ) , parse_memory_argument ) , | memarg | { MemoryInstruction :: Load8 ( IntegerType :: I64 , SignExtension :: Unsigned , memarg ) } , ) , map ( preceded ( match_byte ( 0x32 ) , parse_memory_argument ) , | memarg | MemoryInstruction :: Load16 ( IntegerType :: I64 , SignExtension :: Signed , memarg ) , ) , map ( preceded ( match_byte ( 0x33 ) , parse_memory_argument ) , | memarg | { MemoryInstruction :: Load16 ( IntegerType :: I64 , SignExtension :: Unsigned , memarg ) } , ) , map ( preceded ( match_byte ( 0x34 ) , parse_memory_argument ) , | memarg | MemoryInstruction :: Load32 ( SignExtension :: Signed , memarg ) , ) , map ( preceded ( match_byte ( 0x35 ) , parse_memory_argument ) , | memarg | MemoryInstruction :: Load32 ( SignExtension :: Unsigned , memarg ) , ) , ) ) , alt ( ( map ( preceded ( match_byte ( 0x36 ) , parse_memory_argument ) , | memarg | MemoryInstruction :: Store ( NumberType :: I32 , memarg ) , ) , map ( preceded ( match_byte ( 0x37 ) , parse_memory_argument ) , | memarg | MemoryInstruction :: Store ( NumberType :: I64 , memarg ) , ) , map ( preceded ( match_byte ( 0x38 ) , parse_memory_argument ) , | memarg | MemoryInstruction :: Store ( NumberType :: F32 , memarg ) , ) , map ( preceded ( match_byte ( 0x39 ) , parse_memory_argument ) , | memarg | MemoryInstruction :: Store ( NumberType :: F64 , memarg ) , ) , map ( preceded ( match_byte ( 0x3A ) , parse_memory_argument ) , | memarg | MemoryInstruction :: Store8 ( IntegerType :: I32 , memarg ) , ) , map ( preceded ( match_byte ( 0x3B ) , parse_memory_argument ) , | memarg | MemoryInstruction :: Store16 ( IntegerType :: I32 , memarg ) , ) , map ( preceded ( match_byte ( 0x3C ) , parse_memory_argument ) , | memarg | MemoryInstruction :: Store8 ( IntegerType :: I64 , memarg ) , ) , map ( preceded ( match_byte ( 0x3D ) , parse_memory_argument ) , | memarg | MemoryInstruction :: Store16 ( IntegerType :: I64 , memarg ) , ) , map ( preceded ( match_byte ( 0x3E ) , parse_memory_argument ) , MemoryInstruction :: Store32 , ) , ) ) , map ( tag ( [ 0x3F , 0x00 ] ) , | _ | MemoryInstruction :: Size ) , map ( tag ( [ 0x40 , 0x00 ] ) , | _ | MemoryInstruction :: Grow ) , map ( delimited ( tag ( [ 0xFC , 8u8 ] ) , parse_u32 , match_byte ( 0x00 ) ) , MemoryInstruction :: Init , ) , map ( preceded ( tag ( [ 0xFC , 9u8 ] ) , parse_u32 ) , MemoryInstruction :: DataDrop , ) , map ( tag ( [ 0xFC , 10u8 , 0x00 , 0x00 ] ) , | _ | MemoryInstruction :: Copy ) , map ( tag ( [ 0xFC , 11u8 , 0x00 ] ) , | _ | MemoryInstruction :: Fill ) , ) ) ( input ) }
Parses a WebAssembly memory instruction from the input.
Parses a WebAssembly memory instruction from the input .
input
&[u8]
input
&[u8]