```
int32 find_result(int64 sec)
{
if(config == defualt_base)
{
uint32 H = j * k + 1; /*(here j and k global)*/
if((((uint32)(sec - CS - RS)) % (H * N_p * M_r))== 0)
{
result = 0;
}
}
else
{
if((((uint32)(sec - CS - RS)) % (N_p * M_r))== 0) /*(N_p and M_r global)*/
{
result = 0;
}
}
}
```

This function have to be execute several times in a second, How can optimize it ? Please help me to avoid mathematical operations applying on this function?