static __inline__ __attribute((always_inline,unused))
uint32_t word_is_zero(uint32_t a) {
    return (((uint64_t)a)-1)>>32;
}
['static __inline__ void\n__attribute__((unused,always_inline))\nconstant_time_lookup (\n    void *__restrict__ out_,\n    const void *table_,\n    word_t elem_bytes,\n    word_t n_table,\n    word_t idx\n) {\n    big_register_t big_one = br_set_to_mask(1), big_i = br_set_to_mask(idx);\n    unsigned char *out = (unsigned char *)out_;\n    const unsigned char *table = (const unsigned char *)table_;\n    word_t j,k;\n    memset(out, 0, elem_bytes);\n    for (j=0; j<n_table; j++, big_i-=big_one) {\n        big_register_t br_mask = br_is_zero(big_i);\n        word_t mask;\n        for (k=0; k<=elem_bytes-sizeof(big_register_t); k+=sizeof(big_register_t)) {\n            if (elem_bytes % sizeof(big_register_t)) {\n                ((unaligned_br_t *)(out+k))->unaligned\n\t\t\t|= br_mask & ((const unaligned_br_t*)(&table[k+j*elem_bytes]))->unaligned;\n            } else {\n                *(big_register_t *)(out+k) |= br_mask & *(const big_register_t*)(&table[k+j*elem_bytes]);\n            }\n        }\n        mask = word_is_zero(idx^j);\n        if (elem_bytes % sizeof(big_register_t) >= sizeof(word_t)) {\n            for (; k<=elem_bytes-sizeof(word_t); k+=sizeof(word_t)) {\n                if (elem_bytes % sizeof(word_t)) {\n                    *(word_t *)(out+k) |= mask & ((const unaligned_word_t*)(&table[k+j*elem_bytes]))->unaligned;\n                } else {\n                    *(word_t *)(out+k) |= mask & *(const word_t*)(&table[k+j*elem_bytes]);\n                }\n            }\n        }\n        if (elem_bytes % sizeof(word_t)) {\n            for (; k<elem_bytes; k+=1) {\n                out[k] |= mask & table[k+j*elem_bytes];\n            }\n        }\n    }\n}', 'static ossl_inline big_register_t\n    br_set_to_mask(mask_t x) {\n        return (big_register_t)x;\n    }', 'static __inline__ __attribute((always_inline,unused))\nuint32_t word_is_zero(uint32_t a) {\n    return (((uint64_t)a)-1)>>32;\n}']