{
  "ml": {
    "v": "4",
    "fs": [
      {
        "id": 0,
        "prob": 0.924839437007904,
        "class": 0
      }
    ],
    "prob": 0.92483944,
    "class": 0,
    "version": "v16.16",
    "thresholds": [
      0.9815004,
      0.99404883
    ],
    "analyzed_at": "2026-04-30T08:54:23Z"
  },
  "path": "sifive_spi.c",
  "raw": {
    "v": "4",
    "fs": [
      {
        "f": "O(Er₂)",
        "x": 1,
        "id": 0,
        "is": [
          "KASSERT",
          "SFSPI_READ",
          "SFSPI_WRITE",
          "KASSERT",
          "KASSERT",
          "SFSPI_READ",
          "KASSERT",
          "KASSERT",
          "KASSERT",
          "sfspi_tx",
          "sfspi_rx",
          "SFSPI_ASSERT_LOCKED",
          "howmany",
          "SFSPI_WRITE",
          "SFSPI_WRITE",
          "SFSPI_WRITE",
          "SFSPI_WRITE",
          "SFSPI_FMT_LEN",
          "SFSPI_WRITE",
          "KASSERT",
          "KASSERT",
          "device_get_softc",
          "spibus_get_cs",
          "spibus_get_clock",
          "spibus_get_mode",
          "device_printf",
          "SFSPI_LOCK",
          "device_busy",
          "sfspi_setup",
          "SFSPI_UNLOCK",
          "sfspi_xfer_buf",
          "sfspi_xfer_buf",
          "SFSPI_WRITE",
          "SFSPI_WRITE",
          "device_unbusy",
          "SFSPI_UNLOCK",
          "device_get_softc",
          "mtx_init",
          "device_get_nameunit",
          "bus_alloc_resources",
          "device_printf",
          "rman_get_bustag",
          "rman_get_bushandle",
          "clk_get_by_ofw_index",
          "device_printf",
          "clk_enable",
          "device_printf",
          "clk_get_freq",
          "device_printf",
          "SFSPI_READ",
          "SFSPI_WRITE",
          "device_add_child",
          "bus_delayed_attach_children",
          "bus_release_resources",
          "mtx_destroy",
          "ofw_bus_status_okay",
          "ofw_bus_is_compatible",
          "device_set_desc",
          "ofw_bus_get_node",
          "DEVMETHOD",
          "DEVMETHOD",
          "DEVMETHOD",
          "DEVMETHOD",
          "DRIVER_MODULE",
          "DRIVER_MODULE",
          "MODULE_DEPEND"
        ],
        "ms": {
          "text": {
            "tab_count": 349.0,
            "digit_ratio": 0.03,
            "space_count": 924.0,
            "total_lines": 400.0,
            "char_entropy": 5.63,
            "mixed_indent": true,
            "unique_chars": 91.0,
            "import_density": 16.5,
            "string_density": 0.13,
            "avg_line_length": 24.76,
            "max_line_length": 77.0,
            "empty_line_ratio": 0.19,
            "last_line_length": 47.0,
            "most_common_char": "e",
            "whitespace_ratio": 0.16,
            "most_common_ratio": 0.05,
            "identifier_density": 1.03,
            "line_length_stddev": 22.29,
            "normalized_import_count": 3.3,
            "normalized_string_count": 2.6,
            "suspicious_comment_ratio": 0.13,
            "max_inline_whitespace_run": 4.0,
            "normalized_function_count": 0.4,
            "imports_to_functions_ratio": 8.25,
            "strings_to_functions_ratio": 6.5,
            "suspicious_identifier_ratio": 0.01,
            "normalized_unique_identifiers": 15.5,
            "identifiers_to_functions_ratio": 16.75
          },
          "imports": {
            "total": 66.0,
            "unique_modules": 38.0,
            "third_party_count": 66.0,
            "third_party_ratio": 1.0
          },
          "strings": {
            "total": 52.0,
            "avg_length": 21.5,
            "max_length": 45.0,
            "avg_entropy": 3.58,
            "total_bytes": 1118.0,
            "entropy_stddev": 0.44
          },
          "comments": {
            "chars": 2253.0,
            "lines": 64.0,
            "total": 23.0,
            "to_code_ratio": 0.19,
            "high_entropy_comments": 3.0
          },
          "functions": {
            "total": 8.0,
            "length_stddev": 18.09,
            "avg_name_length": 59.5,
            "no_params_count": 8.0,
            "avg_length_lines": 28.75,
            "max_length_lines": 59.0,
            "min_length_lines": 6.0,
            "high_entropy_names": 8.0,
            "density_per_100_lines": 2.0,
            "code_in_functions_ratio": 0.57
          },
          "identifiers": {
            "total": 413.0,
            "avg_length": 12.08,
            "max_length": 27.0,
            "min_length": 1.0,
            "avg_entropy": 2.91,
            "reuse_ratio": 0.32,
            "unique_count": 134.0,
            "length_stddev": 5.73,
            "has_digit_ratio": 0.01,
            "sequential_names": 2.0,
            "single_char_count": 2.0,
            "single_char_ratio": 0.01,
            "high_entropy_count": 22.0,
            "high_entropy_ratio": 0.16,
            "all_lowercase_ratio": 0.54,
            "all_uppercase_ratio": 0.44,
            "numeric_suffix_count": 2.0,
            "underscore_prefix_count": 3.0
          }
        },
        "ss": [
          [
            1534,
            "\u003csys/param.h\u003e"
          ],
          [
            1557,
            "\u003csys/systm.h\u003e"
          ],
          [
            1580,
            "\u003csys/bus.h\u003e"
          ],
          [
            1601,
            "\u003csys/kernel.h\u003e"
          ],
          [
            1625,
            "\u003csys/lock.h\u003e"
          ],
          [
            1647,
            "\u003csys/module.h\u003e"
          ],
          [
            1671,
            "\u003csys/mutex.h\u003e"
          ],
          [
            1694,
            "\u003csys/rman.h\u003e"
          ],
          [
            1717,
            "\u003cmachine/bus.h\u003e"
          ],
          [
            1742,
            "\u003cmachine/cpu.h\u003e"
          ],
          [
            1768,
            "\u003cdev/clk/clk.h\u003e"
          ],
          [
            1794,
            "\u003cdev/ofw/ofw_bus.h\u003e"
          ],
          [
            1823,
            "\u003cdev/ofw/ofw_bus_subr.h\u003e"
          ],
          [
            1857,
            "\u003cdev/ofw/openfirm.h\u003e"
          ],
          [
            1888,
            "\u003cdev/spibus/spi.h\u003e"
          ],
          [
            1916,
            "\u003cdev/spibus/spibusvar.h\u003e"
          ],
          [
            1951,
            "spibus_if.h"
          ],
          [
            1952,
            "spibus_if.h"
          ],
          [
            4657,
            "TX buffer cannot be NULL"
          ],
          [
            4658,
            "TX buffer cannot be NULL"
          ],
          [
            5023,
            "RX buffer cannot be NULL"
          ],
          [
            5024,
            "RX buffer cannot be NULL"
          ],
          [
            5096,
            "Cannot receive more than %d bytes at a time\\n"
          ],
          [
            5097,
            "Cannot receive more than %d bytes at a time"
          ],
          [
            5519,
            "TX and RX lengths must be equal"
          ],
          [
            5520,
            "TX and RX lengths must be equal"
          ],
          [
            5581,
            "RX buffer cannot be NULL"
          ],
          [
            5582,
            "RX buffer cannot be NULL"
          ],
          [
            5636,
            "TX buffer cannot be NULL"
          ],
          [
            5637,
            "TX buffer cannot be NULL"
          ],
          [
            7087,
            "TX and RX command sizes must be equal"
          ],
          [
            7088,
            "TX and RX command sizes must be equal"
          ],
          [
            7181,
            "TX and RX data sizes must be equal"
          ],
          [
            7182,
            "TX and RX data sizes must be equal"
          ],
          [
            7395,
            "Invalid chip select %u\\n"
          ],
          [
            7396,
            "Invalid chip select %u"
          ],
          [
            8361,
            "Couldn't allocate resources\\n"
          ],
          [
            8362,
            "Couldn't allocate resources"
          ],
          [
            8576,
            "Couldn't allocate clock: %d\\n"
          ],
          [
            8577,
            "Couldn't allocate clock: %d"
          ],
          [
            8698,
            "Couldn't enable clock: %d\\n"
          ],
          [
            8699,
            "Couldn't enable clock: %d"
          ],
          [
            8836,
            "Couldn't get frequency: %d\\n"
          ],
          [
            8837,
            "Couldn't get frequency: %d"
          ],
          [
            9285,
            "spibus"
          ],
          [
            9286,
            "spibus"
          ],
          [
            9588,
            "sifive,spi0"
          ],
          [
            9589,
            "sifive,spi0"
          ],
          [
            9645,
            "SiFive SPI controller"
          ],
          [
            9646,
            "SiFive SPI controller"
          ],
          [
            10074,
            "sifive_spi"
          ],
          [
            10075,
            "sifive_spi"
          ]
        ],
        "sz": 10306,
        "ts": [
          {
            "c": 0.20000000298023224,
            "d": "command keyword",
            "e": [
              "command"
            ],
            "i": "micro-behaviors/data/text/keywords::command-dup",
            "l": 1
          },
          {
            "c": 0.699999988079071,
            "d": "Scanning for x86 REX prefix",
            "e": [
              "0x40"
            ],
            "i": "objectives/evasion/kernel-hide/hook::x86-opcode-prefix-rex",
            "l": 1
          },
          {
            "a": "T1014",
            "c": 0.949999988079071,
            "d": "FreeBSD kernel module header include",
            "e": [
              "sys/module.h"
            ],
            "i": "objectives/evasion/kernel-hide/lkm::sys-module-header",
            "l": 3
          }
        ],
        "sha": "4dde4378301b099fd2db8b806eb8fd7cf24f1f7fbea46fe77417ce47584a1592",
        "path": "sifive_spi.c",
        "type": "c"
      }
    ],
    "tv": "f6eaa"
  }
}