/* Generated by Snowball 2.0.0 - https://snowballstem.org/ */


#include <config.h>
#include <limits.h>
#include "turkish.h"

#define s_0_0 s_0_2
#define s_0_1 s_0_3
static const symbol s_pool[] = {
#define s_0_2 0
'm', 'i', 'z',
#define s_0_3 3
'n', 'i', 'z',
#define s_0_4 6
'm', 'u', 'z',
#define s_0_5 9
'n', 'u', 'z',
#define s_0_6 12
'm', 0xC4, 0xB1, 'z',
#define s_0_7 16
'n', 0xC4, 0xB1, 'z',
#define s_0_8 20
'm', 0xC3, 0xBC, 'z',
#define s_0_9 24
'n', 0xC3, 0xBC, 'z',
#define s_1_0 28
'l', 'e', 'r', 'i',
#define s_1_1 32
'l', 'a', 'r', 0xC4, 0xB1,
#define s_2_0 37
'n', 'i',
#define s_2_1 39
'n', 'u',
#define s_2_2 41
'n', 0xC4, 0xB1,
#define s_2_3 44
'n', 0xC3, 0xBC,
#define s_3_0 47
'i', 'n',
#define s_3_1 49
'u', 'n',
#define s_3_2 51
0xC4, 0xB1, 'n',
#define s_3_3 54
0xC3, 0xBC, 'n',
#define s_4_0 57
'a',
#define s_4_1 58
'e',
#define s_5_0 59
'n', 'a',
#define s_5_1 61
'n', 'e',
#define s_6_0 63
'd', 'a',
#define s_6_1 65
't', 'a',
#define s_6_2 67
'd', 'e',
#define s_6_3 69
't', 'e',
#define s_7_0 71
'n', 'd', 'a',
#define s_7_1 74
'n', 'd', 'e',
#define s_8_0 77
'd', 'a', 'n',
#define s_8_1 80
't', 'a', 'n',
#define s_8_2 83
'd', 'e', 'n',
#define s_8_3 86
't', 'e', 'n',
#define s_9_0 89
'n', 'd', 'a', 'n',
#define s_9_1 93
'n', 'd', 'e', 'n',
#define s_10_0 97
'l', 'a',
#define s_10_1 99
'l', 'e',
#define s_11_0 101
'c', 'a',
#define s_11_1 103
'c', 'e',
#define s_12_0 105
'i', 'm',
#define s_12_1 107
'u', 'm',
#define s_12_2 109
0xC4, 0xB1, 'm',
#define s_12_3 112
0xC3, 0xBC, 'm',
#define s_13_0 115
's', 'i', 'n',
#define s_13_1 118
's', 'u', 'n',
#define s_13_2 121
's', 0xC4, 0xB1, 'n',
#define s_13_3 125
's', 0xC3, 0xBC, 'n',
#define s_14_0 129
'i', 'z',
#define s_14_1 131
'u', 'z',
#define s_14_2 133
0xC4, 0xB1, 'z',
#define s_14_3 136
0xC3, 0xBC, 'z',
#define s_15_0 139
's', 'i', 'n', 'i', 'z',
#define s_15_1 144
's', 'u', 'n', 'u', 'z',
#define s_15_2 149
's', 0xC4, 0xB1, 'n', 0xC4, 0xB1, 'z',
#define s_15_3 156
's', 0xC3, 0xBC, 'n', 0xC3, 0xBC, 'z',
#define s_16_0 163
'l', 'a', 'r',
#define s_16_1 166
'l', 'e', 'r',
#define s_17_0 169
'n', 'i', 'z',
#define s_17_1 172
'n', 'u', 'z',
#define s_17_2 175
'n', 0xC4, 0xB1, 'z',
#define s_17_3 179
'n', 0xC3, 0xBC, 'z',
#define s_18_0 183
'd', 'i', 'r',
#define s_18_1 186
't', 'i', 'r',
#define s_18_2 189
'd', 'u', 'r',
#define s_18_3 192
't', 'u', 'r',
#define s_18_4 195
'd', 0xC4, 0xB1, 'r',
#define s_18_5 199
't', 0xC4, 0xB1, 'r',
#define s_18_6 203
'd', 0xC3, 0xBC, 'r',
#define s_18_7 207
't', 0xC3, 0xBC, 'r',
#define s_19_0 211
'c', 'a', 's', 0xC4, 0xB1, 'n', 'a',
#define s_19_1 218
'c', 'e', 's', 'i', 'n', 'e',
#define s_20_0 s_20_2
#define s_20_1 s_20_3
#define s_20_2 224
'd', 'i', 'k',
#define s_20_3 227
't', 'i', 'k',
#define s_20_4 230
'd', 'u', 'k',
#define s_20_5 233
't', 'u', 'k',
#define s_20_6 236
'd', 0xC4, 0xB1, 'k',
#define s_20_7 240
't', 0xC4, 0xB1, 'k',
#define s_20_8 244
'd', 0xC3, 0xBC, 'k',
#define s_20_9 248
't', 0xC3, 0xBC, 'k',
#define s_20_10 252
'd', 'i', 'm',
#define s_20_11 255
't', 'i', 'm',
#define s_20_12 258
'd', 'u', 'm',
#define s_20_13 261
't', 'u', 'm',
#define s_20_14 264
'd', 0xC4, 0xB1, 'm',
#define s_20_15 268
't', 0xC4, 0xB1, 'm',
#define s_20_16 272
'd', 0xC3, 0xBC, 'm',
#define s_20_17 276
't', 0xC3, 0xBC, 'm',
#define s_20_18 280
'd', 'i', 'n',
#define s_20_19 283
't', 'i', 'n',
#define s_20_20 286
'd', 'u', 'n',
#define s_20_21 289
't', 'u', 'n',
#define s_20_22 292
'd', 0xC4, 0xB1, 'n',
#define s_20_23 296
't', 0xC4, 0xB1, 'n',
#define s_20_24 300
'd', 0xC3, 0xBC, 'n',
#define s_20_25 304
't', 0xC3, 0xBC, 'n',
#define s_20_26 s_20_4
#define s_20_27 s_20_5
#define s_20_28 s_20_6
#define s_20_29 s_20_7
#define s_20_30 s_20_8
#define s_20_31 s_20_9
#define s_21_0 s_21_2
#define s_21_1 s_21_3
#define s_21_2 308
's', 'a', 'k',
#define s_21_3 311
's', 'e', 'k',
#define s_21_4 314
's', 'a', 'm',
#define s_21_5 317
's', 'e', 'm',
#define s_21_6 320
's', 'a', 'n',
#define s_21_7 323
's', 'e', 'n',
#define s_22_0 326
'm', 'i', 0xC5, 0x9F,
#define s_22_1 330
'm', 'u', 0xC5, 0x9F,
#define s_22_2 334
'm', 0xC4, 0xB1, 0xC5, 0x9F,
#define s_22_3 339
'm', 0xC3, 0xBC, 0xC5, 0x9F,
#define s_23_0 344
'b',
#define s_23_1 345
'c',
#define s_23_2 346
'd',
#define s_23_3 347
0xC4, 0x9F,
};


static const struct among a_0[10] =
{
/*  0 */ { 1, s_0_0, -1, -1},
/*  1 */ { 1, s_0_1, -1, -1},
/*  2 */ { 3, s_0_2, -1, -1},
/*  3 */ { 3, s_0_3, -1, -1},
/*  4 */ { 3, s_0_4, -1, -1},
/*  5 */ { 3, s_0_5, -1, -1},
/*  6 */ { 4, s_0_6, -1, -1},
/*  7 */ { 4, s_0_7, -1, -1},
/*  8 */ { 4, s_0_8, -1, -1},
/*  9 */ { 4, s_0_9, -1, -1}
};


static const struct among a_1[2] =
{
/*  0 */ { 4, s_1_0, -1, -1},
/*  1 */ { 5, s_1_1, -1, -1}
};


static const struct among a_2[4] =
{
/*  0 */ { 2, s_2_0, -1, -1},
/*  1 */ { 2, s_2_1, -1, -1},
/*  2 */ { 3, s_2_2, -1, -1},
/*  3 */ { 3, s_2_3, -1, -1}
};


static const struct among a_3[4] =
{
/*  0 */ { 2, s_3_0, -1, -1},
/*  1 */ { 2, s_3_1, -1, -1},
/*  2 */ { 3, s_3_2, -1, -1},
/*  3 */ { 3, s_3_3, -1, -1}
};


static const struct among a_4[2] =
{
/*  0 */ { 1, s_4_0, -1, -1},
/*  1 */ { 1, s_4_1, -1, -1}
};


static const struct among a_5[2] =
{
/*  0 */ { 2, s_5_0, -1, -1},
/*  1 */ { 2, s_5_1, -1, -1}
};


static const struct among a_6[4] =
{
/*  0 */ { 2, s_6_0, -1, -1},
/*  1 */ { 2, s_6_1, -1, -1},
/*  2 */ { 2, s_6_2, -1, -1},
/*  3 */ { 2, s_6_3, -1, -1}
};


static const struct among a_7[2] =
{
/*  0 */ { 3, s_7_0, -1, -1},
/*  1 */ { 3, s_7_1, -1, -1}
};


static const struct among a_8[4] =
{
/*  0 */ { 3, s_8_0, -1, -1},
/*  1 */ { 3, s_8_1, -1, -1},
/*  2 */ { 3, s_8_2, -1, -1},
/*  3 */ { 3, s_8_3, -1, -1}
};


static const struct among a_9[2] =
{
/*  0 */ { 4, s_9_0, -1, -1},
/*  1 */ { 4, s_9_1, -1, -1}
};


static const struct among a_10[2] =
{
/*  0 */ { 2, s_10_0, -1, -1},
/*  1 */ { 2, s_10_1, -1, -1}
};


static const struct among a_11[2] =
{
/*  0 */ { 2, s_11_0, -1, -1},
/*  1 */ { 2, s_11_1, -1, -1}
};


static const struct among a_12[4] =
{
/*  0 */ { 2, s_12_0, -1, -1},
/*  1 */ { 2, s_12_1, -1, -1},
/*  2 */ { 3, s_12_2, -1, -1},
/*  3 */ { 3, s_12_3, -1, -1}
};


static const struct among a_13[4] =
{
/*  0 */ { 3, s_13_0, -1, -1},
/*  1 */ { 3, s_13_1, -1, -1},
/*  2 */ { 4, s_13_2, -1, -1},
/*  3 */ { 4, s_13_3, -1, -1}
};


static const struct among a_14[4] =
{
/*  0 */ { 2, s_14_0, -1, -1},
/*  1 */ { 2, s_14_1, -1, -1},
/*  2 */ { 3, s_14_2, -1, -1},
/*  3 */ { 3, s_14_3, -1, -1}
};


static const struct among a_15[4] =
{
/*  0 */ { 5, s_15_0, -1, -1},
/*  1 */ { 5, s_15_1, -1, -1},
/*  2 */ { 7, s_15_2, -1, -1},
/*  3 */ { 7, s_15_3, -1, -1}
};


static const struct among a_16[2] =
{
/*  0 */ { 3, s_16_0, -1, -1},
/*  1 */ { 3, s_16_1, -1, -1}
};


static const struct among a_17[4] =
{
/*  0 */ { 3, s_17_0, -1, -1},
/*  1 */ { 3, s_17_1, -1, -1},
/*  2 */ { 4, s_17_2, -1, -1},
/*  3 */ { 4, s_17_3, -1, -1}
};


static const struct among a_18[8] =
{
/*  0 */ { 3, s_18_0, -1, -1},
/*  1 */ { 3, s_18_1, -1, -1},
/*  2 */ { 3, s_18_2, -1, -1},
/*  3 */ { 3, s_18_3, -1, -1},
/*  4 */ { 4, s_18_4, -1, -1},
/*  5 */ { 4, s_18_5, -1, -1},
/*  6 */ { 4, s_18_6, -1, -1},
/*  7 */ { 4, s_18_7, -1, -1}
};


static const struct among a_19[2] =
{
/*  0 */ { 7, s_19_0, -1, -1},
/*  1 */ { 6, s_19_1, -1, -1}
};


static const struct among a_20[32] =
{
/*  0 */ { 2, s_20_0, -1, -1},
/*  1 */ { 2, s_20_1, -1, -1},
/*  2 */ { 3, s_20_2, -1, -1},
/*  3 */ { 3, s_20_3, -1, -1},
/*  4 */ { 3, s_20_4, -1, -1},
/*  5 */ { 3, s_20_5, -1, -1},
/*  6 */ { 4, s_20_6, -1, -1},
/*  7 */ { 4, s_20_7, -1, -1},
/*  8 */ { 4, s_20_8, -1, -1},
/*  9 */ { 4, s_20_9, -1, -1},
/* 10 */ { 3, s_20_10, -1, -1},
/* 11 */ { 3, s_20_11, -1, -1},
/* 12 */ { 3, s_20_12, -1, -1},
/* 13 */ { 3, s_20_13, -1, -1},
/* 14 */ { 4, s_20_14, -1, -1},
/* 15 */ { 4, s_20_15, -1, -1},
/* 16 */ { 4, s_20_16, -1, -1},
/* 17 */ { 4, s_20_17, -1, -1},
/* 18 */ { 3, s_20_18, -1, -1},
/* 19 */ { 3, s_20_19, -1, -1},
/* 20 */ { 3, s_20_20, -1, -1},
/* 21 */ { 3, s_20_21, -1, -1},
/* 22 */ { 4, s_20_22, -1, -1},
/* 23 */ { 4, s_20_23, -1, -1},
/* 24 */ { 4, s_20_24, -1, -1},
/* 25 */ { 4, s_20_25, -1, -1},
/* 26 */ { 2, s_20_26, -1, -1},
/* 27 */ { 2, s_20_27, -1, -1},
/* 28 */ { 3, s_20_28, -1, -1},
/* 29 */ { 3, s_20_29, -1, -1},
/* 30 */ { 3, s_20_30, -1, -1},
/* 31 */ { 3, s_20_31, -1, -1}
};


static const struct among a_21[8] =
{
/*  0 */ { 2, s_21_0, -1, -1},
/*  1 */ { 2, s_21_1, -1, -1},
/*  2 */ { 3, s_21_2, -1, -1},
/*  3 */ { 3, s_21_3, -1, -1},
/*  4 */ { 3, s_21_4, -1, -1},
/*  5 */ { 3, s_21_5, -1, -1},
/*  6 */ { 3, s_21_6, -1, -1},
/*  7 */ { 3, s_21_7, -1, -1}
};


static const struct among a_22[4] =
{
/*  0 */ { 4, s_22_0, -1, -1},
/*  1 */ { 4, s_22_1, -1, -1},
/*  2 */ { 5, s_22_2, -1, -1},
/*  3 */ { 5, s_22_3, -1, -1}
};


static const struct among a_23[4] =
{
/*  0 */ { 1, s_23_0, -1, 1},
/*  1 */ { 1, s_23_1, -1, 2},
/*  2 */ { 1, s_23_2, -1, 3},
/*  3 */ { 2, s_23_3, -1, 4}
};

static const unsigned char g_vowel[] = { 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 8, 0, 0, 0, 0, 0, 0, 1 };

static const unsigned char g_U[] = { 1, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1 };

static const unsigned char g_vowel1[] = { 1, 64, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };

static const unsigned char g_vowel2[] = { 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 130 };

static const unsigned char g_vowel3[] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };

static const unsigned char g_vowel4[] = { 17 };

static const unsigned char g_vowel5[] = { 65 };

static const unsigned char g_vowel6[] = { 65 };

static const symbol s_0[] = { 0xC4, 0xB1 };
static const symbol s_1[] = { 0xC3, 0xB6 };
static const symbol s_2[] = { 0xC3, 0xBC };
static const symbol s_3[] = { 'k', 'i' };
static const symbol s_4[] = { 'k', 'e', 'n' };
static const symbol s_5[] = { 'p' };
static const symbol s_6[] = { 0xC3, 0xA7 };
static const symbol s_7[] = { 't' };
static const symbol s_8[] = { 'k' };
static const symbol s_9[] = { 0xC4, 0xB1 };
static const symbol s_10[] = { 0xC4, 0xB1 };
static const symbol s_11[] = { 'i' };
static const symbol s_12[] = { 'u' };
static const symbol s_13[] = { 0xC3, 0xB6 };
static const symbol s_14[] = { 0xC3, 0xBC };
static const symbol s_15[] = { 0xC3, 0xBC };
static const symbol s_16[] = { 'a', 'd' };
static const symbol s_17[] = { 's', 'o', 'y' };

int Xapian::InternalStemTurkish::r_check_vowel_harmony() {
    {   int m_test1 = l - c;
        if (out_grouping_b_U(g_vowel, 97, 305, 1) < 0) return 0;
        {   int m2 = l - c; (void)m2;
            if (c <= lb || p[c - 1] != 'a') goto lab1;
            c--;
            if (out_grouping_b_U(g_vowel1, 97, 305, 1) < 0) goto lab1;
            goto lab0;
        lab1:
            c = l - m2;
            if (c <= lb || p[c - 1] != 'e') goto lab2;
            c--;
            if (out_grouping_b_U(g_vowel2, 101, 252, 1) < 0) goto lab2;
            goto lab0;
        lab2:
            c = l - m2;
            if (!(eq_s_b(2, s_0))) goto lab3;
            if (out_grouping_b_U(g_vowel3, 97, 305, 1) < 0) goto lab3;
            goto lab0;
        lab3:
            c = l - m2;
            if (c <= lb || p[c - 1] != 'i') goto lab4;
            c--;
            if (out_grouping_b_U(g_vowel4, 101, 105, 1) < 0) goto lab4;
            goto lab0;
        lab4:
            c = l - m2;
            if (c <= lb || p[c - 1] != 'o') goto lab5;
            c--;
            if (out_grouping_b_U(g_vowel5, 111, 117, 1) < 0) goto lab5;
            goto lab0;
        lab5:
            c = l - m2;
            if (!(eq_s_b(2, s_1))) goto lab6;
            if (out_grouping_b_U(g_vowel6, 246, 252, 1) < 0) goto lab6;
            goto lab0;
        lab6:
            c = l - m2;
            if (c <= lb || p[c - 1] != 'u') goto lab7;
            c--;
            if (out_grouping_b_U(g_vowel5, 111, 117, 1) < 0) goto lab7;
            goto lab0;
        lab7:
            c = l - m2;
            if (!(eq_s_b(2, s_2))) return 0;
            if (out_grouping_b_U(g_vowel6, 246, 252, 1) < 0) return 0;
        }
    lab0:
        c = l - m_test1;
    }
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_suffix_with_optional_n_consonant() {
    {   int m1 = l - c; (void)m1;
        if (c <= lb || p[c - 1] != 'n') goto lab1;
        c--;
        {   int m_test2 = l - c;
            if (in_grouping_b_U(g_vowel, 97, 305, 0)) goto lab1;
            c = l - m_test2;
        }
        goto lab0;
    lab1:
        c = l - m1;
        {   int m3 = l - c; (void)m3;
            {   int m_test4 = l - c;
                if (c <= lb || p[c - 1] != 'n') goto lab2;
                c--;
                c = l - m_test4;
            }
            return 0;
        lab2:
            c = l - m3;
        }
        {   int m_test5 = l - c;
            {   int ret = skip_utf8(p, c, lb, 0, -1);
                if (ret < 0) return 0;
                c = ret;
            }
            if (in_grouping_b_U(g_vowel, 97, 305, 0)) return 0;
            c = l - m_test5;
        }
    }
lab0:
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_suffix_with_optional_s_consonant() {
    {   int m1 = l - c; (void)m1;
        if (c <= lb || p[c - 1] != 's') goto lab1;
        c--;
        {   int m_test2 = l - c;
            if (in_grouping_b_U(g_vowel, 97, 305, 0)) goto lab1;
            c = l - m_test2;
        }
        goto lab0;
    lab1:
        c = l - m1;
        {   int m3 = l - c; (void)m3;
            {   int m_test4 = l - c;
                if (c <= lb || p[c - 1] != 's') goto lab2;
                c--;
                c = l - m_test4;
            }
            return 0;
        lab2:
            c = l - m3;
        }
        {   int m_test5 = l - c;
            {   int ret = skip_utf8(p, c, lb, 0, -1);
                if (ret < 0) return 0;
                c = ret;
            }
            if (in_grouping_b_U(g_vowel, 97, 305, 0)) return 0;
            c = l - m_test5;
        }
    }
lab0:
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_suffix_with_optional_y_consonant() {
    {   int m1 = l - c; (void)m1;
        if (c <= lb || p[c - 1] != 'y') goto lab1;
        c--;
        {   int m_test2 = l - c;
            if (in_grouping_b_U(g_vowel, 97, 305, 0)) goto lab1;
            c = l - m_test2;
        }
        goto lab0;
    lab1:
        c = l - m1;
        {   int m3 = l - c; (void)m3;
            {   int m_test4 = l - c;
                if (c <= lb || p[c - 1] != 'y') goto lab2;
                c--;
                c = l - m_test4;
            }
            return 0;
        lab2:
            c = l - m3;
        }
        {   int m_test5 = l - c;
            {   int ret = skip_utf8(p, c, lb, 0, -1);
                if (ret < 0) return 0;
                c = ret;
            }
            if (in_grouping_b_U(g_vowel, 97, 305, 0)) return 0;
            c = l - m_test5;
        }
    }
lab0:
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_suffix_with_optional_U_vowel() {
    {   int m1 = l - c; (void)m1;
        if (in_grouping_b_U(g_U, 105, 305, 0)) goto lab1;
        {   int m_test2 = l - c;
            if (out_grouping_b_U(g_vowel, 97, 305, 0)) goto lab1;
            c = l - m_test2;
        }
        goto lab0;
    lab1:
        c = l - m1;
        {   int m3 = l - c; (void)m3;
            {   int m_test4 = l - c;
                if (in_grouping_b_U(g_U, 105, 305, 0)) goto lab2;
                c = l - m_test4;
            }
            return 0;
        lab2:
            c = l - m3;
        }
        {   int m_test5 = l - c;
            {   int ret = skip_utf8(p, c, lb, 0, -1);
                if (ret < 0) return 0;
                c = ret;
            }
            if (out_grouping_b_U(g_vowel, 97, 305, 0)) return 0;
            c = l - m_test5;
        }
    }
lab0:
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_possessives() {
    if (c <= lb || p[c - 1] >> 5 != 3 || !((67133440 >> (p[c - 1] & 0x1f)) & 1)) return 0;
    if (!(find_among_b(s_pool, a_0, 10, 0, 0))) return 0;
    {   int ret = r_mark_suffix_with_optional_U_vowel();
        if (ret <= 0) return ret;
    }
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_sU() {
    {   int ret = r_check_vowel_harmony();
        if (ret <= 0) return ret;
    }
    if (in_grouping_b_U(g_U, 105, 305, 0)) return 0;
    {   int ret = r_mark_suffix_with_optional_s_consonant();
        if (ret <= 0) return ret;
    }
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_lArI() {
    if (c - 3 <= lb || (p[c - 1] != 105 && p[c - 1] != 177)) return 0;
    if (!(find_among_b(s_pool, a_1, 2, 0, 0))) return 0;
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_yU() {
    {   int ret = r_check_vowel_harmony();
        if (ret <= 0) return ret;
    }
    if (in_grouping_b_U(g_U, 105, 305, 0)) return 0;
    {   int ret = r_mark_suffix_with_optional_y_consonant();
        if (ret <= 0) return ret;
    }
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_nU() {
    {   int ret = r_check_vowel_harmony();
        if (ret <= 0) return ret;
    }
    if (!(find_among_b(s_pool, a_2, 4, 0, 0))) return 0;
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_nUn() {
    {   int ret = r_check_vowel_harmony();
        if (ret <= 0) return ret;
    }
    if (c - 1 <= lb || p[c - 1] != 110) return 0;
    if (!(find_among_b(s_pool, a_3, 4, 0, 0))) return 0;
    {   int ret = r_mark_suffix_with_optional_n_consonant();
        if (ret <= 0) return ret;
    }
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_yA() {
    {   int ret = r_check_vowel_harmony();
        if (ret <= 0) return ret;
    }
    if (c <= lb || (p[c - 1] != 97 && p[c - 1] != 101)) return 0;
    if (!(find_among_b(s_pool, a_4, 2, 0, 0))) return 0;
    {   int ret = r_mark_suffix_with_optional_y_consonant();
        if (ret <= 0) return ret;
    }
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_nA() {
    {   int ret = r_check_vowel_harmony();
        if (ret <= 0) return ret;
    }
    if (c - 1 <= lb || (p[c - 1] != 97 && p[c - 1] != 101)) return 0;
    if (!(find_among_b(s_pool, a_5, 2, 0, 0))) return 0;
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_DA() {
    {   int ret = r_check_vowel_harmony();
        if (ret <= 0) return ret;
    }
    if (c - 1 <= lb || (p[c - 1] != 97 && p[c - 1] != 101)) return 0;
    if (!(find_among_b(s_pool, a_6, 4, 0, 0))) return 0;
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_ndA() {
    {   int ret = r_check_vowel_harmony();
        if (ret <= 0) return ret;
    }
    if (c - 2 <= lb || (p[c - 1] != 97 && p[c - 1] != 101)) return 0;
    if (!(find_among_b(s_pool, a_7, 2, 0, 0))) return 0;
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_DAn() {
    {   int ret = r_check_vowel_harmony();
        if (ret <= 0) return ret;
    }
    if (c - 2 <= lb || p[c - 1] != 110) return 0;
    if (!(find_among_b(s_pool, a_8, 4, 0, 0))) return 0;
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_ndAn() {
    {   int ret = r_check_vowel_harmony();
        if (ret <= 0) return ret;
    }
    if (c - 3 <= lb || p[c - 1] != 110) return 0;
    if (!(find_among_b(s_pool, a_9, 2, 0, 0))) return 0;
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_ylA() {
    {   int ret = r_check_vowel_harmony();
        if (ret <= 0) return ret;
    }
    if (c - 1 <= lb || (p[c - 1] != 97 && p[c - 1] != 101)) return 0;
    if (!(find_among_b(s_pool, a_10, 2, 0, 0))) return 0;
    {   int ret = r_mark_suffix_with_optional_y_consonant();
        if (ret <= 0) return ret;
    }
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_ki() {
    if (!(eq_s_b(2, s_3))) return 0;
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_ncA() {
    {   int ret = r_check_vowel_harmony();
        if (ret <= 0) return ret;
    }
    if (c - 1 <= lb || (p[c - 1] != 97 && p[c - 1] != 101)) return 0;
    if (!(find_among_b(s_pool, a_11, 2, 0, 0))) return 0;
    {   int ret = r_mark_suffix_with_optional_n_consonant();
        if (ret <= 0) return ret;
    }
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_yUm() {
    {   int ret = r_check_vowel_harmony();
        if (ret <= 0) return ret;
    }
    if (c - 1 <= lb || p[c - 1] != 109) return 0;
    if (!(find_among_b(s_pool, a_12, 4, 0, 0))) return 0;
    {   int ret = r_mark_suffix_with_optional_y_consonant();
        if (ret <= 0) return ret;
    }
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_sUn() {
    {   int ret = r_check_vowel_harmony();
        if (ret <= 0) return ret;
    }
    if (c - 2 <= lb || p[c - 1] != 110) return 0;
    if (!(find_among_b(s_pool, a_13, 4, 0, 0))) return 0;
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_yUz() {
    {   int ret = r_check_vowel_harmony();
        if (ret <= 0) return ret;
    }
    if (c - 1 <= lb || p[c - 1] != 122) return 0;
    if (!(find_among_b(s_pool, a_14, 4, 0, 0))) return 0;
    {   int ret = r_mark_suffix_with_optional_y_consonant();
        if (ret <= 0) return ret;
    }
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_sUnUz() {
    if (c - 4 <= lb || p[c - 1] != 122) return 0;
    if (!(find_among_b(s_pool, a_15, 4, 0, 0))) return 0;
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_lAr() {
    {   int ret = r_check_vowel_harmony();
        if (ret <= 0) return ret;
    }
    if (c - 2 <= lb || p[c - 1] != 114) return 0;
    if (!(find_among_b(s_pool, a_16, 2, 0, 0))) return 0;
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_nUz() {
    {   int ret = r_check_vowel_harmony();
        if (ret <= 0) return ret;
    }
    if (c - 2 <= lb || p[c - 1] != 122) return 0;
    if (!(find_among_b(s_pool, a_17, 4, 0, 0))) return 0;
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_DUr() {
    {   int ret = r_check_vowel_harmony();
        if (ret <= 0) return ret;
    }
    if (c - 2 <= lb || p[c - 1] != 114) return 0;
    if (!(find_among_b(s_pool, a_18, 8, 0, 0))) return 0;
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_cAsInA() {
    if (c - 5 <= lb || (p[c - 1] != 97 && p[c - 1] != 101)) return 0;
    if (!(find_among_b(s_pool, a_19, 2, 0, 0))) return 0;
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_yDU() {
    {   int ret = r_check_vowel_harmony();
        if (ret <= 0) return ret;
    }
    if (!(find_among_b(s_pool, a_20, 32, 0, 0))) return 0;
    {   int ret = r_mark_suffix_with_optional_y_consonant();
        if (ret <= 0) return ret;
    }
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_ysA() {
    if (c - 1 <= lb || p[c - 1] >> 5 != 3 || !((26658 >> (p[c - 1] & 0x1f)) & 1)) return 0;
    if (!(find_among_b(s_pool, a_21, 8, 0, 0))) return 0;
    {   int ret = r_mark_suffix_with_optional_y_consonant();
        if (ret <= 0) return ret;
    }
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_ymUs_() {
    {   int ret = r_check_vowel_harmony();
        if (ret <= 0) return ret;
    }
    if (c - 3 <= lb || p[c - 1] != 159) return 0;
    if (!(find_among_b(s_pool, a_22, 4, 0, 0))) return 0;
    {   int ret = r_mark_suffix_with_optional_y_consonant();
        if (ret <= 0) return ret;
    }
    return 1;
}

int Xapian::InternalStemTurkish::r_mark_yken() {
    if (!(eq_s_b(3, s_4))) return 0;
    {   int ret = r_mark_suffix_with_optional_y_consonant();
        if (ret <= 0) return ret;
    }
    return 1;
}

int Xapian::InternalStemTurkish::r_stem_nominal_verb_suffixes() {
    ket = c;
    I_continue_stemming_noun_suffixes = 1;
    {   int m1 = l - c; (void)m1;
        {   int m2 = l - c; (void)m2;
            {   int ret = r_mark_ymUs_();
                if (ret == 0) goto lab3;
                if (ret < 0) return ret;
            }
            goto lab2;
        lab3:
            c = l - m2;
            {   int ret = r_mark_yDU();
                if (ret == 0) goto lab4;
                if (ret < 0) return ret;
            }
            goto lab2;
        lab4:
            c = l - m2;
            {   int ret = r_mark_ysA();
                if (ret == 0) goto lab5;
                if (ret < 0) return ret;
            }
            goto lab2;
        lab5:
            c = l - m2;
            {   int ret = r_mark_yken();
                if (ret == 0) goto lab1;
                if (ret < 0) return ret;
            }
        }
    lab2:
        goto lab0;
    lab1:
        c = l - m1;
        {   int ret = r_mark_cAsInA();
            if (ret == 0) goto lab6;
            if (ret < 0) return ret;
        }
        {   int m3 = l - c; (void)m3;
            {   int ret = r_mark_sUnUz();
                if (ret == 0) goto lab8;
                if (ret < 0) return ret;
            }
            goto lab7;
        lab8:
            c = l - m3;
            {   int ret = r_mark_lAr();
                if (ret == 0) goto lab9;
                if (ret < 0) return ret;
            }
            goto lab7;
        lab9:
            c = l - m3;
            {   int ret = r_mark_yUm();
                if (ret == 0) goto lab10;
                if (ret < 0) return ret;
            }
            goto lab7;
        lab10:
            c = l - m3;
            {   int ret = r_mark_sUn();
                if (ret == 0) goto lab11;
                if (ret < 0) return ret;
            }
            goto lab7;
        lab11:
            c = l - m3;
            {   int ret = r_mark_yUz();
                if (ret == 0) goto lab12;
                if (ret < 0) return ret;
            }
            goto lab7;
        lab12:
            c = l - m3;
        }
    lab7:
        {   int ret = r_mark_ymUs_();
            if (ret == 0) goto lab6;
            if (ret < 0) return ret;
        }
        goto lab0;
    lab6:
        c = l - m1;
        {   int ret = r_mark_lAr();
            if (ret == 0) goto lab13;
            if (ret < 0) return ret;
        }
        bra = c;
        {   int ret = slice_del();
            if (ret < 0) return ret;
        }
        {   int m4 = l - c; (void)m4;
            ket = c;
            {   int m5 = l - c; (void)m5;
                {   int ret = r_mark_DUr();
                    if (ret == 0) goto lab16;
                    if (ret < 0) return ret;
                }
                goto lab15;
            lab16:
                c = l - m5;
                {   int ret = r_mark_yDU();
                    if (ret == 0) goto lab17;
                    if (ret < 0) return ret;
                }
                goto lab15;
            lab17:
                c = l - m5;
                {   int ret = r_mark_ysA();
                    if (ret == 0) goto lab18;
                    if (ret < 0) return ret;
                }
                goto lab15;
            lab18:
                c = l - m5;
                {   int ret = r_mark_ymUs_();
                    if (ret == 0) { c = l - m4; goto lab14; }
                    if (ret < 0) return ret;
                }
            }
        lab15:
        lab14:
            ;
        }
        I_continue_stemming_noun_suffixes = 0;
        goto lab0;
    lab13:
        c = l - m1;
        {   int ret = r_mark_nUz();
            if (ret == 0) goto lab19;
            if (ret < 0) return ret;
        }
        {   int m6 = l - c; (void)m6;
            {   int ret = r_mark_yDU();
                if (ret == 0) goto lab21;
                if (ret < 0) return ret;
            }
            goto lab20;
        lab21:
            c = l - m6;
            {   int ret = r_mark_ysA();
                if (ret == 0) goto lab19;
                if (ret < 0) return ret;
            }
        }
    lab20:
        goto lab0;
    lab19:
        c = l - m1;
        {   int m7 = l - c; (void)m7;
            {   int ret = r_mark_sUnUz();
                if (ret == 0) goto lab24;
                if (ret < 0) return ret;
            }
            goto lab23;
        lab24:
            c = l - m7;
            {   int ret = r_mark_yUz();
                if (ret == 0) goto lab25;
                if (ret < 0) return ret;
            }
            goto lab23;
        lab25:
            c = l - m7;
            {   int ret = r_mark_sUn();
                if (ret == 0) goto lab26;
                if (ret < 0) return ret;
            }
            goto lab23;
        lab26:
            c = l - m7;
            {   int ret = r_mark_yUm();
                if (ret == 0) goto lab22;
                if (ret < 0) return ret;
            }
        }
    lab23:
        bra = c;
        {   int ret = slice_del();
            if (ret < 0) return ret;
        }
        {   int m8 = l - c; (void)m8;
            ket = c;
            {   int ret = r_mark_ymUs_();
                if (ret == 0) { c = l - m8; goto lab27; }
                if (ret < 0) return ret;
            }
        lab27:
            ;
        }
        goto lab0;
    lab22:
        c = l - m1;
        {   int ret = r_mark_DUr();
            if (ret <= 0) return ret;
        }
        bra = c;
        {   int ret = slice_del();
            if (ret < 0) return ret;
        }
        {   int m9 = l - c; (void)m9;
            ket = c;
            {   int m10 = l - c; (void)m10;
                {   int ret = r_mark_sUnUz();
                    if (ret == 0) goto lab30;
                    if (ret < 0) return ret;
                }
                goto lab29;
            lab30:
                c = l - m10;
                {   int ret = r_mark_lAr();
                    if (ret == 0) goto lab31;
                    if (ret < 0) return ret;
                }
                goto lab29;
            lab31:
                c = l - m10;
                {   int ret = r_mark_yUm();
                    if (ret == 0) goto lab32;
                    if (ret < 0) return ret;
                }
                goto lab29;
            lab32:
                c = l - m10;
                {   int ret = r_mark_sUn();
                    if (ret == 0) goto lab33;
                    if (ret < 0) return ret;
                }
                goto lab29;
            lab33:
                c = l - m10;
                {   int ret = r_mark_yUz();
                    if (ret == 0) goto lab34;
                    if (ret < 0) return ret;
                }
                goto lab29;
            lab34:
                c = l - m10;
            }
        lab29:
            {   int ret = r_mark_ymUs_();
                if (ret == 0) { c = l - m9; goto lab28; }
                if (ret < 0) return ret;
            }
        lab28:
            ;
        }
    }
lab0:
    bra = c;
    {   int ret = slice_del();
        if (ret < 0) return ret;
    }
    return 1;
}

int Xapian::InternalStemTurkish::r_stem_suffix_chain_before_ki() {
    ket = c;
    {   int ret = r_mark_ki();
        if (ret <= 0) return ret;
    }
    {   int m1 = l - c; (void)m1;
        {   int ret = r_mark_DA();
            if (ret == 0) goto lab1;
            if (ret < 0) return ret;
        }
        bra = c;
        {   int ret = slice_del();
            if (ret < 0) return ret;
        }
        {   int m2 = l - c; (void)m2;
            ket = c;
            {   int m3 = l - c; (void)m3;
                {   int ret = r_mark_lAr();
                    if (ret == 0) goto lab4;
                    if (ret < 0) return ret;
                }
                bra = c;
                {   int ret = slice_del();
                    if (ret < 0) return ret;
                }
                {   int m4 = l - c; (void)m4;
                    {   int ret = r_stem_suffix_chain_before_ki();
                        if (ret == 0) { c = l - m4; goto lab5; }
                        if (ret < 0) return ret;
                    }
                lab5:
                    ;
                }
                goto lab3;
            lab4:
                c = l - m3;
                {   int ret = r_mark_possessives();
                    if (ret == 0) { c = l - m2; goto lab2; }
                    if (ret < 0) return ret;
                }
                bra = c;
                {   int ret = slice_del();
                    if (ret < 0) return ret;
                }
                {   int m5 = l - c; (void)m5;
                    ket = c;
                    {   int ret = r_mark_lAr();
                        if (ret == 0) { c = l - m5; goto lab6; }
                        if (ret < 0) return ret;
                    }
                    bra = c;
                    {   int ret = slice_del();
                        if (ret < 0) return ret;
                    }
                    {   int ret = r_stem_suffix_chain_before_ki();
                        if (ret == 0) { c = l - m5; goto lab6; }
                        if (ret < 0) return ret;
                    }
                lab6:
                    ;
                }
            }
        lab3:
        lab2:
            ;
        }
        goto lab0;
    lab1:
        c = l - m1;
        {   int ret = r_mark_nUn();
            if (ret == 0) goto lab7;
            if (ret < 0) return ret;
        }
        bra = c;
        {   int ret = slice_del();
            if (ret < 0) return ret;
        }
        {   int m6 = l - c; (void)m6;
            ket = c;
            {   int m7 = l - c; (void)m7;
                {   int ret = r_mark_lArI();
                    if (ret == 0) goto lab10;
                    if (ret < 0) return ret;
                }
                bra = c;
                {   int ret = slice_del();
                    if (ret < 0) return ret;
                }
                goto lab9;
            lab10:
                c = l - m7;
                ket = c;
                {   int m8 = l - c; (void)m8;
                    {   int ret = r_mark_possessives();
                        if (ret == 0) goto lab13;
                        if (ret < 0) return ret;
                    }
                    goto lab12;
                lab13:
                    c = l - m8;
                    {   int ret = r_mark_sU();
                        if (ret == 0) goto lab11;
                        if (ret < 0) return ret;
                    }
                }
            lab12:
                bra = c;
                {   int ret = slice_del();
                    if (ret < 0) return ret;
                }
                {   int m9 = l - c; (void)m9;
                    ket = c;
                    {   int ret = r_mark_lAr();
                        if (ret == 0) { c = l - m9; goto lab14; }
                        if (ret < 0) return ret;
                    }
                    bra = c;
                    {   int ret = slice_del();
                        if (ret < 0) return ret;
                    }
                    {   int ret = r_stem_suffix_chain_before_ki();
                        if (ret == 0) { c = l - m9; goto lab14; }
                        if (ret < 0) return ret;
                    }
                lab14:
                    ;
                }
                goto lab9;
            lab11:
                c = l - m7;
                {   int ret = r_stem_suffix_chain_before_ki();
                    if (ret == 0) { c = l - m6; goto lab8; }
                    if (ret < 0) return ret;
                }
            }
        lab9:
        lab8:
            ;
        }
        goto lab0;
    lab7:
        c = l - m1;
        {   int ret = r_mark_ndA();
            if (ret <= 0) return ret;
        }
        {   int m10 = l - c; (void)m10;
            {   int ret = r_mark_lArI();
                if (ret == 0) goto lab16;
                if (ret < 0) return ret;
            }
            bra = c;
            {   int ret = slice_del();
                if (ret < 0) return ret;
            }
            goto lab15;
        lab16:
            c = l - m10;
            {   int ret = r_mark_sU();
                if (ret == 0) goto lab17;
                if (ret < 0) return ret;
            }
            bra = c;
            {   int ret = slice_del();
                if (ret < 0) return ret;
            }
            {   int m11 = l - c; (void)m11;
                ket = c;
                {   int ret = r_mark_lAr();
                    if (ret == 0) { c = l - m11; goto lab18; }
                    if (ret < 0) return ret;
                }
                bra = c;
                {   int ret = slice_del();
                    if (ret < 0) return ret;
                }
                {   int ret = r_stem_suffix_chain_before_ki();
                    if (ret == 0) { c = l - m11; goto lab18; }
                    if (ret < 0) return ret;
                }
            lab18:
                ;
            }
            goto lab15;
        lab17:
            c = l - m10;
            {   int ret = r_stem_suffix_chain_before_ki();
                if (ret <= 0) return ret;
            }
        }
    lab15:
        ;
    }
lab0:
    return 1;
}

int Xapian::InternalStemTurkish::r_stem_noun_suffixes() {
    {   int m1 = l - c; (void)m1;
        ket = c;
        {   int ret = r_mark_lAr();
            if (ret == 0) goto lab1;
            if (ret < 0) return ret;
        }
        bra = c;
        {   int ret = slice_del();
            if (ret < 0) return ret;
        }
        {   int m2 = l - c; (void)m2;
            {   int ret = r_stem_suffix_chain_before_ki();
                if (ret == 0) { c = l - m2; goto lab2; }
                if (ret < 0) return ret;
            }
        lab2:
            ;
        }
        goto lab0;
    lab1:
        c = l - m1;
        ket = c;
        {   int ret = r_mark_ncA();
            if (ret == 0) goto lab3;
            if (ret < 0) return ret;
        }
        bra = c;
        {   int ret = slice_del();
            if (ret < 0) return ret;
        }
        {   int m3 = l - c; (void)m3;
            {   int m4 = l - c; (void)m4;
                ket = c;
                {   int ret = r_mark_lArI();
                    if (ret == 0) goto lab6;
                    if (ret < 0) return ret;
                }
                bra = c;
                {   int ret = slice_del();
                    if (ret < 0) return ret;
                }
                goto lab5;
            lab6:
                c = l - m4;
                ket = c;
                {   int m5 = l - c; (void)m5;
                    {   int ret = r_mark_possessives();
                        if (ret == 0) goto lab9;
                        if (ret < 0) return ret;
                    }
                    goto lab8;
                lab9:
                    c = l - m5;
                    {   int ret = r_mark_sU();
                        if (ret == 0) goto lab7;
                        if (ret < 0) return ret;
                    }
                }
            lab8:
                bra = c;
                {   int ret = slice_del();
                    if (ret < 0) return ret;
                }
                {   int m6 = l - c; (void)m6;
                    ket = c;
                    {   int ret = r_mark_lAr();
                        if (ret == 0) { c = l - m6; goto lab10; }
                        if (ret < 0) return ret;
                    }
                    bra = c;
                    {   int ret = slice_del();
                        if (ret < 0) return ret;
                    }
                    {   int ret = r_stem_suffix_chain_before_ki();
                        if (ret == 0) { c = l - m6; goto lab10; }
                        if (ret < 0) return ret;
                    }
                lab10:
                    ;
                }
                goto lab5;
            lab7:
                c = l - m4;
                ket = c;
                {   int ret = r_mark_lAr();
                    if (ret == 0) { c = l - m3; goto lab4; }
                    if (ret < 0) return ret;
                }
                bra = c;
                {   int ret = slice_del();
                    if (ret < 0) return ret;
                }
                {   int ret = r_stem_suffix_chain_before_ki();
                    if (ret == 0) { c = l - m3; goto lab4; }
                    if (ret < 0) return ret;
                }
            }
        lab5:
        lab4:
            ;
        }
        goto lab0;
    lab3:
        c = l - m1;
        ket = c;
        {   int m7 = l - c; (void)m7;
            {   int ret = r_mark_ndA();
                if (ret == 0) goto lab13;
                if (ret < 0) return ret;
            }
            goto lab12;
        lab13:
            c = l - m7;
            {   int ret = r_mark_nA();
                if (ret == 0) goto lab11;
                if (ret < 0) return ret;
            }
        }
    lab12:
        {   int m8 = l - c; (void)m8;
            {   int ret = r_mark_lArI();
                if (ret == 0) goto lab15;
                if (ret < 0) return ret;
            }
            bra = c;
            {   int ret = slice_del();
                if (ret < 0) return ret;
            }
            goto lab14;
        lab15:
            c = l - m8;
            {   int ret = r_mark_sU();
                if (ret == 0) goto lab16;
                if (ret < 0) return ret;
            }
            bra = c;
            {   int ret = slice_del();
                if (ret < 0) return ret;
            }
            {   int m9 = l - c; (void)m9;
                ket = c;
                {   int ret = r_mark_lAr();
                    if (ret == 0) { c = l - m9; goto lab17; }
                    if (ret < 0) return ret;
                }
                bra = c;
                {   int ret = slice_del();
                    if (ret < 0) return ret;
                }
                {   int ret = r_stem_suffix_chain_before_ki();
                    if (ret == 0) { c = l - m9; goto lab17; }
                    if (ret < 0) return ret;
                }
            lab17:
                ;
            }
            goto lab14;
        lab16:
            c = l - m8;
            {   int ret = r_stem_suffix_chain_before_ki();
                if (ret == 0) goto lab11;
                if (ret < 0) return ret;
            }
        }
    lab14:
        goto lab0;
    lab11:
        c = l - m1;
        ket = c;
        {   int m10 = l - c; (void)m10;
            {   int ret = r_mark_ndAn();
                if (ret == 0) goto lab20;
                if (ret < 0) return ret;
            }
            goto lab19;
        lab20:
            c = l - m10;
            {   int ret = r_mark_nU();
                if (ret == 0) goto lab18;
                if (ret < 0) return ret;
            }
        }
    lab19:
        {   int m11 = l - c; (void)m11;
            {   int ret = r_mark_sU();
                if (ret == 0) goto lab22;
                if (ret < 0) return ret;
            }
            bra = c;
            {   int ret = slice_del();
                if (ret < 0) return ret;
            }
            {   int m12 = l - c; (void)m12;
                ket = c;
                {   int ret = r_mark_lAr();
                    if (ret == 0) { c = l - m12; goto lab23; }
                    if (ret < 0) return ret;
                }
                bra = c;
                {   int ret = slice_del();
                    if (ret < 0) return ret;
                }
                {   int ret = r_stem_suffix_chain_before_ki();
                    if (ret == 0) { c = l - m12; goto lab23; }
                    if (ret < 0) return ret;
                }
            lab23:
                ;
            }
            goto lab21;
        lab22:
            c = l - m11;
            {   int ret = r_mark_lArI();
                if (ret == 0) goto lab18;
                if (ret < 0) return ret;
            }
        }
    lab21:
        goto lab0;
    lab18:
        c = l - m1;
        ket = c;
        {   int ret = r_mark_DAn();
            if (ret == 0) goto lab24;
            if (ret < 0) return ret;
        }
        bra = c;
        {   int ret = slice_del();
            if (ret < 0) return ret;
        }
        {   int m13 = l - c; (void)m13;
            ket = c;
            {   int m14 = l - c; (void)m14;
                {   int ret = r_mark_possessives();
                    if (ret == 0) goto lab27;
                    if (ret < 0) return ret;
                }
                bra = c;
                {   int ret = slice_del();
                    if (ret < 0) return ret;
                }
                {   int m15 = l - c; (void)m15;
                    ket = c;
                    {   int ret = r_mark_lAr();
                        if (ret == 0) { c = l - m15; goto lab28; }
                        if (ret < 0) return ret;
                    }
                    bra = c;
                    {   int ret = slice_del();
                        if (ret < 0) return ret;
                    }
                    {   int ret = r_stem_suffix_chain_before_ki();
                        if (ret == 0) { c = l - m15; goto lab28; }
                        if (ret < 0) return ret;
                    }
                lab28:
                    ;
                }
                goto lab26;
            lab27:
                c = l - m14;
                {   int ret = r_mark_lAr();
                    if (ret == 0) goto lab29;
                    if (ret < 0) return ret;
                }
                bra = c;
                {   int ret = slice_del();
                    if (ret < 0) return ret;
                }
                {   int m16 = l - c; (void)m16;
                    {   int ret = r_stem_suffix_chain_before_ki();
                        if (ret == 0) { c = l - m16; goto lab30; }
                        if (ret < 0) return ret;
                    }
                lab30:
                    ;
                }
                goto lab26;
            lab29:
                c = l - m14;
                {   int ret = r_stem_suffix_chain_before_ki();
                    if (ret == 0) { c = l - m13; goto lab25; }
                    if (ret < 0) return ret;
                }
            }
        lab26:
        lab25:
            ;
        }
        goto lab0;
    lab24:
        c = l - m1;
        ket = c;
        {   int m17 = l - c; (void)m17;
            {   int ret = r_mark_nUn();
                if (ret == 0) goto lab33;
                if (ret < 0) return ret;
            }
            goto lab32;
        lab33:
            c = l - m17;
            {   int ret = r_mark_ylA();
                if (ret == 0) goto lab31;
                if (ret < 0) return ret;
            }
        }
    lab32:
        bra = c;
        {   int ret = slice_del();
            if (ret < 0) return ret;
        }
        {   int m18 = l - c; (void)m18;
            {   int m19 = l - c; (void)m19;
                ket = c;
                {   int ret = r_mark_lAr();
                    if (ret == 0) goto lab36;
                    if (ret < 0) return ret;
                }
                bra = c;
                {   int ret = slice_del();
                    if (ret < 0) return ret;
                }
                {   int ret = r_stem_suffix_chain_before_ki();
                    if (ret == 0) goto lab36;
                    if (ret < 0) return ret;
                }
                goto lab35;
            lab36:
                c = l - m19;
                ket = c;
                {   int m20 = l - c; (void)m20;
                    {   int ret = r_mark_possessives();
                        if (ret == 0) goto lab39;
                        if (ret < 0) return ret;
                    }
                    goto lab38;
                lab39:
                    c = l - m20;
                    {   int ret = r_mark_sU();
                        if (ret == 0) goto lab37;
                        if (ret < 0) return ret;
                    }
                }
            lab38:
                bra = c;
                {   int ret = slice_del();
                    if (ret < 0) return ret;
                }
                {   int m21 = l - c; (void)m21;
                    ket = c;
                    {   int ret = r_mark_lAr();
                        if (ret == 0) { c = l - m21; goto lab40; }
                        if (ret < 0) return ret;
                    }
                    bra = c;
                    {   int ret = slice_del();
                        if (ret < 0) return ret;
                    }
                    {   int ret = r_stem_suffix_chain_before_ki();
                        if (ret == 0) { c = l - m21; goto lab40; }
                        if (ret < 0) return ret;
                    }
                lab40:
                    ;
                }
                goto lab35;
            lab37:
                c = l - m19;
                {   int ret = r_stem_suffix_chain_before_ki();
                    if (ret == 0) { c = l - m18; goto lab34; }
                    if (ret < 0) return ret;
                }
            }
        lab35:
        lab34:
            ;
        }
        goto lab0;
    lab31:
        c = l - m1;
        ket = c;
        {   int ret = r_mark_lArI();
            if (ret == 0) goto lab41;
            if (ret < 0) return ret;
        }
        bra = c;
        {   int ret = slice_del();
            if (ret < 0) return ret;
        }
        goto lab0;
    lab41:
        c = l - m1;
        {   int ret = r_stem_suffix_chain_before_ki();
            if (ret == 0) goto lab42;
            if (ret < 0) return ret;
        }
        goto lab0;
    lab42:
        c = l - m1;
        ket = c;
        {   int m22 = l - c; (void)m22;
            {   int ret = r_mark_DA();
                if (ret == 0) goto lab45;
                if (ret < 0) return ret;
            }
            goto lab44;
        lab45:
            c = l - m22;
            {   int ret = r_mark_yU();
                if (ret == 0) goto lab46;
                if (ret < 0) return ret;
            }
            goto lab44;
        lab46:
            c = l - m22;
            {   int ret = r_mark_yA();
                if (ret == 0) goto lab43;
                if (ret < 0) return ret;
            }
        }
    lab44:
        bra = c;
        {   int ret = slice_del();
            if (ret < 0) return ret;
        }
        {   int m23 = l - c; (void)m23;
            ket = c;
            {   int m24 = l - c; (void)m24;
                {   int ret = r_mark_possessives();
                    if (ret == 0) goto lab49;
                    if (ret < 0) return ret;
                }
                bra = c;
                {   int ret = slice_del();
                    if (ret < 0) return ret;
                }
                {   int m25 = l - c; (void)m25;
                    ket = c;
                    {   int ret = r_mark_lAr();
                        if (ret == 0) { c = l - m25; goto lab50; }
                        if (ret < 0) return ret;
                    }
                lab50:
                    ;
                }
                goto lab48;
            lab49:
                c = l - m24;
                {   int ret = r_mark_lAr();
                    if (ret == 0) { c = l - m23; goto lab47; }
                    if (ret < 0) return ret;
                }
            }
        lab48:
            bra = c;
            {   int ret = slice_del();
                if (ret < 0) return ret;
            }
            ket = c;
            {   int ret = r_stem_suffix_chain_before_ki();
                if (ret == 0) { c = l - m23; goto lab47; }
                if (ret < 0) return ret;
            }
        lab47:
            ;
        }
        goto lab0;
    lab43:
        c = l - m1;
        ket = c;
        {   int m26 = l - c; (void)m26;
            {   int ret = r_mark_possessives();
                if (ret == 0) goto lab52;
                if (ret < 0) return ret;
            }
            goto lab51;
        lab52:
            c = l - m26;
            {   int ret = r_mark_sU();
                if (ret <= 0) return ret;
            }
        }
    lab51:
        bra = c;
        {   int ret = slice_del();
            if (ret < 0) return ret;
        }
        {   int m27 = l - c; (void)m27;
            ket = c;
            {   int ret = r_mark_lAr();
                if (ret == 0) { c = l - m27; goto lab53; }
                if (ret < 0) return ret;
            }
            bra = c;
            {   int ret = slice_del();
                if (ret < 0) return ret;
            }
            {   int ret = r_stem_suffix_chain_before_ki();
                if (ret == 0) { c = l - m27; goto lab53; }
                if (ret < 0) return ret;
            }
        lab53:
            ;
        }
    }
lab0:
    return 1;
}

int Xapian::InternalStemTurkish::r_post_process_last_consonants() {
    int among_var;
    ket = c;
    among_var = find_among_b(s_pool, a_23, 4, 0, 0);
    if (!(among_var)) return 0;
    bra = c;
    switch (among_var) {
        case 1:
            {   int ret = slice_from_s(1, s_5);
                if (ret < 0) return ret;
            }
            break;
        case 2:
            {   int ret = slice_from_s(2, s_6);
                if (ret < 0) return ret;
            }
            break;
        case 3:
            {   int ret = slice_from_s(1, s_7);
                if (ret < 0) return ret;
            }
            break;
        case 4:
            {   int ret = slice_from_s(1, s_8);
                if (ret < 0) return ret;
            }
            break;
    }
    return 1;
}

int Xapian::InternalStemTurkish::r_append_U_to_stems_ending_with_d_or_g() {
    {   int m_test1 = l - c;
        {   int m2 = l - c; (void)m2;
            if (c <= lb || p[c - 1] != 'd') goto lab1;
            c--;
            goto lab0;
        lab1:
            c = l - m2;
            if (c <= lb || p[c - 1] != 'g') return 0;
            c--;
        }
    lab0:
        c = l - m_test1;
    }
    {   int m3 = l - c; (void)m3;
        {   int m_test4 = l - c;
            if (out_grouping_b_U(g_vowel, 97, 305, 1) < 0) goto lab3;
            {   int m5 = l - c; (void)m5;
                if (c <= lb || p[c - 1] != 'a') goto lab5;
                c--;
                goto lab4;
            lab5:
                c = l - m5;
                if (!(eq_s_b(2, s_9))) goto lab3;
            }
        lab4:
            c = l - m_test4;
        }
        {   int saved_c = c;
            insert_s(c, c, 2, s_10);
            c = saved_c;
        }
        goto lab2;
    lab3:
        c = l - m3;
        {   int m_test6 = l - c;
            if (out_grouping_b_U(g_vowel, 97, 305, 1) < 0) goto lab6;
            {   int m7 = l - c; (void)m7;
                if (c <= lb || p[c - 1] != 'e') goto lab8;
                c--;
                goto lab7;
            lab8:
                c = l - m7;
                if (c <= lb || p[c - 1] != 'i') goto lab6;
                c--;
            }
        lab7:
            c = l - m_test6;
        }
        {   int saved_c = c;
            insert_s(c, c, 1, s_11);
            c = saved_c;
        }
        goto lab2;
    lab6:
        c = l - m3;
        {   int m_test8 = l - c;
            if (out_grouping_b_U(g_vowel, 97, 305, 1) < 0) goto lab9;
            {   int m9 = l - c; (void)m9;
                if (c <= lb || p[c - 1] != 'o') goto lab11;
                c--;
                goto lab10;
            lab11:
                c = l - m9;
                if (c <= lb || p[c - 1] != 'u') goto lab9;
                c--;
            }
        lab10:
            c = l - m_test8;
        }
        {   int saved_c = c;
            insert_s(c, c, 1, s_12);
            c = saved_c;
        }
        goto lab2;
    lab9:
        c = l - m3;
        {   int m_test10 = l - c;
            if (out_grouping_b_U(g_vowel, 97, 305, 1) < 0) return 0;
            {   int m11 = l - c; (void)m11;
                if (!(eq_s_b(2, s_13))) goto lab13;
                goto lab12;
            lab13:
                c = l - m11;
                if (!(eq_s_b(2, s_14))) return 0;
            }
        lab12:
            c = l - m_test10;
        }
        {   int saved_c = c;
            insert_s(c, c, 2, s_15);
            c = saved_c;
        }
    }
lab2:
    return 1;
}

int Xapian::InternalStemTurkish::r_is_reserved_word() {
    if (!(eq_s_b(2, s_16))) return 0;
    {   int m1 = l - c; (void)m1;
        if (!(eq_s_b(3, s_17))) { c = l - m1; goto lab0; }
    lab0:
        ;
    }
    if (c > lb) return 0;
    return 1;
}

int Xapian::InternalStemTurkish::r_more_than_one_syllable_word() {
    {   int c_test1 = c;
        {   int i = 2;
            while(1) {
                int c2 = c;
                {   
                    int ret = out_grouping_U(g_vowel, 97, 305, 1);
                    if (ret < 0) goto lab0;
                    c += ret;
                }
                i--;
                continue;
            lab0:
                c = c2;
                break;
            }
            if (i > 0) return 0;
        }
        c = c_test1;
    }
    return 1;
}

int Xapian::InternalStemTurkish::r_postlude() {
    lb = c; c = l;

    {   int m1 = l - c; (void)m1;
        {   int ret = r_is_reserved_word();
            if (ret == 0) goto lab0;
            if (ret < 0) return ret;
        }
        return 0;
    lab0:
        c = l - m1;
    }
    {   int m2 = l - c; (void)m2;
        {   int ret = r_append_U_to_stems_ending_with_d_or_g();
            if (ret < 0) return ret;
        }
        c = l - m2;
    }
    {   int m3 = l - c; (void)m3;
        {   int ret = r_post_process_last_consonants();
            if (ret < 0) return ret;
        }
        c = l - m3;
    }
    c = lb;
    return 1;
}

int Xapian::InternalStemTurkish::stem() {
    {   int ret = r_more_than_one_syllable_word();
        if (ret <= 0) return ret;
    }
    lb = c; c = l;

    {   int m1 = l - c; (void)m1;
        {   int ret = r_stem_nominal_verb_suffixes();
            if (ret < 0) return ret;
        }
        c = l - m1;
    }
    if (!(I_continue_stemming_noun_suffixes)) return 0;
    {   int m2 = l - c; (void)m2;
        {   int ret = r_stem_noun_suffixes();
            if (ret < 0) return ret;
        }
        c = l - m2;
    }
    c = lb;
    {   int ret = r_postlude();
        if (ret <= 0) return ret;
    }
    return 1;
}

Xapian::InternalStemTurkish::InternalStemTurkish()
    : I_continue_stemming_noun_suffixes(0)
{
}

Xapian::InternalStemTurkish::~InternalStemTurkish()
{
}

std::string
Xapian::InternalStemTurkish::get_description() const
{
    return "turkish";
}
