After validating no further args are given lsmod parses each line of /proc/modules (via LibKMod) & iterates over the linkedlist to serialize textual output. Any benefit here beyond cat /proc/modules?
After parsing commandline flags (filling in missing args with uname) depmod constructs some directory paths to consult, validates a dependency files/directory, initializes various objects, iterates over a given file (one format or another) gathering symbols to link into a hashmap, ...
2/4