static inline struct rgbvec interp_trilinear(const LUT3DContext *lut3d,

                                             const struct rgbvec *s)

{

    const struct rgbvec d = {s->r - PREV(s->r), s->g - PREV(s->g), s->b - PREV(s->b)};

    const struct rgbvec c000 = lut3d->lut[PREV(s->r)][PREV(s->g)][PREV(s->b)];

    const struct rgbvec c001 = lut3d->lut[PREV(s->r)][PREV(s->g)][NEXT(s->b)];

    const struct rgbvec c010 = lut3d->lut[PREV(s->r)][NEXT(s->g)][PREV(s->b)];

    const struct rgbvec c011 = lut3d->lut[PREV(s->r)][NEXT(s->g)][NEXT(s->b)];

    const struct rgbvec c100 = lut3d->lut[NEXT(s->r)][PREV(s->g)][PREV(s->b)];

    const struct rgbvec c101 = lut3d->lut[NEXT(s->r)][PREV(s->g)][NEXT(s->b)];

    const struct rgbvec c110 = lut3d->lut[NEXT(s->r)][NEXT(s->g)][PREV(s->b)];

    const struct rgbvec c111 = lut3d->lut[NEXT(s->r)][NEXT(s->g)][NEXT(s->b)];

    const struct rgbvec c00  = lerp(&c000, &c100, d.r);

    const struct rgbvec c10  = lerp(&c010, &c110, d.r);

    const struct rgbvec c01  = lerp(&c001, &c101, d.r);

    const struct rgbvec c11  = lerp(&c011, &c111, d.r);

    const struct rgbvec c0   = lerp(&c00,  &c10,  d.g);

    const struct rgbvec c1   = lerp(&c01,  &c11,  d.g);

    const struct rgbvec c    = lerp(&c0,   &c1,   d.b);

    return c;

}

static inline struct rgbvec interp_trilinear(const LUT3DContext *lut3d,

                                             const struct rgbvec *s)

{

    const struct rgbvec d = {s->r - PREV(s->r), s->g - PREV(s->g), s->b - PREV(s->b)};

    const struct rgbvec c000 = lut3d->lut[PREV(s->r)][PREV(s->g)][PREV(s->b)];

    const struct rgbvec c001 = lut3d->lut[PREV(s->r)][PREV(s->g)][NEXT(s->b)];

    const struct rgbvec c010 = lut3d->lut[PREV(s->r)][NEXT(s->g)][PREV(s->b)];

    const struct rgbvec c011 = lut3d->lut[PREV(s->r)][NEXT(s->g)][NEXT(s->b)];

    const struct rgbvec c100 = lut3d->lut[NEXT(s->r)][PREV(s->g)][PREV(s->b)];

    const struct rgbvec c101 = lut3d->lut[NEXT(s->r)][PREV(s->g)][NEXT(s->b)];

    const struct rgbvec c110 = lut3d->lut[NEXT(s->r)][NEXT(s->g)][PREV(s->b)];

    const struct rgbvec c111 = lut3d->lut[NEXT(s->r)][NEXT(s->g)][NEXT(s->b)];

    const struct rgbvec c00  = lerp(&c000, &c100, d.r);

    const struct rgbvec c10  = lerp(&c010, &c110, d.r);

    const struct rgbvec c01  = lerp(&c001, &c101, d.r);

    const struct rgbvec c11  = lerp(&c011, &c111, d.r);

    const struct rgbvec c0   = lerp(&c00,  &c10,  d.g);

    const struct rgbvec c1   = lerp(&c01,  &c11,  d.g);

    const struct rgbvec c    = lerp(&c0,   &c1,   d.b);

    return c;

}

    const struct rgbvec d = {s->r - PREV(s->r), s->g - PREV(s->g), s->b - PREV(s->b)};     const struct rgbvec c000 = lut3d->lut[PREV(s->r)][PREV(s->g)][PREV(s->b)];     const struct rgbvec c001 = lut3d->lut[PREV(s->r)][PREV(s->g)][NEXT(s->b)];     const struct rgbvec c010 = lut3d->lut[PREV(s->r)][NEXT(s->g)][PREV(s->b)];     const struct rgbvec c011 = lut3d->lut[PREV(s->r)][NEXT(s->g)][NEXT(s->b)];     const struct rgbvec c100 = lut3d->lut[NEXT(s->r)][PREV(s->g)][PREV(s->b)];     const struct rgbvec c101 = lut3d->lut[NEXT(s->r)][PREV(s->g)][NEXT(s->b)];     const struct rgbvec c110 = lut3d->lut[NEXT(s->r)][NEXT(s->g)][PREV(s->b)];     const struct rgbvec c111 = lut3d->lut[NEXT(s->r)][NEXT(s->g)][NEXT(s->b)];     const struct rgbvec d = {s->r - PREV(s->r), s->g - PREV(s->g), s->b - PREV(s->b)};     const struct rgbvec c000 = lut3d->lut[PREV(s->r)][PREV(s->g)][PREV(s->b)];     const struct rgbvec c001 = lut3d->lut[PREV(s->r)][PREV(s->g)][NEXT(s->b)];     const struct rgbvec c010 = lut3d->lut[PREV(s->r)][NEXT(s->g)][PREV(s->b)];     const struct rgbvec c011 = lut3d->lut[PREV(s->r)][NEXT(s->g)][NEXT(s->b)];     const struct rgbvec c100 = lut3d->lut[NEXT(s->r)][PREV(s->g)][PREV(s->b)];     const struct rgbvec c101 = lut3d->lut[NEXT(s->r)][PREV(s->g)][NEXT(s->b)];     const struct rgbvec c110 = lut3d->lut[NEXT(s->r)][NEXT(s->g)][PREV(s->b)];     const struct rgbvec c111 = lut3d->lut[NEXT(s->r)][NEXT(s->g)][NEXT(s->b)];
static inline struct rgbvec FUNC_0(const LUT3DContext *VAR_0,

                                             const struct rgbvec *VAR_1)

{

    const struct rgbvec VAR_2 = {VAR_1->r - PREV(VAR_1->r), VAR_1->g - PREV(VAR_1->g), VAR_1->b - PREV(VAR_1->b)};

    const struct rgbvec VAR_3 = VAR_0->lut[PREV(VAR_1->r)][PREV(VAR_1->g)][PREV(VAR_1->b)];

    const struct rgbvec VAR_4 = VAR_0->lut[PREV(VAR_1->r)][PREV(VAR_1->g)][NEXT(VAR_1->b)];

    const struct rgbvec VAR_5 = VAR_0->lut[PREV(VAR_1->r)][NEXT(VAR_1->g)][PREV(VAR_1->b)];

    const struct rgbvec VAR_6 = VAR_0->lut[PREV(VAR_1->r)][NEXT(VAR_1->g)][NEXT(VAR_1->b)];

    const struct rgbvec VAR_7 = VAR_0->lut[NEXT(VAR_1->r)][PREV(VAR_1->g)][PREV(VAR_1->b)];

    const struct rgbvec VAR_8 = VAR_0->lut[NEXT(VAR_1->r)][PREV(VAR_1->g)][NEXT(VAR_1->b)];

    const struct rgbvec VAR_9 = VAR_0->lut[NEXT(VAR_1->r)][NEXT(VAR_1->g)][PREV(VAR_1->b)];

    const struct rgbvec VAR_10 = VAR_0->lut[NEXT(VAR_1->r)][NEXT(VAR_1->g)][NEXT(VAR_1->b)];

    const struct rgbvec VAR_11  = lerp(&VAR_3, &VAR_7, VAR_2.r);

    const struct rgbvec VAR_12  = lerp(&VAR_5, &VAR_9, VAR_2.r);

    const struct rgbvec VAR_13  = lerp(&VAR_4, &VAR_8, VAR_2.r);

    const struct rgbvec VAR_14  = lerp(&VAR_6, &VAR_10, VAR_2.r);

    const struct rgbvec VAR_15   = lerp(&VAR_11,  &VAR_12,  VAR_2.g);

    const struct rgbvec VAR_16   = lerp(&VAR_13,  &VAR_14,  VAR_2.g);

    const struct rgbvec VAR_17    = lerp(&VAR_15,   &VAR_16,   VAR_2.b);

    return VAR_17;

}

static inline struct rgbvec FUNC_0(const LUT3DContext *VAR_0,
const struct rgbvec *VAR_1)
{ const struct rgbvec VAR_2 = {VAR_1->r - PREV(VAR_1->r), VAR_1->g - PREV(VAR_1->g), VAR_1->b - PREV(VAR_1->b)}; const struct rgbvec VAR_3 = VAR_0->lut[PREV(VAR_1->r)][PREV(VAR_1->g)][PREV(VAR_1->b)]; const struct rgbvec VAR_4 = VAR_0->lut[PREV(VAR_1->r)][PREV(VAR_1->g)][NEXT(VAR_1->b)]; const struct rgbvec VAR_5 = VAR_0->lut[PREV(VAR_1->r)][NEXT(VAR_1->g)][PREV(VAR_1->b)]; const struct rgbvec VAR_6 = VAR_0->lut[PREV(VAR_1->r)][NEXT(VAR_1->g)][NEXT(VAR_1->b)]; const struct rgbvec VAR_7 = VAR_0->lut[NEXT(VAR_1->r)][PREV(VAR_1->g)][PREV(VAR_1->b)]; const struct rgbvec VAR_8 = VAR_0->lut[NEXT(VAR_1->r)][PREV(VAR_1->g)][NEXT(VAR_1->b)]; const struct rgbvec VAR_9 = VAR_0->lut[NEXT(VAR_1->r)][NEXT(VAR_1->g)][PREV(VAR_1->b)]; const struct rgbvec VAR_10 = VAR_0->lut[NEXT(VAR_1->r)][NEXT(VAR_1->g)][NEXT(VAR_1->b)]; const struct rgbvec VAR_11  = lerp(&VAR_3, &VAR_7, VAR_2.r); const struct rgbvec VAR_12  = lerp(&VAR_5, &VAR_9, VAR_2.r); const struct rgbvec VAR_13  = lerp(&VAR_4, &VAR_8, VAR_2.r); const struct rgbvec VAR_14  = lerp(&VAR_6, &VAR_10, VAR_2.r); const struct rgbvec VAR_15   = lerp(&VAR_11,  &VAR_12,  VAR_2.g); const struct rgbvec VAR_16   = lerp(&VAR_13,  &VAR_14,  VAR_2.g); const struct rgbvec VAR_17    = lerp(&VAR_15,   &VAR_16,   VAR_2.b); return VAR_17; }