;; GCHANGE
;; removes %b when returning base types (i.e. !head%b returns !head)
(define impc:ir:get-base-type-g
(lambda (str)
(let* ((r1 (car (regex:split str "##")))
(r2 (impc:ir:get-ptr-depth r1))
(r3 (string-append "^([^%]*)%*[a-z]*" (apply string-append (make-list r2 "\\*")) "$")))
;; (println str r2 "$1")
(regex:replace r1 r3 "$1"))))