+maybeAsmTemp :: CLabel -> Maybe Unique
+maybeAsmTemp (AsmTempLabel uq) = Just uq
+maybeAsmTemp _ = Nothing
+
+-- some labels have C prototypes in scope when compiling via C, because
+-- they are builtin to the C compiler. For these labels we avoid
+-- generating our own C prototypes.
+isMathFun :: CLabel -> Bool
+isMathFun (ForeignLabel fs _ _) = fs `elem` math_funs
+ where
+ math_funs = [
+ (fsLit "pow"), (fsLit "sin"), (fsLit "cos"),
+ (fsLit "tan"), (fsLit "sinh"), (fsLit "cosh"),
+ (fsLit "tanh"), (fsLit "asin"), (fsLit "acos"),
+ (fsLit "atan"), (fsLit "log"), (fsLit "exp"),
+ (fsLit "sqrt"), (fsLit "powf"), (fsLit "sinf"),
+ (fsLit "cosf"), (fsLit "tanf"), (fsLit "sinhf"),
+ (fsLit "coshf"), (fsLit "tanhf"), (fsLit "asinf"),
+ (fsLit "acosf"), (fsLit "atanf"), (fsLit "logf"),
+ (fsLit "expf"), (fsLit "sqrtf")
+ ]
+isMathFun _ = False
+