LLVMFuzzerTestOneInput:
   35|     74|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   36|     74|    if (size < 2) return 0;
  ------------------
  |  Branch (36:9): [True: 1, False: 73]
  ------------------
   37|       |
   38|     73|    const uint8_t* payload = data;
   39|     73|    size_t payload_len = size;
   40|       |
   41|     73|    if (!validate_nsm_msg_length(payload, payload_len)) {
  ------------------
  |  Branch (41:9): [True: 3, False: 70]
  ------------------
   42|      3|        return 0;
   43|      3|    }
   44|       |
   45|     70|    const struct nsm_msg* msg = reinterpret_cast<const struct nsm_msg*>(payload);
   46|     70|    const struct nsm_msg_hdr* hdr = reinterpret_cast<const struct nsm_msg_hdr*>(payload);
   47|       |
   48|       |    // Mismatch prevention: verify request/response type
   49|     70|    if (hdr->request != false) {
  ------------------
  |  Branch (49:9): [True: 4, False: 66]
  ------------------
   50|      4|        return 0;
   51|      4|    }
   52|       |
   53|     66|    std::vector<uint8_t> out_buf(65536, 0);
   54|     66|    std::vector<uint8_t> fuzz_event_class_buf(65536, 0);
   55|     66|    uint8_t* fuzz_event_class = reinterpret_cast<uint8_t*>(fuzz_event_class_buf.data());
   56|     66|    std::vector<uint8_t> fuzz_event_state_buf(65536, 0);
   57|     66|    uint16_t* fuzz_event_state = reinterpret_cast<uint16_t*>(fuzz_event_state_buf.data());
   58|     66|    decode_nsm_rediscovery_event(msg, payload_len, fuzz_event_class, fuzz_event_state);
   59|       |
   60|     66|    return 0;
   61|     70|}

_Z23validate_nsm_msg_lengthPKhm:
   27|     73|inline bool validate_nsm_msg_length(const uint8_t* payload, size_t payload_len) {
   28|     73|    return payload_len >= sizeof(struct nsm_msg_hdr);
   29|     73|}

decode_nsm_rediscovery_event:
  510|     66|{
  511|     66|	if (msg == NULL || event_class == NULL || event_state == NULL) {
  ------------------
  |  Branch (511:6): [True: 0, False: 66]
  |  Branch (511:21): [True: 0, False: 66]
  |  Branch (511:44): [True: 0, False: 66]
  ------------------
  512|      0|		return NSM_ERR_INVALID_DATA;
  513|      0|	}
  514|       |
  515|     66|	if (msg_len < sizeof(struct nsm_msg_hdr) + NSM_EVENT_MIN_LEN) {
  ------------------
  |  |   49|     66|#define NSM_EVENT_MIN_LEN 6
  ------------------
  |  Branch (515:6): [True: 5, False: 61]
  ------------------
  516|      5|		return NSM_ERR_INVALID_DATA_LENGTH;
  517|      5|	}
  518|       |
  519|     61|	struct nsm_event *event = (struct nsm_event *)msg->payload;
  520|     61|	if (event->data_size > 0) {
  ------------------
  |  Branch (520:6): [True: 38, False: 23]
  ------------------
  521|     38|		return NSM_ERR_INVALID_DATA_LENGTH;
  522|     38|	}
  523|       |
  524|     23|	*event_class = event->event_class;
  525|     23|	*event_state = le16toh(event->event_state);
  526|       |
  527|     23|	return NSM_SUCCESS;
  528|     61|}

