I will share my inventory too.
constexpr uint64_t INGREDIENTS_CLEAR = 0xFF00FF00FF00FFUL;
constexpr uint64_t INGREDIENTS_ONE_NEGATIVE = 0x80008000800080UL;
union Ingredients {
uint64_t value;
char values[8];
// use 0 2 4 6
};
so to add to invetories I can to this
Ingredients a, b;
a.value = (a.value + b.value) & INGREDIENTS_CLEAR;
to check if there is any negative i do:
(value & INGREDIENTS_ONE_NEGATIVE) > 0
what about repetable spells?
multiplying work’s too 
(value + ((spell.value * repeats) & INGREDIENTS_CLEAR)) & INGREDIENTS_CLEAR;
Simply and fast!