Create a Common Lisp macro for the following transformation. Before code:
(define-case-aware-find-symbol find-preprocessor-directive #:with-c-syntax.preprocessor-directive)

What needs to change: Macro call that should be transformed by define-case-aware-find-symbol

Macro definition:
(defmacro define-case-aware-find-symbol
    (finder-function-name package-name
     &key (upcased-package-name (format nil "~A.~A" (string package-name) '#:UPCASED))
       (docstring
        (format nil "Find a symbol in `~A' package having a same NAME. If not found, returns `nil'."
                package-name)))
  `(eval-when (:compile-toplevel :load-toplevel :execute)
     (defpackage ,upcased-package-name
       (:use)
       (:intern
        ,@(loop for sym being the external-symbol of package-name
                collect (string-upcase (symbol-name sym)))))
     ,@(loop for sym being the external-symbol of package-name
             for upcased = (string-upcase (symbol-name sym))
             collect `(setf (symbol-value (find-symbol ,upcased ',upcased-package-name))
                            ',sym))
     (defun ,finder-function-name (string &optional (readtable-case (readtable-case *readtable*)))
       ,@(if docstring `(,docstring))
       (ecase readtable-case
         ((:upcase :invert)
          (if-let ((up-sym (find-symbol string ',upcased-package-name)))
            (symbol-value up-sym)))
         ((:downcase :preserve)
          (find-symbol string ',package-name))))))

Macroexpansion:
(eval-when (:compile-toplevel :load-toplevel :execute) (defpackage #A((44) base-char . "WITH-C-SYNTAX.PREPROCESSOR-DIRECTIVE.UPCASED") (:use) (:intern #A((4) base-char . "ELIF") #A((6) base-char . "IFNDEF") #A((5) base-char . "UNDEF") #A((5) base-char . "ERROR") #A((5) base-char . "ENDIF") #A((6) base-char . "PRAGMA") #A((6) base-char . "DEFINE") #A((4) base-char . "ELSE") #A((2) base-char . "IF") #A((7) base-char . "INCLUDE") #A((5) base-char . "IFDEF") #A((4) base-char . "LINE"))) (setf (symbol-value (find-symbol #A((4) base-char . "ELIF") (quote #A((44) base-char . "WITH-C-SYNTAX.PREPROCESSOR-DIRECTIVE.UPCASED")))) (quote with-c-syntax.preprocessor-directive:|elif|)) (setf (symbol-value (find-symbol #A((6) base-char . "IFNDEF") (quote #A((44) base-char . "WITH-C-SYNTAX.PREPROCESSOR-DIRECTIVE.UPCASED")))) (quote with-c-syntax.preprocessor-directive:|ifndef|)) (setf (symbol-value (find-symbol #A((5) base-char . "UNDEF") (quote #A((44) base-char . "WITH-C-SYNTAX.PREPROCESSOR-DIRECTIVE.UPCASED")))) (quote with-c-syntax.preprocessor-directive:|undef|)) (setf (symbol-value (find-symbol #A((5) base-char . "ERROR") (quote #A((44) base-char . "WITH-C-SYNTAX.PREPROCESSOR-DIRECTIVE.UPCASED")))) (quote with-c-syntax.preprocessor-directive:|error|)) (setf (symbol-value (find-symbol #A((5) base-char . "ENDIF") (quote #A((44) base-char . "WITH-C-SYNTAX.PREPROCESSOR-DIRECTIVE.UPCASED")))) (quote with-c-syntax.preprocessor-directive:|endif|)) (setf (symbol-value (find-symbol #A((6) base-char . "PRAGMA") (quote #A((44) base-char . "WITH-C-SYNTAX.PREPROCESSOR-DIRECTIVE.UPCASED")))) (quote with-c-syntax.preprocessor-directive:|pragma|)) (setf (symbol-value (find-symbol #A((6) base-char . "DEFINE") (quote #A((44) base-char . "WITH-C-SYNTAX.PREPROCESSOR-DIRECTIVE.UPCASED")))) (quote with-c-syntax.preprocessor-directive:|define|)) (setf (symbol-value (find-symbol #A((4) base-char . "ELSE") (quote #A((44) base-char . "WITH-C-SYNTAX.PREPROCESSOR-DIRECTIVE.UPCASED")))) (quote with-c-syntax.preprocessor-directive:|else|)) (setf (symbol-value (find-symbol #A((2) base-char . "IF") (quote #A((44) base-char . "WITH-C-SYNTAX.PREPROCESSOR-DIRECTIVE.UPCASED")))) (quote with-c-syntax.preprocessor-directive:|if|)) (setf (symbol-value (find-symbol #A((7) base-char . "INCLUDE") (quote #A((44) base-char . "WITH-C-SYNTAX.PREPROCESSOR-DIRECTIVE.UPCASED")))) (quote with-c-syntax.preprocessor-directive:|include|)) (setf (symbol-value (find-symbol #A((5) base-char . "IFDEF") (quote #A((44) base-char . "WITH-C-SYNTAX.PREPROCESSOR-DIRECTIVE.UPCASED")))) (quote with-c-syntax.preprocessor-directive:|ifdef|)) (setf (symbol-value (find-symbol #A((4) base-char . "LINE") (quote #A((44) base-char . "WITH-C-SYNTAX.PREPROCESSOR-DIRECTIVE.UPCASED")))) (quote with-c-syntax.preprocessor-directive:|line|)) (defun find-preprocessor-directive (string &optional (readtable-case (readtable-case *readtable*))) #A((112) base-char . "Find a symbol in `WITH-C-SYNTAX.PREPROCESSOR-DIRECTIVE' package having a same NAME. If not found, returns `nil'.") (ecase readtable-case ((:upcase :invert) (if-let ((up-sym (find-symbol string (quote #A((44) base-char . "WITH-C-SYNTAX.PREPROCESSOR-DIRECTIVE.UPCASED"))))) (symbol-value up-sym))) ((:downcase :preserve) (find-symbol string (quote #:with-c-syntax.preprocessor-directive))))))