Develop an OCaml function named "cartesian_product" that takes two lists of integers as arguments and returns the Cartesian product of the two lists as a list of pairs. Each pair should contain a single element from each of the two input lists. Your implementation should use nested loops to generate each pair in the Cartesian product. Your function should handle the case where one or both of the input lists are empty, returning an empty list.
This prompt doesn't seem malicious.