Project idea: llvm-extract for C code

I love llvm-extract, specifically how it can recursively pull out function definitions, globals, and types given a root function. I wish I had something like that for C code in addition to llvm-extract which only works on IR.