static void block_permute(int16_t *block, uint8_t *permutation,
                          const uint8_t *scantable, int last)
{
    int i;
    int16_t temp[64];
    if (last <= 0)
        return;
    for (i = 0; i <= last; i++) {
        const int j = scantable[i];
        temp[j] = block[j];
        block[j] = 0;
    }
    for (i = 0; i <= last; i++) {
        const int j = scantable[i];
        const int perm_j = permutation[j];
        block[perm_j] = temp[j];
    }
}
['static void block_permute(int16_t *block, uint8_t *permutation,\n                          const uint8_t *scantable, int last)\n{\n    int i;\n    int16_t temp[64];\n    if (last <= 0)\n        return;\n    for (i = 0; i <= last; i++) {\n        const int j = scantable[i];\n        temp[j] = block[j];\n        block[j] = 0;\n    }\n    for (i = 0; i <= last; i++) {\n        const int j = scantable[i];\n        const int perm_j = permutation[j];\n        block[perm_j] = temp[j];\n    }\n}']