the code tells you nothing about how casualties are determined. that is server side. unless you know an engineer who works at gree then you have no idea how they work besides what you see in the game.
code readers aren't hackers. anyone can do it.
don't need a couple thousand data points. do 5 attacks on someone with low stats and get zero casualties. 5 attacks on someone with high stats and 20 units die. if you don't see the correlation then you are blind.
casualties aren't just some simple equation you can plug consumption rates into. the way mark described it (and the only real info we have) is that each unit rolls a dice to see if it will live or die. if the first unit dies then the next unit rolling the dice has a lower chance of dying. if two units die then there is a lesser chance of the 3rd unit dying.
this is why consumption rates don't matter for overall casualty. attacking a strong player, you are always going to lose that first unit. even if all the units you have are extremely low casualty, the odds of the first one dying are still so great.