trimSmd codebase