Semi-infinite flags. II: Local and global intersection cohomology of quasimaps spaces Greatest common divisors of \(u-1, v-1\) in positive characteristic and rational points on curves over finite fields 