//! Generated from tamil.sbl by Snowball 3.0.0 - https://snowballstem.org/

#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(unused_mut)]
#![allow(unused_parens)]
#![allow(unused_variables)]
use crate::snowball::Among;
use crate::snowball::SnowballEnv;

#[derive(Clone)]
struct Context {
    b_found_vetrumai_urupu: bool,
}

static A_0: &'static [Among<Context>; 4] = &[
    Among("\u{0BB5}\u{0BC1}", -1, 3, None),
    Among("\u{0BB5}\u{0BC2}", -1, 4, None),
    Among("\u{0BB5}\u{0BCA}", -1, 2, None),
    Among("\u{0BB5}\u{0BCB}", -1, 1, None),
];

static A_1: &'static [Among<Context>; 10] = &[
    Among("\u{0B95}", -1, -1, None),
    Among("\u{0B99}", -1, -1, None),
    Among("\u{0B9A}", -1, -1, None),
    Among("\u{0B9E}", -1, -1, None),
    Among("\u{0BA4}", -1, -1, None),
    Among("\u{0BA8}", -1, -1, None),
    Among("\u{0BAA}", -1, -1, None),
    Among("\u{0BAE}", -1, -1, None),
    Among("\u{0BAF}", -1, -1, None),
    Among("\u{0BB5}", -1, -1, None),
];

static A_2: &'static [Among<Context>; 3] = &[
    Among("\u{0BC0}", -1, -1, None),
    Among("\u{0BC8}", -1, -1, None),
    Among("\u{0BBF}", -1, -1, None),
];

static A_3: &'static [Among<Context>; 8] = &[
    Among("\u{0BC0}", -1, -1, None),
    Among("\u{0BC1}", -1, -1, None),
    Among("\u{0BC2}", -1, -1, None),
    Among("\u{0BC6}", -1, -1, None),
    Among("\u{0BC7}", -1, -1, None),
    Among("\u{0BC8}", -1, -1, None),
    Among("\u{0BBE}", -1, -1, None),
    Among("\u{0BBF}", -1, -1, None),
];

static A_4: &'static [Among<Context>; 3] = &[
    Among("", -1, 2, None),
    Among("\u{0BC8}", 0, 1, None),
    Among("\u{0BCD}", 0, 1, None),
];

static A_5: &'static [Among<Context>; 17] = &[
    Among("\u{0BA9}\u{0BC1}", -1, 8, None),
    Among("\u{0BC1}\u{0B95}\u{0BCD}", -1, 7, None),
    Among("\u{0BC1}\u{0B95}\u{0BCD}\u{0B95}\u{0BCD}", -1, 7, None),
    Among("\u{0B9F}\u{0BCD}\u{0B95}\u{0BCD}", -1, 3, None),
    Among("\u{0BB1}\u{0BCD}\u{0B95}\u{0BCD}", -1, 4, None),
    Among("\u{0B99}\u{0BCD}", -1, 9, None),
    Among("\u{0B9F}\u{0BCD}\u{0B9F}\u{0BCD}", -1, 5, None),
    Among("\u{0BA4}\u{0BCD}\u{0BA4}\u{0BCD}", -1, 6, None),
    Among("\u{0BA8}\u{0BCD}\u{0BA4}\u{0BCD}", -1, 1, None),
    Among("\u{0BA8}\u{0BCD}", -1, 1, None),
    Among("\u{0B9F}\u{0BCD}\u{0BAA}\u{0BCD}", -1, 3, None),
    Among("\u{0BAF}\u{0BCD}", -1, 2, None),
    Among("\u{0BA9}\u{0BCD}\u{0BB1}\u{0BCD}", -1, 4, None),
    Among("\u{0BB5}\u{0BCD}", -1, 1, None),
    Among("\u{0BA8}\u{0BCD}\u{0BA4}", -1, 1, None),
    Among("\u{0BAF}", -1, 1, None),
    Among("\u{0BB5}", -1, 1, None),
];

static A_6: &'static [Among<Context>; 6] = &[
    Among("\u{0B95}", -1, -1, None),
    Among("\u{0B9A}", -1, -1, None),
    Among("\u{0B9F}", -1, -1, None),
    Among("\u{0BA4}", -1, -1, None),
    Among("\u{0BAA}", -1, -1, None),
    Among("\u{0BB1}", -1, -1, None),
];

static A_7: &'static [Among<Context>; 6] = &[
    Among("\u{0B95}", -1, -1, None),
    Among("\u{0B9A}", -1, -1, None),
    Among("\u{0B9F}", -1, -1, None),
    Among("\u{0BA4}", -1, -1, None),
    Among("\u{0BAA}", -1, -1, None),
    Among("\u{0BB1}", -1, -1, None),
];

static A_8: &'static [Among<Context>; 11] = &[
    Among("\u{0B9E}", -1, -1, None),
    Among("\u{0BA3}", -1, -1, None),
    Among("\u{0BA8}", -1, -1, None),
    Among("\u{0BA9}", -1, -1, None),
    Among("\u{0BAE}", -1, -1, None),
    Among("\u{0BAF}", -1, -1, None),
    Among("\u{0BB0}", -1, -1, None),
    Among("\u{0BB2}", -1, -1, None),
    Among("\u{0BB3}", -1, -1, None),
    Among("\u{0BB4}", -1, -1, None),
    Among("\u{0BB5}", -1, -1, None),
];

static A_9: &'static [Among<Context>; 9] = &[
    Among("\u{0BC0}", -1, -1, None),
    Among("\u{0BC1}", -1, -1, None),
    Among("\u{0BC2}", -1, -1, None),
    Among("\u{0BC6}", -1, -1, None),
    Among("\u{0BC7}", -1, -1, None),
    Among("\u{0BC8}", -1, -1, None),
    Among("\u{0BCD}", -1, -1, None),
    Among("\u{0BBE}", -1, -1, None),
    Among("\u{0BBF}", -1, -1, None),
];

static A_10: &'static [Among<Context>; 3] = &[
    Among("\u{0B85}", -1, -1, None),
    Among("\u{0B87}", -1, -1, None),
    Among("\u{0B89}", -1, -1, None),
];

static A_11: &'static [Among<Context>; 10] = &[
    Among("\u{0B95}", -1, -1, None),
    Among("\u{0B99}", -1, -1, None),
    Among("\u{0B9A}", -1, -1, None),
    Among("\u{0B9E}", -1, -1, None),
    Among("\u{0BA4}", -1, -1, None),
    Among("\u{0BA8}", -1, -1, None),
    Among("\u{0BAA}", -1, -1, None),
    Among("\u{0BAE}", -1, -1, None),
    Among("\u{0BAF}", -1, -1, None),
    Among("\u{0BB5}", -1, -1, None),
];

static A_12: &'static [Among<Context>; 6] = &[
    Among("\u{0B95}", -1, -1, None),
    Among("\u{0B9A}", -1, -1, None),
    Among("\u{0B9F}", -1, -1, None),
    Among("\u{0BA4}", -1, -1, None),
    Among("\u{0BAA}", -1, -1, None),
    Among("\u{0BB1}", -1, -1, None),
];

static A_13: &'static [Among<Context>; 4] = &[
    Among("\u{0B95}\u{0BB3}\u{0BCD}", -1, 4, None),
    Among(
        "\u{0BC1}\u{0B99}\u{0BCD}\u{0B95}\u{0BB3}\u{0BCD}",
        0,
        1,
        None,
    ),
    Among("\u{0B9F}\u{0BCD}\u{0B95}\u{0BB3}\u{0BCD}", 0, 3, None),
    Among("\u{0BB1}\u{0BCD}\u{0B95}\u{0BB3}\u{0BCD}", 0, 2, None),
];

static A_14: &'static [Among<Context>; 3] = &[
    Among("\u{0BC7}", -1, -1, None),
    Among("\u{0BCB}", -1, -1, None),
    Among("\u{0BBE}", -1, -1, None),
];

static A_15: &'static [Among<Context>; 2] = &[
    Among("\u{0BAA}\u{0BBF}", -1, -1, None),
    Among("\u{0BB5}\u{0BBF}", -1, -1, None),
];

static A_16: &'static [Among<Context>; 8] = &[
    Among("\u{0BC0}", -1, -1, None),
    Among("\u{0BC1}", -1, -1, None),
    Among("\u{0BC2}", -1, -1, None),
    Among("\u{0BC6}", -1, -1, None),
    Among("\u{0BC7}", -1, -1, None),
    Among("\u{0BC8}", -1, -1, None),
    Among("\u{0BBE}", -1, -1, None),
    Among("\u{0BBF}", -1, -1, None),
];

static A_17: &'static [Among<Context>; 26] = &[
    Among("\u{0BAA}\u{0B9F}\u{0BCD}\u{0B9F}\u{0BC1}", -1, 3, None),
    Among(
        "\u{0BB5}\u{0BBF}\u{0B9F}\u{0BCD}\u{0B9F}\u{0BC1}",
        -1,
        3,
        None,
    ),
    Among("\u{0BAA}\u{0B9F}\u{0BC1}", -1, 3, None),
    Among("\u{0BB5}\u{0BBF}\u{0B9F}\u{0BC1}", -1, 3, None),
    Among(
        "\u{0BAA}\u{0B9F}\u{0BCD}\u{0B9F}\u{0BA4}\u{0BC1}",
        -1,
        3,
        None,
    ),
    Among("\u{0BC6}\u{0BA9}\u{0BCD}\u{0BB1}\u{0BC1}", -1, 1, None),
    Among("\u{0BC1}\u{0B9F}\u{0BC8}", -1, 1, None),
    Among("\u{0BBF}\u{0BB2}\u{0BCD}\u{0BB2}\u{0BC8}", -1, 1, None),
    Among("\u{0BC1}\u{0B9F}\u{0BA9}\u{0BCD}", -1, 1, None),
    Among("\u{0BC6}\u{0BA9}\u{0BC1}\u{0BAE}\u{0BCD}", -1, 1, None),
    Among("\u{0BBF}\u{0B9F}\u{0BAE}\u{0BCD}", -1, 1, None),
    Among(
        "\u{0BC6}\u{0BB2}\u{0BCD}\u{0BB2}\u{0BBE}\u{0BAE}\u{0BCD}",
        -1,
        3,
        None,
    ),
    Among("\u{0BAA}\u{0B9F}\u{0BCD}\u{0B9F}", -1, 3, None),
    Among("\u{0BAA}\u{0B9F}\u{0BCD}\u{0B9F}\u{0BA3}", -1, 3, None),
    Among("\u{0BC6}\u{0BA9}", -1, 1, None),
    Among("\u{0BA4}\u{0BBE}\u{0BA9}", -1, 3, None),
    Among(
        "\u{0BAA}\u{0B9F}\u{0BBF}\u{0BA4}\u{0BBE}\u{0BA9}",
        15,
        3,
        None,
    ),
    Among("\u{0BC1}\u{0B9F}\u{0BC8}\u{0BAF}", -1, 1, None),
    Among("\u{0BBE}\u{0B95}\u{0BBF}\u{0BAF}", -1, 1, None),
    Among("\u{0B95}\u{0BC1}\u{0BB0}\u{0BBF}\u{0BAF}", -1, 3, None),
    Among("\u{0BB2}\u{0BCD}\u{0BB2}", -1, 2, None),
    Among("\u{0BC1}\u{0BB3}\u{0BCD}\u{0BB3}", -1, 1, None),
    Among("\u{0BBE}\u{0B95}\u{0BBF}", -1, 1, None),
    Among("\u{0BAA}\u{0B9F}\u{0BBF}", -1, 3, None),
    Among("\u{0BBF}\u{0BA9}\u{0BCD}\u{0BB1}\u{0BBF}", -1, 1, None),
    Among("\u{0BAA}\u{0BB1}\u{0BCD}\u{0BB1}\u{0BBF}", -1, 3, None),
];

static A_18: &'static [Among<Context>; 8] = &[
    Among("\u{0BC0}", -1, -1, None),
    Among("\u{0BC1}", -1, -1, None),
    Among("\u{0BC2}", -1, -1, None),
    Among("\u{0BC6}", -1, -1, None),
    Among("\u{0BC7}", -1, -1, None),
    Among("\u{0BC8}", -1, -1, None),
    Among("\u{0BBE}", -1, -1, None),
    Among("\u{0BBF}", -1, -1, None),
];

static A_19: &'static [Among<Context>; 8] = &[
    Among("\u{0BC0}", -1, -1, None),
    Among("\u{0BC1}", -1, -1, None),
    Among("\u{0BC2}", -1, -1, None),
    Among("\u{0BC6}", -1, -1, None),
    Among("\u{0BC7}", -1, -1, None),
    Among("\u{0BC8}", -1, -1, None),
    Among("\u{0BBE}", -1, -1, None),
    Among("\u{0BBF}", -1, -1, None),
];

static A_20: &'static [Among<Context>; 22] = &[
    Among("\u{0BC0}", -1, 7, None),
    Among("\u{0BCA}\u{0B9F}\u{0BC1}", -1, 2, None),
    Among("\u{0BCB}\u{0B9F}\u{0BC1}", -1, 2, None),
    Among("\u{0BA4}\u{0BC1}", -1, 6, None),
    Among(
        "\u{0BBF}\u{0BB0}\u{0BC1}\u{0BA8}\u{0BCD}\u{0BA4}\u{0BC1}",
        3,
        2,
        None,
    ),
    Among("\u{0BBF}\u{0BA9}\u{0BCD}\u{0BB1}\u{0BC1}", -1, 2, None),
    Among("\u{0BC1}\u{0B9F}\u{0BC8}", -1, 2, None),
    Among("\u{0BA9}\u{0BC8}", -1, 1, None),
    Among("\u{0B95}\u{0BA3}\u{0BCD}", -1, 1, None),
    Among("\u{0BAE}\u{0BC1}\u{0BA9}\u{0BCD}", -1, 1, None),
    Among("\u{0BBF}\u{0BA9}\u{0BCD}", -1, 3, None),
    Among("\u{0BBF}\u{0B9F}\u{0BAE}\u{0BCD}", -1, 4, None),
    Among("\u{0BAE}\u{0BC7}\u{0BB1}\u{0BCD}", -1, 1, None),
    Among("\u{0BBF}\u{0BB1}\u{0BCD}", -1, 2, None),
    Among("\u{0BB2}\u{0BCD}", -1, 5, None),
    Among("\u{0BAE}\u{0BC7}\u{0BB2}\u{0BCD}", 14, 1, None),
    Among("\u{0BBE}\u{0BAE}\u{0BB2}\u{0BCD}", 14, 2, None),
    Among("\u{0BBE}\u{0BB2}\u{0BCD}", 14, 2, None),
    Among("\u{0BBF}\u{0BB2}\u{0BCD}", 14, 2, None),
    Among("\u{0BC1}\u{0BB3}\u{0BCD}", -1, 2, None),
    Among("\u{0B95}\u{0BC0}\u{0BB4}\u{0BCD}", -1, 1, None),
    Among("\u{0BB5}\u{0BBF}\u{0B9F}", -1, 2, None),
];

static A_21: &'static [Among<Context>; 6] = &[
    Among("\u{0B95}", -1, -1, None),
    Among("\u{0B9A}", -1, -1, None),
    Among("\u{0B9F}", -1, -1, None),
    Among("\u{0BA4}", -1, -1, None),
    Among("\u{0BAA}", -1, -1, None),
    Among("\u{0BB1}", -1, -1, None),
];

static A_22: &'static [Among<Context>; 6] = &[
    Among("\u{0B95}", -1, -1, None),
    Among("\u{0B9A}", -1, -1, None),
    Among("\u{0B9F}", -1, -1, None),
    Among("\u{0BA4}", -1, -1, None),
    Among("\u{0BAA}", -1, -1, None),
    Among("\u{0BB1}", -1, -1, None),
];

static A_23: &'static [Among<Context>; 12] = &[
    Among("\u{0B85}", -1, -1, None),
    Among("\u{0B86}", -1, -1, None),
    Among("\u{0B87}", -1, -1, None),
    Among("\u{0B88}", -1, -1, None),
    Among("\u{0B89}", -1, -1, None),
    Among("\u{0B8A}", -1, -1, None),
    Among("\u{0B8E}", -1, -1, None),
    Among("\u{0B8F}", -1, -1, None),
    Among("\u{0B90}", -1, -1, None),
    Among("\u{0B92}", -1, -1, None),
    Among("\u{0B93}", -1, -1, None),
    Among("\u{0B94}", -1, -1, None),
];

static A_24: &'static [Among<Context>; 8] = &[
    Among("\u{0BC0}", -1, -1, None),
    Among("\u{0BC1}", -1, -1, None),
    Among("\u{0BC2}", -1, -1, None),
    Among("\u{0BC6}", -1, -1, None),
    Among("\u{0BC7}", -1, -1, None),
    Among("\u{0BC8}", -1, -1, None),
    Among("\u{0BBE}", -1, -1, None),
    Among("\u{0BBF}", -1, -1, None),
];

static A_25: &'static [Among<Context>; 46] = &[
    Among("\u{0B95}\u{0BC1}", -1, 6, None),
    Among("\u{0BAA}\u{0B9F}\u{0BC1}", -1, 1, None),
    Among("\u{0BA4}\u{0BC1}", -1, 3, None),
    Among("\u{0BBF}\u{0BB1}\u{0BCD}\u{0BB1}\u{0BC1}", -1, 1, None),
    Among("\u{0BA9}\u{0BC8}", -1, 1, None),
    Among("\u{0BB5}\u{0BC8}", -1, 1, None),
    Among("\u{0BA9}\u{0BC6}\u{0BA9}\u{0BCD}", -1, 1, None),
    Among("\u{0BC7}\u{0BA9}\u{0BCD}", -1, 5, None),
    Among("\u{0BA9}\u{0BA9}\u{0BCD}", -1, 1, None),
    Among("\u{0BAA}\u{0BA9}\u{0BCD}", -1, 1, None),
    Among("\u{0BB5}\u{0BA9}\u{0BCD}", -1, 2, None),
    Among("\u{0BBE}\u{0BA9}\u{0BCD}", -1, 4, None),
    Among("\u{0BA9}\u{0BBE}\u{0BA9}\u{0BCD}", 11, 1, None),
    Among("\u{0BAE}\u{0BBF}\u{0BA9}\u{0BCD}", -1, 1, None),
    Among("\u{0B95}\u{0BC1}\u{0BAE}\u{0BCD}", -1, 1, None),
    Among("\u{0B9F}\u{0BC1}\u{0BAE}\u{0BCD}", -1, 5, None),
    Among("\u{0BA4}\u{0BC1}\u{0BAE}\u{0BCD}", -1, 1, None),
    Among("\u{0BB1}\u{0BC1}\u{0BAE}\u{0BCD}", -1, 1, None),
    Among("\u{0BC6}\u{0BAE}\u{0BCD}", -1, 5, None),
    Among("\u{0BC7}\u{0BAE}\u{0BCD}", -1, 5, None),
    Among("\u{0BCB}\u{0BAE}\u{0BCD}", -1, 5, None),
    Among("\u{0BA9}\u{0BAE}\u{0BCD}", -1, 1, None),
    Among("\u{0BAA}\u{0BAE}\u{0BCD}", -1, 1, None),
    Among("\u{0BBE}\u{0BAE}\u{0BCD}", -1, 5, None),
    Among("\u{0BBE}\u{0BAF}\u{0BCD}", -1, 5, None),
    Among("\u{0BC0}\u{0BB0}\u{0BCD}", -1, 5, None),
    Among("\u{0BA9}\u{0BB0}\u{0BCD}", -1, 1, None),
    Among("\u{0BAA}\u{0BB0}\u{0BCD}", -1, 1, None),
    Among("\u{0BC0}\u{0BAF}\u{0BB0}\u{0BCD}", -1, 5, None),
    Among("\u{0BB5}\u{0BB0}\u{0BCD}", -1, 1, None),
    Among("\u{0BBE}\u{0BB0}\u{0BCD}", -1, 5, None),
    Among("\u{0BA9}\u{0BBE}\u{0BB0}\u{0BCD}", 30, 1, None),
    Among("\u{0BAE}\u{0BBE}\u{0BB0}\u{0BCD}", 30, 1, None),
    Among(
        "\u{0B95}\u{0BCA}\u{0BA3}\u{0BCD}\u{0B9F}\u{0BBF}\u{0BB0}\u{0BCD}",
        -1,
        1,
        None,
    ),
    Among("\u{0BA9}\u{0BBF}\u{0BB0}\u{0BCD}", -1, 5, None),
    Among("\u{0BA9}\u{0BB3}\u{0BCD}", -1, 1, None),
    Among("\u{0BAA}\u{0BB3}\u{0BCD}", -1, 1, None),
    Among("\u{0BB5}\u{0BB3}\u{0BCD}", -1, 1, None),
    Among("\u{0BBE}\u{0BB3}\u{0BCD}", -1, 5, None),
    Among("\u{0BA9}\u{0BBE}\u{0BB3}\u{0BCD}", 38, 1, None),
    Among("\u{0B95}", -1, 1, None),
    Among("\u{0BA4}", -1, 1, None),
    Among("\u{0BA9}", -1, 1, None),
    Among("\u{0BAA}", -1, 1, None),
    Among("\u{0BAF}", -1, 1, None),
    Among("\u{0BBE}", -1, 5, None),
];

static A_26: &'static [Among<Context>; 6] = &[
    Among(
        "\u{0B95}\u{0BBF}\u{0BA9}\u{0BCD}\u{0BB1}\u{0BCD}",
        -1,
        -1,
        None,
    ),
    Among(
        "\u{0BBE}\u{0BA8}\u{0BBF}\u{0BA9}\u{0BCD}\u{0BB1}\u{0BCD}",
        -1,
        -1,
        None,
    ),
    Among("\u{0B95}\u{0BBF}\u{0BB1}\u{0BCD}", -1, -1, None),
    Among("\u{0B95}\u{0BBF}\u{0BA9}\u{0BCD}\u{0BB1}", -1, -1, None),
    Among(
        "\u{0BBE}\u{0BA8}\u{0BBF}\u{0BA9}\u{0BCD}\u{0BB1}",
        -1,
        -1,
        None,
    ),
    Among("\u{0B95}\u{0BBF}\u{0BB1}", -1, -1, None),
];

fn r_has_min_length(env: &mut SnowballEnv, context: &mut Context) -> bool {
    return (env.current.chars().count() as i32) > 4;
}

fn r_fix_va_start(env: &mut SnowballEnv, context: &mut Context) -> bool {
    let mut among_var;
    env.bra = env.cursor;
    if (env.cursor + 5 >= env.limit
        || env.current.as_bytes()[(env.cursor + 5) as usize] as u8 >> 5 != 4 as u8
        || ((3078 as i32 >> (env.current.as_bytes()[(env.cursor + 5) as usize] as u8 & 0x1f)) & 1)
            == 0)
    {
        return false;
    }

    among_var = env.find_among(A_0, context);
    if among_var == 0 {
        return false;
    }
    env.ket = env.cursor;
    match among_var {
        1 => {
            env.slice_from("\u{0B93}");
        }
        2 => {
            env.slice_from("\u{0B92}");
        }
        3 => {
            env.slice_from("\u{0B89}");
        }
        4 => {
            env.slice_from("\u{0B8A}");
        }
        _ => (),
    }
    return true;
}

fn r_fix_endings(env: &mut SnowballEnv, context: &mut Context) -> bool {
    let v_1 = env.cursor;
    'lab0: loop {
        'replab1: loop {
            let v_2 = env.cursor;
            'lab2: for _ in 0..1 {
                if !r_fix_ending(env, context) {
                    break 'lab2;
                }
                continue 'replab1;
            }
            env.cursor = v_2;
            break 'replab1;
        }
        break 'lab0;
    }
    env.cursor = v_1;
    return true;
}

fn r_remove_question_prefixes(env: &mut SnowballEnv, context: &mut Context) -> bool {
    env.bra = env.cursor;
    if !env.eq_s(&"\u{0B8E}") {
        return false;
    }
    if env.find_among(A_1, context) == 0 {
        return false;
    }
    if !env.eq_s(&"\u{0BCD}") {
        return false;
    }
    env.ket = env.cursor;
    env.slice_del();
    let v_1 = env.cursor;
    r_fix_va_start(env, context);
    env.cursor = v_1;
    return true;
}

fn r_fix_ending(env: &mut SnowballEnv, context: &mut Context) -> bool {
    let mut among_var;
    if (env.current.chars().count() as i32) <= 3 {
        return false;
    }
    env.limit_backward = env.cursor;
    env.cursor = env.limit;
    'lab0: loop {
        let v_1 = env.limit - env.cursor;
        'lab1: loop {
            env.ket = env.cursor;
            among_var = env.find_among_b(A_5, context);
            if among_var == 0 {
                break 'lab1;
            }
            env.bra = env.cursor;
            match among_var {
                1 => {
                    env.slice_del();
                }
                2 => {
                    let v_2 = env.limit - env.cursor;
                    if env.find_among_b(A_2, context) == 0 {
                        break 'lab1;
                    }
                    env.cursor = env.limit - v_2;
                    env.slice_del();
                }
                3 => {
                    env.slice_from("\u{0BB3}\u{0BCD}");
                }
                4 => {
                    env.slice_from("\u{0BB2}\u{0BCD}");
                }
                5 => {
                    env.slice_from("\u{0B9F}\u{0BC1}");
                }
                6 => {
                    if !context.b_found_vetrumai_urupu {
                        break 'lab1;
                    }
                    let v_3 = env.limit - env.cursor;
                    'lab2: loop {
                        if !env.eq_s_b(&"\u{0BC8}") {
                            break 'lab2;
                        }
                        break 'lab1;
                    }
                    env.cursor = env.limit - v_3;
                    env.slice_from("\u{0BAE}\u{0BCD}");
                }
                7 => {
                    env.slice_from("\u{0BCD}");
                }
                8 => {
                    let v_4 = env.limit - env.cursor;
                    'lab3: loop {
                        if env.find_among_b(A_3, context) == 0 {
                            break 'lab3;
                        }
                        break 'lab1;
                    }
                    env.cursor = env.limit - v_4;
                    env.slice_del();
                }
                9 => {
                    if (env.cursor - 2 <= env.limit_backward
                        || (env.current.as_bytes()[(env.cursor - 1) as usize] as u8 != 136 as u8
                            && env.current.as_bytes()[(env.cursor - 1) as usize] as u8
                                != 141 as u8))
                    {
                        among_var = 2;
                    } else {
                        among_var = env.find_among_b(A_4, context);
                    }
                    match among_var {
                        1 => {
                            env.slice_del();
                        }
                        2 => {
                            env.slice_from("\u{0BAE}\u{0BCD}");
                        }
                        _ => (),
                    }
                }
                _ => (),
            }
            break 'lab0;
        }
        env.cursor = env.limit - v_1;
        env.ket = env.cursor;
        if !env.eq_s_b(&"\u{0BCD}") {
            return false;
        }
        'lab4: loop {
            let v_5 = env.limit - env.cursor;
            'lab5: loop {
                if env.find_among_b(A_6, context) == 0 {
                    break 'lab5;
                }
                let v_6 = env.limit - env.cursor;
                'lab6: loop {
                    if !env.eq_s_b(&"\u{0BCD}") {
                        env.cursor = env.limit - v_6;
                        break 'lab6;
                    }
                    if env.find_among_b(A_7, context) == 0 {
                        env.cursor = env.limit - v_6;
                        break 'lab6;
                    }
                    break 'lab6;
                }
                env.bra = env.cursor;
                env.slice_del();
                break 'lab4;
            }
            env.cursor = env.limit - v_5;
            'lab7: loop {
                if env.find_among_b(A_8, context) == 0 {
                    break 'lab7;
                }
                env.bra = env.cursor;
                if !env.eq_s_b(&"\u{0BCD}") {
                    break 'lab7;
                }
                env.slice_del();
                break 'lab4;
            }
            env.cursor = env.limit - v_5;
            let v_7 = env.limit - env.cursor;
            if env.find_among_b(A_9, context) == 0 {
                return false;
            }
            env.cursor = env.limit - v_7;
            env.bra = env.cursor;
            env.slice_del();
            break 'lab4;
        }
        break 'lab0;
    }
    env.cursor = env.limit_backward;
    return true;
}

fn r_remove_pronoun_prefixes(env: &mut SnowballEnv, context: &mut Context) -> bool {
    env.bra = env.cursor;
    if (env.cursor + 2 >= env.limit
        || env.current.as_bytes()[(env.cursor + 2) as usize] as u8 >> 5 != 4 as u8
        || ((672 as i32 >> (env.current.as_bytes()[(env.cursor + 2) as usize] as u8 & 0x1f)) & 1)
            == 0)
    {
        return false;
    }

    if env.find_among(A_10, context) == 0 {
        return false;
    }
    if env.find_among(A_11, context) == 0 {
        return false;
    }
    if !env.eq_s(&"\u{0BCD}") {
        return false;
    }
    env.ket = env.cursor;
    env.slice_del();
    let v_1 = env.cursor;
    r_fix_va_start(env, context);
    env.cursor = v_1;
    return true;
}

fn r_remove_plural_suffix(env: &mut SnowballEnv, context: &mut Context) -> bool {
    let mut among_var;
    env.limit_backward = env.cursor;
    env.cursor = env.limit;
    env.ket = env.cursor;
    if (env.cursor - 8 <= env.limit_backward
        || env.current.as_bytes()[(env.cursor - 1) as usize] as u8 != 141 as u8)
    {
        return false;
    }

    among_var = env.find_among_b(A_13, context);
    if among_var == 0 {
        return false;
    }
    env.bra = env.cursor;
    match among_var {
        1 => 'lab0: loop {
            let v_1 = env.limit - env.cursor;
            'lab1: loop {
                if env.find_among_b(A_12, context) == 0 {
                    break 'lab1;
                }
                env.slice_from("\u{0BC1}\u{0B99}\u{0BCD}");
                break 'lab0;
            }
            env.cursor = env.limit - v_1;
            env.slice_from("\u{0BCD}");
            break 'lab0;
        },
        2 => {
            env.slice_from("\u{0BB2}\u{0BCD}");
        }
        3 => {
            env.slice_from("\u{0BB3}\u{0BCD}");
        }
        4 => {
            env.slice_del();
        }
        _ => (),
    }
    env.cursor = env.limit_backward;
    return true;
}

fn r_remove_question_suffixes(env: &mut SnowballEnv, context: &mut Context) -> bool {
    if !r_has_min_length(env, context) {
        return false;
    }
    env.limit_backward = env.cursor;
    env.cursor = env.limit;
    let v_1 = env.limit - env.cursor;
    'lab0: loop {
        env.ket = env.cursor;
        if env.find_among_b(A_14, context) == 0 {
            break 'lab0;
        }
        env.bra = env.cursor;
        env.slice_from("\u{0BCD}");
        break 'lab0;
    }
    env.cursor = env.limit - v_1;
    env.cursor = env.limit_backward;
    r_fix_endings(env, context);
    return true;
}

fn r_remove_command_suffixes(env: &mut SnowballEnv, context: &mut Context) -> bool {
    if !r_has_min_length(env, context) {
        return false;
    }
    env.limit_backward = env.cursor;
    env.cursor = env.limit;
    env.ket = env.cursor;
    if (env.cursor - 5 <= env.limit_backward
        || env.current.as_bytes()[(env.cursor - 1) as usize] as u8 != 191 as u8)
    {
        return false;
    }

    if env.find_among_b(A_15, context) == 0 {
        return false;
    }
    env.bra = env.cursor;
    env.slice_del();
    env.cursor = env.limit_backward;
    return true;
}

fn r_remove_um(env: &mut SnowballEnv, context: &mut Context) -> bool {
    if !r_has_min_length(env, context) {
        return false;
    }
    env.limit_backward = env.cursor;
    env.cursor = env.limit;
    env.ket = env.cursor;
    if !env.eq_s_b(&"\u{0BC1}\u{0BAE}\u{0BCD}") {
        return false;
    }
    env.bra = env.cursor;
    env.slice_from("\u{0BCD}");
    env.cursor = env.limit_backward;
    let v_1 = env.cursor;
    r_fix_ending(env, context);
    env.cursor = v_1;
    return true;
}

fn r_remove_common_word_endings(env: &mut SnowballEnv, context: &mut Context) -> bool {
    let mut among_var;
    if !r_has_min_length(env, context) {
        return false;
    }
    env.limit_backward = env.cursor;
    env.cursor = env.limit;
    env.ket = env.cursor;
    among_var = env.find_among_b(A_17, context);
    if among_var == 0 {
        return false;
    }
    env.bra = env.cursor;
    match among_var {
        1 => {
            env.slice_from("\u{0BCD}");
        }
        2 => {
            let v_1 = env.limit - env.cursor;
            'lab0: loop {
                if env.find_among_b(A_16, context) == 0 {
                    break 'lab0;
                }
                return false;
            }
            env.cursor = env.limit - v_1;
            env.slice_from("\u{0BCD}");
        }
        3 => {
            env.slice_del();
        }
        _ => (),
    }
    env.cursor = env.limit_backward;
    r_fix_endings(env, context);
    return true;
}

fn r_remove_vetrumai_urupukal(env: &mut SnowballEnv, context: &mut Context) -> bool {
    let mut among_var;
    context.b_found_vetrumai_urupu = false;
    if !r_has_min_length(env, context) {
        return false;
    }
    env.limit_backward = env.cursor;
    env.cursor = env.limit;
    'lab0: loop {
        let v_1 = env.limit - env.cursor;
        'lab1: loop {
            let v_2 = env.limit - env.cursor;
            env.ket = env.cursor;
            if (env.cursor - 2 <= env.limit_backward
                || env.current.as_bytes()[(env.cursor - 1) as usize] as u8 >> 5 != 4 as u8
                || ((-2147475197 as i32
                    >> (env.current.as_bytes()[(env.cursor - 1) as usize] as u8 & 0x1f))
                    & 1)
                    == 0)
            {
                break 'lab1;
            }

            among_var = env.find_among_b(A_20, context);
            if among_var == 0 {
                break 'lab1;
            }
            env.bra = env.cursor;
            match among_var {
                1 => {
                    env.slice_del();
                }
                2 => {
                    env.slice_from("\u{0BCD}");
                }
                3 => {
                    let v_3 = env.limit - env.cursor;
                    'lab2: loop {
                        if !env.eq_s_b(&"\u{0BAE}") {
                            break 'lab2;
                        }
                        break 'lab1;
                    }
                    env.cursor = env.limit - v_3;
                    env.slice_from("\u{0BCD}");
                }
                4 => {
                    if (env.current.chars().count() as i32) < 7 {
                        break 'lab1;
                    }
                    env.slice_from("\u{0BCD}");
                }
                5 => {
                    let v_4 = env.limit - env.cursor;
                    'lab3: loop {
                        if env.find_among_b(A_18, context) == 0 {
                            break 'lab3;
                        }
                        break 'lab1;
                    }
                    env.cursor = env.limit - v_4;
                    env.slice_from("\u{0BCD}");
                }
                6 => {
                    let v_5 = env.limit - env.cursor;
                    'lab4: loop {
                        if env.find_among_b(A_19, context) == 0 {
                            break 'lab4;
                        }
                        break 'lab1;
                    }
                    env.cursor = env.limit - v_5;
                    env.slice_del();
                }
                7 => {
                    env.slice_from("\u{0BBF}");
                }
                _ => (),
            }
            env.cursor = env.limit - v_2;
            break 'lab0;
        }
        env.cursor = env.limit - v_1;
        let v_6 = env.limit - env.cursor;
        env.ket = env.cursor;
        if !env.eq_s_b(&"\u{0BC8}") {
            return false;
        }
        'lab5: loop {
            let v_7 = env.limit - env.cursor;
            'lab6: loop {
                let v_8 = env.limit - env.cursor;
                'lab7: loop {
                    if env.find_among_b(A_21, context) == 0 {
                        break 'lab7;
                    }
                    break 'lab6;
                }
                env.cursor = env.limit - v_8;
                break 'lab5;
            }
            env.cursor = env.limit - v_7;
            let v_9 = env.limit - env.cursor;
            if env.find_among_b(A_22, context) == 0 {
                return false;
            }
            if !env.eq_s_b(&"\u{0BCD}") {
                return false;
            }
            env.cursor = env.limit - v_9;
            break 'lab5;
        }
        env.bra = env.cursor;
        env.slice_from("\u{0BCD}");
        env.cursor = env.limit - v_6;
        break 'lab0;
    }
    context.b_found_vetrumai_urupu = true;
    let v_10 = env.limit - env.cursor;
    'lab8: loop {
        env.ket = env.cursor;
        if !env.eq_s_b(&"\u{0BBF}\u{0BA9}\u{0BCD}") {
            break 'lab8;
        }
        env.bra = env.cursor;
        env.slice_from("\u{0BCD}");
        break 'lab8;
    }
    env.cursor = env.limit - v_10;
    env.cursor = env.limit_backward;
    r_fix_endings(env, context);
    return true;
}

fn r_remove_tense_suffixes(env: &mut SnowballEnv, context: &mut Context) -> bool {
    'replab0: loop {
        let v_1 = env.cursor;
        'lab1: for _ in 0..1 {
            if !r_remove_tense_suffix(env, context) {
                break 'lab1;
            }
            continue 'replab0;
        }
        env.cursor = v_1;
        break 'replab0;
    }
    return true;
}

fn r_remove_tense_suffix(env: &mut SnowballEnv, context: &mut Context) -> bool {
    let mut among_var;
    let mut b_found_a_match: bool;
    b_found_a_match = false;
    if !r_has_min_length(env, context) {
        return false;
    }
    env.limit_backward = env.cursor;
    env.cursor = env.limit;
    let v_1 = env.limit - env.cursor;
    'lab0: loop {
        let v_2 = env.limit - env.cursor;
        env.ket = env.cursor;
        among_var = env.find_among_b(A_25, context);
        if among_var == 0 {
            break 'lab0;
        }
        env.bra = env.cursor;
        match among_var {
            1 => {
                env.slice_del();
            }
            2 => {
                let v_3 = env.limit - env.cursor;
                'lab1: loop {
                    if (env.cursor - 2 <= env.limit_backward
                        || env.current.as_bytes()[(env.cursor - 1) as usize] as u8 >> 5 != 4 as u8
                        || ((1951712 as i32
                            >> (env.current.as_bytes()[(env.cursor - 1) as usize] as u8 & 0x1f))
                            & 1)
                            == 0)
                    {
                        break 'lab1;
                    }

                    if env.find_among_b(A_23, context) == 0 {
                        break 'lab1;
                    }
                    break 'lab0;
                }
                env.cursor = env.limit - v_3;
                env.slice_del();
            }
            3 => {
                let v_4 = env.limit - env.cursor;
                'lab2: loop {
                    if env.find_among_b(A_24, context) == 0 {
                        break 'lab2;
                    }
                    break 'lab0;
                }
                env.cursor = env.limit - v_4;
                env.slice_del();
            }
            4 => {
                let v_5 = env.limit - env.cursor;
                'lab3: loop {
                    if !env.eq_s_b(&"\u{0B9A}") {
                        break 'lab3;
                    }
                    break 'lab0;
                }
                env.cursor = env.limit - v_5;
                env.slice_from("\u{0BCD}");
            }
            5 => {
                env.slice_from("\u{0BCD}");
            }
            6 => {
                let v_6 = env.limit - env.cursor;
                if !env.eq_s_b(&"\u{0BCD}") {
                    break 'lab0;
                }
                env.cursor = env.limit - v_6;
                env.slice_del();
            }
            _ => (),
        }
        b_found_a_match = true;
        env.cursor = env.limit - v_2;
        break 'lab0;
    }
    env.cursor = env.limit - v_1;
    let v_7 = env.limit - env.cursor;
    'lab4: loop {
        env.ket = env.cursor;
        if (env.cursor - 8 <= env.limit_backward
            || (env.current.as_bytes()[(env.cursor - 1) as usize] as u8 != 141 as u8
                && env.current.as_bytes()[(env.cursor - 1) as usize] as u8 != 177 as u8))
        {
            break 'lab4;
        }

        if env.find_among_b(A_26, context) == 0 {
            break 'lab4;
        }
        env.bra = env.cursor;
        env.slice_del();
        b_found_a_match = true;
        break 'lab4;
    }
    env.cursor = env.limit - v_7;
    env.cursor = env.limit_backward;
    r_fix_endings(env, context);
    return b_found_a_match;
}

pub fn stem(env: &mut SnowballEnv) -> bool {
    let mut context = &mut Context {
        b_found_vetrumai_urupu: false,
    };
    context.b_found_vetrumai_urupu = false;
    let v_1 = env.cursor;
    r_fix_ending(env, context);
    env.cursor = v_1;
    if !r_has_min_length(env, context) {
        return false;
    }
    let v_2 = env.cursor;
    r_remove_question_prefixes(env, context);
    env.cursor = v_2;
    let v_3 = env.cursor;
    r_remove_pronoun_prefixes(env, context);
    env.cursor = v_3;
    let v_4 = env.cursor;
    r_remove_question_suffixes(env, context);
    env.cursor = v_4;
    let v_5 = env.cursor;
    r_remove_um(env, context);
    env.cursor = v_5;
    let v_6 = env.cursor;
    r_remove_common_word_endings(env, context);
    env.cursor = v_6;
    let v_7 = env.cursor;
    r_remove_vetrumai_urupukal(env, context);
    env.cursor = v_7;
    let v_8 = env.cursor;
    r_remove_plural_suffix(env, context);
    env.cursor = v_8;
    let v_9 = env.cursor;
    r_remove_command_suffixes(env, context);
    env.cursor = v_9;
    let v_10 = env.cursor;
    r_remove_tense_suffixes(env, context);
    env.cursor = v_10;
    return true;
}
