memdup:
    7|  1.20k|void* memdup(const void *p, size_t l) {
    8|  1.20k|        void *ret;
    9|       |
   10|  1.20k|        assert(l == 0 || p);
  ------------------
  |  |   72|  1.20k|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|  1.20k|        do {                                                            \
  |  |  |  |   59|  1.20k|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  2.40k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 1.20k]
  |  |  |  |  |  |  |  Branch (95:44): [True: 0, False: 1.20k]
  |  |  |  |  |  |  |  Branch (95:44): [True: 1.20k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|  1.20k|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|  1.20k|        } while (false)
  |  |  ------------------
  ------------------
   11|       |
   12|  1.20k|        ret = malloc(l ?: 1);
  ------------------
  |  Branch (12:22): [True: 1.20k, False: 0]
  ------------------
   13|  1.20k|        if (!ret)
  ------------------
  |  Branch (13:13): [True: 0, False: 0]
  ------------------
   14|      0|                return NULL;
   15|       |
   16|      0|        return memcpy_safe(ret, p, l);
   17|      0|}

fuzz-bcd.c:freep:
   78|  1.20k|static inline void freep(void *p) {
   79|  1.20k|        *(void**)p = mfree(*(void**) p);
  ------------------
  |  |  404|  1.20k|        ({                                      \
  |  |  405|  1.20k|                free(memory);                   \
  |  |  406|  1.20k|                (typeof(memory)) NULL;          \
  |  |  407|  1.20k|        })
  ------------------
   80|  1.20k|}
log.c:freep:
   78|  1.20k|static inline void freep(void *p) {
   79|  1.20k|        *(void**)p = mfree(*(void**) p);
  ------------------
  |  |  404|  1.20k|        ({                                      \
  |  |  405|  1.20k|                free(memory);                   \
  |  |  406|  1.20k|                (typeof(memory)) NULL;          \
  |  |  407|  1.20k|        })
  ------------------
   80|  1.20k|}

invoked_by_systemd:
   41|  1.20k|bool invoked_by_systemd(void) {
   42|  1.20k|        int r;
   43|       |
   44|       |        /* If the process is directly executed by PID1 (e.g. ExecStart= or generator), systemd-importd,
   45|       |         * or systemd-homed, then $SYSTEMD_EXEC_PID= is set, and read the command line. */
   46|  1.20k|        const char *e = getenv("SYSTEMD_EXEC_PID");
   47|  1.20k|        if (!e)
  ------------------
  |  Branch (47:13): [True: 1.20k, False: 0]
  ------------------
   48|  1.20k|                return false;
   49|       |
   50|      0|        if (streq(e, "*"))
  ------------------
  |  |   46|      0|#define streq(a,b) (strcmp((a),(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (46:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   51|       |                /* For testing. */
   52|      0|                return true;
   53|       |
   54|      0|        pid_t p;
   55|      0|        r = parse_pid(e, &p);
   56|      0|        if (r < 0) {
  ------------------
  |  Branch (56:13): [True: 0, False: 0]
  ------------------
   57|       |                /* We know that systemd sets the variable correctly. Something else must have set it. */
   58|      0|                log_debug_errno(r, "Failed to parse \"SYSTEMD_EXEC_PID=%s\", ignoring: %m", e);
  ------------------
  |  |  228|      0|#define log_debug_errno(error, ...)     log_full_errno(LOG_DEBUG,   error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  204|      0|        ({                                                              \
  |  |  |  |  205|      0|                int _error = (error);                                   \
  |  |  |  |  206|      0|                ASSERT_NON_ZERO(_error);                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  198|      0|#  define ASSERT_NON_ZERO(x) assert((x) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |  |  |  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   61|      0|        } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  207|      0|                log_full_errno_zerook(level, _error, __VA_ARGS__);      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|        ({                                                              \
  |  |  |  |  |  |  190|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |  |  |  191|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (191:22): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|                        ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|        })
  |  |  |  |  ------------------
  |  |  |  |  208|      0|        })
  |  |  ------------------
  ------------------
   59|      0|                return false;
   60|      0|        }
   61|       |
   62|      0|        return getpid_cached() == p;
   63|      0|}

log_set_assert_return_is_critical:
   16|  1.20k|void log_set_assert_return_is_critical(bool b) {
   17|  1.20k|        assert_return_is_critical = b;
   18|  1.20k|}

getenv_bool:
  991|  1.20k|int getenv_bool(const char *p) {
  992|  1.20k|        const char *e;
  993|       |
  994|  1.20k|        e = getenv(p);
  995|  1.20k|        if (!e)
  ------------------
  |  Branch (995:13): [True: 1.20k, False: 0]
  ------------------
  996|  1.20k|                return -ENXIO;
  997|       |
  998|      0|        return parse_boolean(e);
  999|  1.20k|}

log.c:_reset_errno_:
   23|  1.20k|static inline void _reset_errno_(int *saved_errno) {
   24|  1.20k|        if (*saved_errno < 0) /* Invalidated by UNPROTECT_ERRNO? */
  ------------------
  |  Branch (24:13): [True: 0, False: 1.20k]
  ------------------
   25|      0|                return;
   26|       |
   27|  1.20k|        errno = *saved_errno;
   28|  1.20k|}

safe_close:
   56|  2.40k|int safe_close(int fd) {
   57|       |        /*
   58|       |         * Like close_nointr() but cannot fail. Guarantees errno is unchanged. Is a noop for negative fds,
   59|       |         * and returns -EBADF, so that it can be used in this syntax:
   60|       |         *
   61|       |         * fd = safe_close(fd);
   62|       |         */
   63|       |
   64|  2.40k|        if (fd >= 0) {
  ------------------
  |  Branch (64:13): [True: 0, False: 2.40k]
  ------------------
   65|      0|                PROTECT_ERRNO;
  ------------------
  |  |   31|      0|        _cleanup_(_reset_errno_) _unused_ int _saved_errno_ = errno
  |  |  ------------------
  |  |  |  |   78|      0|#define _cleanup_(x) __attribute__((__cleanup__(x)))
  |  |  ------------------
  ------------------
   66|       |
   67|       |                /* The kernel might return pretty much any error code
   68|       |                 * via close(), but the fd will be closed anyway. The
   69|       |                 * only condition we want to check for here is whether
   70|       |                 * the fd was invalid at all... */
   71|       |
   72|      0|                assert_se(close_nointr(fd) != -EBADF);
  ------------------
  |  |   65|      0|#define assert_se(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|      0|        } while (false)
  |  |  ------------------
  ------------------
   73|      0|        }
   74|       |
   75|  2.40k|        return -EBADF;
   76|  2.40k|}

stderr_is_journal:
  233|  1.20k|bool stderr_is_journal(void) {
  234|  1.20k|        _cleanup_free_ char *w = NULL;
  ------------------
  |  |   82|  1.20k|#define _cleanup_free_ _cleanup_(freep)
  |  |  ------------------
  |  |  |  |   78|  1.20k|#define _cleanup_(x) __attribute__((__cleanup__(x)))
  |  |  ------------------
  ------------------
  235|  1.20k|        const char *e;
  236|  1.20k|        uint64_t dev, ino;
  237|  1.20k|        struct stat st;
  238|       |
  239|  1.20k|        e = getenv("JOURNAL_STREAM");
  240|  1.20k|        if (!e)
  ------------------
  |  Branch (240:13): [True: 1.20k, False: 0]
  ------------------
  241|  1.20k|                return false;
  242|       |
  243|      0|        if (extract_first_word(&e, &w, ":", EXTRACT_DONT_COALESCE_SEPARATORS) <= 0)
  ------------------
  |  Branch (243:13): [True: 0, False: 0]
  ------------------
  244|      0|                return false;
  245|      0|        if (!e)
  ------------------
  |  Branch (245:13): [True: 0, False: 0]
  ------------------
  246|      0|                return false;
  247|       |
  248|      0|        if (safe_atou64(w, &dev) < 0)
  ------------------
  |  Branch (248:13): [True: 0, False: 0]
  ------------------
  249|      0|                return false;
  250|      0|        if (safe_atou64(e, &ino) < 0)
  ------------------
  |  Branch (250:13): [True: 0, False: 0]
  ------------------
  251|      0|                return false;
  252|       |
  253|      0|        if (fstat(STDERR_FILENO, &st) < 0)
  ------------------
  |  Branch (253:13): [True: 0, False: 0]
  ------------------
  254|      0|                return false;
  255|       |
  256|      0|        return st.st_dev == dev && st.st_ino == ino;
  ------------------
  |  Branch (256:16): [True: 0, False: 0]
  |  Branch (256:36): [True: 0, False: 0]
  ------------------
  257|      0|}
log_open:
  259|  1.20k|int log_open(void) {
  260|  1.20k|        int r;
  261|       |
  262|       |        /* Do not call from library code. */
  263|       |
  264|       |        /* This function is often called in preparation for logging. Let's make sure we don't clobber errno,
  265|       |         * so that a call to a logging function immediately following a log_open() call can still easily
  266|       |         * reference an error that happened immediately before the log_open() call. */
  267|  1.20k|        PROTECT_ERRNO;
  ------------------
  |  |   31|  1.20k|        _cleanup_(_reset_errno_) _unused_ int _saved_errno_ = errno
  |  |  ------------------
  |  |  |  |   78|  1.20k|#define _cleanup_(x) __attribute__((__cleanup__(x)))
  |  |  ------------------
  ------------------
  268|       |
  269|       |        /* If we don't use the console, we close it here to not get killed by SAK. If we don't use syslog, we
  270|       |         * close it here too, so that we are not confused by somebody deleting the socket in the fs, and to
  271|       |         * make sure we don't use it if prohibit_ipc is set. If we don't use /dev/kmsg we still keep it open,
  272|       |         * because there is no reason to close it. */
  273|       |
  274|  1.20k|        if (log_target == LOG_TARGET_NULL) {
  ------------------
  |  Branch (274:13): [True: 0, False: 1.20k]
  ------------------
  275|      0|                log_close_journal();
  276|      0|                log_close_syslog();
  277|      0|                log_close_console();
  278|      0|                return 0;
  279|      0|        }
  280|       |
  281|  1.20k|        if (getpid_cached() == 1 ||
  ------------------
  |  Branch (281:13): [True: 0, False: 1.20k]
  ------------------
  282|  1.20k|            stderr_is_journal() ||
  ------------------
  |  Branch (282:13): [True: 0, False: 1.20k]
  ------------------
  283|  1.20k|            IN_SET(log_target,
  ------------------
  |  |  361|  1.20k|        ({                                                              \
  |  |  ------------------
  |  |  |  Branch (361:9): [True: 0, False: 1.20k]
  |  |  ------------------
  |  |  362|  1.20k|                bool _found = false;                                    \
  |  |  363|  1.20k|                /* If the build breaks in the line below, you need to extend the case macros. We use typeof(+x) \
  |  |  364|  1.20k|                 * here to widen the type of x if it is a bit-field as this would otherwise be illegal. */      \
  |  |  365|  1.20k|                static const typeof(+x) __assert_in_set[] _unused_ = { first, __VA_ARGS__ }; \
  |  |  366|  1.20k|                assert_cc(ELEMENTSOF(__assert_in_set) <= 20);           \
  |  |  ------------------
  |  |  |  |  142|  1.20k|#define assert_cc(expr) _Static_assert(expr, #expr)
  |  |  ------------------
  |  |  367|  1.20k|                switch (x) {                                            \
  |  |  368|      0|                FOR_EACH_MAKE_CASE(first, __VA_ARGS__)                  \
  |  |  ------------------
  |  |  |  |  356|      0|        GET_CASE_F(__VA_ARGS__,CASE_F_20,CASE_F_19,CASE_F_18,CASE_F_17,CASE_F_16,CASE_F_15,CASE_F_14,CASE_F_13,CASE_F_12,CASE_F_11, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define GET_CASE_F(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,NAME,...) NAME
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  337|      0|#define  CASE_F_5(X, ...) case X:  CASE_F_4( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  336|      0|#define  CASE_F_4(X, ...) case X:  CASE_F_3( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  335|      0|#define  CASE_F_3(X, ...) case X:  CASE_F_2( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  334|      0|#define  CASE_F_2(X, ...) case X:  CASE_F_1( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  333|      0|#define  CASE_F_1(X)      case X:
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (333:27): [True: 0, False: 1.20k]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (334:27): [True: 0, False: 1.20k]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (335:27): [True: 0, False: 1.20k]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (336:27): [True: 0, False: 1.20k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (337:27): [True: 0, False: 1.20k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  358|      0|                   (__VA_ARGS__)
  |  |  ------------------
  |  |  369|      0|                        _found = true;                                  \
  |  |  370|      0|                        break;                                          \
  |  |  371|  1.20k|                default:                                                \
  |  |  ------------------
  |  |  |  Branch (371:17): [True: 1.20k, False: 0]
  |  |  ------------------
  |  |  372|  1.20k|                        ;                                               \
  |  |  373|  1.20k|                }                                                       \
  |  |  374|  1.20k|                _found;                                                 \
  |  |  375|  1.20k|        })
  ------------------
  284|  1.20k|                   LOG_TARGET_KMSG,
  285|  1.20k|                   LOG_TARGET_JOURNAL,
  286|  1.20k|                   LOG_TARGET_JOURNAL_OR_KMSG,
  287|  1.20k|                   LOG_TARGET_SYSLOG,
  288|  1.20k|                   LOG_TARGET_SYSLOG_OR_KMSG)) {
  289|       |
  290|      0|                if (!prohibit_ipc) {
  ------------------
  |  Branch (290:21): [True: 0, False: 0]
  ------------------
  291|      0|                        if (IN_SET(log_target,
  ------------------
  |  |  361|      0|        ({                                                              \
  |  |  ------------------
  |  |  |  Branch (361:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  362|      0|                bool _found = false;                                    \
  |  |  363|      0|                /* If the build breaks in the line below, you need to extend the case macros. We use typeof(+x) \
  |  |  364|      0|                 * here to widen the type of x if it is a bit-field as this would otherwise be illegal. */      \
  |  |  365|      0|                static const typeof(+x) __assert_in_set[] _unused_ = { first, __VA_ARGS__ }; \
  |  |  366|      0|                assert_cc(ELEMENTSOF(__assert_in_set) <= 20);           \
  |  |  ------------------
  |  |  |  |  142|      0|#define assert_cc(expr) _Static_assert(expr, #expr)
  |  |  ------------------
  |  |  367|      0|                switch (x) {                                            \
  |  |  368|      0|                FOR_EACH_MAKE_CASE(first, __VA_ARGS__)                  \
  |  |  ------------------
  |  |  |  |  356|      0|        GET_CASE_F(__VA_ARGS__,CASE_F_20,CASE_F_19,CASE_F_18,CASE_F_17,CASE_F_16,CASE_F_15,CASE_F_14,CASE_F_13,CASE_F_12,CASE_F_11, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define GET_CASE_F(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,NAME,...) NAME
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  335|      0|#define  CASE_F_3(X, ...) case X:  CASE_F_2( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  334|      0|#define  CASE_F_2(X, ...) case X:  CASE_F_1( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  333|      0|#define  CASE_F_1(X)      case X:
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (333:27): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (334:27): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (335:27): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  358|      0|                   (__VA_ARGS__)
  |  |  ------------------
  |  |  369|      0|                        _found = true;                                  \
  |  |  370|      0|                        break;                                          \
  |  |  371|      0|                default:                                                \
  |  |  ------------------
  |  |  |  Branch (371:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  372|      0|                        ;                                               \
  |  |  373|      0|                }                                                       \
  |  |  374|      0|                _found;                                                 \
  |  |  375|      0|        })
  ------------------
  292|      0|                                   LOG_TARGET_AUTO,
  293|      0|                                   LOG_TARGET_JOURNAL_OR_KMSG,
  294|      0|                                   LOG_TARGET_JOURNAL)) {
  295|       |
  296|      0|                                r = log_open_journal();
  297|      0|                                if (r >= 0) {
  ------------------
  |  Branch (297:37): [True: 0, False: 0]
  ------------------
  298|      0|                                        log_close_syslog();
  299|      0|                                        log_close_console();
  300|      0|                                        return r;
  301|      0|                                }
  302|      0|                        }
  303|       |
  304|      0|                        if (IN_SET(log_target,
  ------------------
  |  |  361|      0|        ({                                                              \
  |  |  ------------------
  |  |  |  Branch (361:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  362|      0|                bool _found = false;                                    \
  |  |  363|      0|                /* If the build breaks in the line below, you need to extend the case macros. We use typeof(+x) \
  |  |  364|      0|                 * here to widen the type of x if it is a bit-field as this would otherwise be illegal. */      \
  |  |  365|      0|                static const typeof(+x) __assert_in_set[] _unused_ = { first, __VA_ARGS__ }; \
  |  |  366|      0|                assert_cc(ELEMENTSOF(__assert_in_set) <= 20);           \
  |  |  ------------------
  |  |  |  |  142|      0|#define assert_cc(expr) _Static_assert(expr, #expr)
  |  |  ------------------
  |  |  367|      0|                switch (x) {                                            \
  |  |  368|      0|                FOR_EACH_MAKE_CASE(first, __VA_ARGS__)                  \
  |  |  ------------------
  |  |  |  |  356|      0|        GET_CASE_F(__VA_ARGS__,CASE_F_20,CASE_F_19,CASE_F_18,CASE_F_17,CASE_F_16,CASE_F_15,CASE_F_14,CASE_F_13,CASE_F_12,CASE_F_11, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define GET_CASE_F(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,NAME,...) NAME
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  334|      0|#define  CASE_F_2(X, ...) case X:  CASE_F_1( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  333|      0|#define  CASE_F_1(X)      case X:
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (333:27): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (334:27): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  358|      0|                   (__VA_ARGS__)
  |  |  ------------------
  |  |  369|      0|                        _found = true;                                  \
  |  |  370|      0|                        break;                                          \
  |  |  371|      0|                default:                                                \
  |  |  ------------------
  |  |  |  Branch (371:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  372|      0|                        ;                                               \
  |  |  373|      0|                }                                                       \
  |  |  374|      0|                _found;                                                 \
  |  |  375|      0|        })
  ------------------
  305|      0|                                   LOG_TARGET_SYSLOG_OR_KMSG,
  306|      0|                                   LOG_TARGET_SYSLOG)) {
  307|       |
  308|      0|                                r = log_open_syslog();
  309|      0|                                if (r >= 0) {
  ------------------
  |  Branch (309:37): [True: 0, False: 0]
  ------------------
  310|      0|                                        log_close_journal();
  311|      0|                                        log_close_console();
  312|      0|                                        return r;
  313|      0|                                }
  314|      0|                        }
  315|      0|                }
  316|       |
  317|      0|                if (IN_SET(log_target, LOG_TARGET_AUTO,
  ------------------
  |  |  361|      0|        ({                                                              \
  |  |  ------------------
  |  |  |  Branch (361:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  362|      0|                bool _found = false;                                    \
  |  |  363|      0|                /* If the build breaks in the line below, you need to extend the case macros. We use typeof(+x) \
  |  |  364|      0|                 * here to widen the type of x if it is a bit-field as this would otherwise be illegal. */      \
  |  |  365|      0|                static const typeof(+x) __assert_in_set[] _unused_ = { first, __VA_ARGS__ }; \
  |  |  366|      0|                assert_cc(ELEMENTSOF(__assert_in_set) <= 20);           \
  |  |  ------------------
  |  |  |  |  142|      0|#define assert_cc(expr) _Static_assert(expr, #expr)
  |  |  ------------------
  |  |  367|      0|                switch (x) {                                            \
  |  |  368|      0|                FOR_EACH_MAKE_CASE(first, __VA_ARGS__)                  \
  |  |  ------------------
  |  |  |  |  356|      0|        GET_CASE_F(__VA_ARGS__,CASE_F_20,CASE_F_19,CASE_F_18,CASE_F_17,CASE_F_16,CASE_F_15,CASE_F_14,CASE_F_13,CASE_F_12,CASE_F_11, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define GET_CASE_F(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,NAME,...) NAME
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  336|      0|#define  CASE_F_4(X, ...) case X:  CASE_F_3( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  335|      0|#define  CASE_F_3(X, ...) case X:  CASE_F_2( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  334|      0|#define  CASE_F_2(X, ...) case X:  CASE_F_1( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  333|      0|#define  CASE_F_1(X)      case X:
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (333:27): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (334:27): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (335:27): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (336:27): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  358|      0|                   (__VA_ARGS__)
  |  |  ------------------
  |  |  369|      0|                        _found = true;                                  \
  |  |  370|      0|                        break;                                          \
  |  |  371|      0|                default:                                                \
  |  |  ------------------
  |  |  |  Branch (371:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  372|      0|                        ;                                               \
  |  |  373|      0|                }                                                       \
  |  |  374|      0|                _found;                                                 \
  |  |  375|      0|        })
  ------------------
  318|      0|                                       LOG_TARGET_JOURNAL_OR_KMSG,
  319|      0|                                       LOG_TARGET_SYSLOG_OR_KMSG,
  320|      0|                                       LOG_TARGET_KMSG)) {
  321|      0|                        r = log_open_kmsg();
  322|      0|                        if (r >= 0) {
  ------------------
  |  Branch (322:29): [True: 0, False: 0]
  ------------------
  323|      0|                                log_close_journal();
  324|      0|                                log_close_syslog();
  325|      0|                                log_close_console();
  326|      0|                                return r;
  327|      0|                        }
  328|      0|                }
  329|      0|        }
  330|       |
  331|  1.20k|        log_close_journal();
  332|  1.20k|        log_close_syslog();
  333|       |
  334|  1.20k|        return log_open_console();
  335|  1.20k|}
log_set_target:
  337|  1.20k|void log_set_target(LogTarget target) {
  338|  1.20k|        assert(target >= 0);
  ------------------
  |  |   72|  1.20k|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|  1.20k|        do {                                                            \
  |  |  |  |   59|  1.20k|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  1.20k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 1.20k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|  1.20k|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|  1.20k|        } while (false)
  |  |  ------------------
  ------------------
  339|  1.20k|        assert(target < _LOG_TARGET_MAX);
  ------------------
  |  |   72|  1.20k|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|  1.20k|        do {                                                            \
  |  |  |  |   59|  1.20k|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  1.20k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 1.20k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|  1.20k|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|  1.20k|        } while (false)
  |  |  ------------------
  ------------------
  340|       |
  341|  1.20k|        if (upgrade_syslog_to_journal) {
  ------------------
  |  Branch (341:13): [True: 0, False: 1.20k]
  ------------------
  342|      0|                if (target == LOG_TARGET_SYSLOG)
  ------------------
  |  Branch (342:21): [True: 0, False: 0]
  ------------------
  343|      0|                        target = LOG_TARGET_JOURNAL;
  344|      0|                else if (target == LOG_TARGET_SYSLOG_OR_KMSG)
  ------------------
  |  Branch (344:26): [True: 0, False: 0]
  ------------------
  345|      0|                        target = LOG_TARGET_JOURNAL_OR_KMSG;
  346|      0|        }
  347|       |
  348|  1.20k|        log_target = target;
  349|  1.20k|}
log_set_max_level:
  372|  1.20k|int log_set_max_level(int level) {
  373|  1.20k|        assert(level == LOG_NULL || log_level_is_valid(level));
  ------------------
  |  |   72|  1.20k|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|  1.20k|        do {                                                            \
  |  |  |  |   59|  1.20k|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  2.40k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 1.20k]
  |  |  |  |  |  |  |  Branch (95:44): [True: 0, False: 1.20k]
  |  |  |  |  |  |  |  Branch (95:44): [True: 1.20k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|  1.20k|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|  1.20k|        } while (false)
  |  |  ------------------
  ------------------
  374|       |
  375|  1.20k|        int old = log_max_level;
  376|  1.20k|        log_max_level = level;
  377|       |
  378|       |        /* Also propagate max log level to libc's syslog(), just in case some other component loaded into our
  379|       |         * process logs directly via syslog(). You might wonder why we maintain our own log level variable if
  380|       |         * libc has the same functionality. This has multiple reasons, first and foremost that we want to
  381|       |         * apply this to all our log targets, not just syslog and console. Moreover, we cannot query the
  382|       |         * current log mask from glibc without changing it, but that's useful for testing the current log
  383|       |         * level before even entering the log functions like we do in our macros. */
  384|  1.20k|        setlogmask(LOG_UPTO(level));
  385|       |
  386|       |        /* Ensure that our own LOG_NULL define maps sanely to the log mask */
  387|  1.20k|        assert_cc(LOG_UPTO(LOG_NULL) == 0);
  ------------------
  |  |  142|  1.20k|#define assert_cc(expr) _Static_assert(expr, #expr)
  ------------------
  388|       |
  389|  1.20k|        return old;
  390|  1.20k|}
log_parse_environment_variables:
 1321|  1.20k|void log_parse_environment_variables(void) {
 1322|  1.20k|        const char *e;
 1323|  1.20k|        int r;
 1324|       |
 1325|  1.20k|        e = getenv("SYSTEMD_LOG_TARGET");
 1326|  1.20k|        if (e && log_set_target_from_string(e) < 0)
  ------------------
  |  Branch (1326:13): [True: 0, False: 1.20k]
  |  Branch (1326:18): [True: 0, False: 0]
  ------------------
 1327|  1.20k|                log_warning("Failed to parse log target '%s', ignoring.", e);
  ------------------
  |  |  223|      0|#define log_warning(...)   log_full(LOG_WARNING, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  211|      0|        ({                                                             \
  |  |  |  |  212|      0|                if (BUILD_MODE_DEVELOPER)                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define BUILD_MODE_DEVELOPER 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (23:30): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  213|      0|                        assert(!strstr(fmt, "%m"));                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|      0|        } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  214|      0|                (void) log_full_errno_zerook(level, 0, fmt, ##__VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|        ({                                                              \
  |  |  |  |  |  |  190|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |  |  |  191|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (191:22): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|                        ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|        })
  |  |  |  |  ------------------
  |  |  |  |  215|      0|        })
  |  |  ------------------
  ------------------
 1328|       |
 1329|  1.20k|        e = getenv("SYSTEMD_LOG_LEVEL");
 1330|  1.20k|        if (e) {
  ------------------
  |  Branch (1330:13): [True: 0, False: 1.20k]
  ------------------
 1331|      0|                r = log_set_max_level_from_string(e);
 1332|      0|                if (r < 0)
  ------------------
  |  Branch (1332:21): [True: 0, False: 0]
  ------------------
 1333|      0|                        log_warning_errno(r, "Failed to parse log level '%s', ignoring: %m", e);
  ------------------
  |  |  231|      0|#define log_warning_errno(error, ...)   log_full_errno(LOG_WARNING, error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  204|      0|        ({                                                              \
  |  |  |  |  205|      0|                int _error = (error);                                   \
  |  |  |  |  206|      0|                ASSERT_NON_ZERO(_error);                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  198|      0|#  define ASSERT_NON_ZERO(x) assert((x) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |  |  |  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   61|      0|        } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  207|      0|                log_full_errno_zerook(level, _error, __VA_ARGS__);      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|        ({                                                              \
  |  |  |  |  |  |  190|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |  |  |  191|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (191:22): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|                        ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|        })
  |  |  |  |  ------------------
  |  |  |  |  208|      0|        })
  |  |  ------------------
  ------------------
 1334|  1.20k|        } else {
 1335|       |                /* If no explicit log level is specified then let's see if this is a debug invocation, and if
 1336|       |                 * so raise the log level to debug too. Note that this is not symmetric: just because
 1337|       |                 * DEBUG_INVOCATION is explicitly set to 0 we won't lower the log level below debug. This
 1338|       |                 * follows the logic that debug logging is an opt-in thing anyway, and if there's any reason
 1339|       |                 * to enable it we should not disable it here automatically. */
 1340|  1.20k|                r = getenv_bool("DEBUG_INVOCATION");
 1341|  1.20k|                if (r < 0 && r != -ENXIO)
  ------------------
  |  Branch (1341:21): [True: 1.20k, False: 0]
  |  Branch (1341:30): [True: 0, False: 1.20k]
  ------------------
 1342|  1.20k|                        log_warning_errno(r, "Failed to parse $DEBUG_INVOCATION value, ignoring: %m");
  ------------------
  |  |  231|      0|#define log_warning_errno(error, ...)   log_full_errno(LOG_WARNING, error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  204|      0|        ({                                                              \
  |  |  |  |  205|      0|                int _error = (error);                                   \
  |  |  |  |  206|      0|                ASSERT_NON_ZERO(_error);                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  198|      0|#  define ASSERT_NON_ZERO(x) assert((x) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |  |  |  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   61|      0|        } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  207|      0|                log_full_errno_zerook(level, _error, __VA_ARGS__);      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|        ({                                                              \
  |  |  |  |  |  |  190|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |  |  |  191|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (191:22): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|                        ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|        })
  |  |  |  |  ------------------
  |  |  |  |  208|      0|        })
  |  |  ------------------
  ------------------
 1343|  1.20k|                else if (r > 0)
  ------------------
  |  Branch (1343:26): [True: 0, False: 1.20k]
  ------------------
 1344|      0|                        log_set_max_level(LOG_DEBUG);
 1345|  1.20k|        }
 1346|       |
 1347|  1.20k|        e = getenv("SYSTEMD_LOG_COLOR");
 1348|  1.20k|        if (e && log_show_color_from_string(e) < 0)
  ------------------
  |  Branch (1348:13): [True: 0, False: 1.20k]
  |  Branch (1348:18): [True: 0, False: 0]
  ------------------
 1349|  1.20k|                log_warning("Failed to parse log color '%s', ignoring.", e);
  ------------------
  |  |  223|      0|#define log_warning(...)   log_full(LOG_WARNING, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  211|      0|        ({                                                             \
  |  |  |  |  212|      0|                if (BUILD_MODE_DEVELOPER)                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define BUILD_MODE_DEVELOPER 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (23:30): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  213|      0|                        assert(!strstr(fmt, "%m"));                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|      0|        } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  214|      0|                (void) log_full_errno_zerook(level, 0, fmt, ##__VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|        ({                                                              \
  |  |  |  |  |  |  190|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |  |  |  191|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (191:22): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|                        ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|        })
  |  |  |  |  ------------------
  |  |  |  |  215|      0|        })
  |  |  ------------------
  ------------------
 1350|       |
 1351|  1.20k|        e = getenv("SYSTEMD_LOG_LOCATION");
 1352|  1.20k|        if (e && log_show_location_from_string(e) < 0)
  ------------------
  |  Branch (1352:13): [True: 0, False: 1.20k]
  |  Branch (1352:18): [True: 0, False: 0]
  ------------------
 1353|  1.20k|                log_warning("Failed to parse log location '%s', ignoring.", e);
  ------------------
  |  |  223|      0|#define log_warning(...)   log_full(LOG_WARNING, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  211|      0|        ({                                                             \
  |  |  |  |  212|      0|                if (BUILD_MODE_DEVELOPER)                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define BUILD_MODE_DEVELOPER 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (23:30): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  213|      0|                        assert(!strstr(fmt, "%m"));                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|      0|        } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  214|      0|                (void) log_full_errno_zerook(level, 0, fmt, ##__VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|        ({                                                              \
  |  |  |  |  |  |  190|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |  |  |  191|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (191:22): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|                        ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|        })
  |  |  |  |  ------------------
  |  |  |  |  215|      0|        })
  |  |  ------------------
  ------------------
 1354|       |
 1355|  1.20k|        e = getenv("SYSTEMD_LOG_TIME");
 1356|  1.20k|        if (e && log_show_time_from_string(e) < 0)
  ------------------
  |  Branch (1356:13): [True: 0, False: 1.20k]
  |  Branch (1356:18): [True: 0, False: 0]
  ------------------
 1357|  1.20k|                log_warning("Failed to parse log time '%s', ignoring.", e);
  ------------------
  |  |  223|      0|#define log_warning(...)   log_full(LOG_WARNING, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  211|      0|        ({                                                             \
  |  |  |  |  212|      0|                if (BUILD_MODE_DEVELOPER)                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define BUILD_MODE_DEVELOPER 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (23:30): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  213|      0|                        assert(!strstr(fmt, "%m"));                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|      0|        } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  214|      0|                (void) log_full_errno_zerook(level, 0, fmt, ##__VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|        ({                                                              \
  |  |  |  |  |  |  190|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |  |  |  191|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (191:22): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|                        ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|        })
  |  |  |  |  ------------------
  |  |  |  |  215|      0|        })
  |  |  ------------------
  ------------------
 1358|       |
 1359|  1.20k|        e = getenv("SYSTEMD_LOG_TID");
 1360|  1.20k|        if (e && log_show_tid_from_string(e) < 0)
  ------------------
  |  Branch (1360:13): [True: 0, False: 1.20k]
  |  Branch (1360:18): [True: 0, False: 0]
  ------------------
 1361|  1.20k|                log_warning("Failed to parse log tid '%s', ignoring.", e);
  ------------------
  |  |  223|      0|#define log_warning(...)   log_full(LOG_WARNING, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  211|      0|        ({                                                             \
  |  |  |  |  212|      0|                if (BUILD_MODE_DEVELOPER)                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define BUILD_MODE_DEVELOPER 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (23:30): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  213|      0|                        assert(!strstr(fmt, "%m"));                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|      0|        } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  214|      0|                (void) log_full_errno_zerook(level, 0, fmt, ##__VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|        ({                                                              \
  |  |  |  |  |  |  190|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |  |  |  191|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (191:22): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|                        ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|        })
  |  |  |  |  ------------------
  |  |  |  |  215|      0|        })
  |  |  ------------------
  ------------------
 1362|       |
 1363|  1.20k|        e = getenv("SYSTEMD_LOG_RATELIMIT_KMSG");
 1364|  1.20k|        if (e && log_set_ratelimit_kmsg_from_string(e) < 0)
  ------------------
  |  Branch (1364:13): [True: 0, False: 1.20k]
  |  Branch (1364:18): [True: 0, False: 0]
  ------------------
 1365|  1.20k|                log_warning("Failed to parse log ratelimit kmsg boolean '%s', ignoring.", e);
  ------------------
  |  |  223|      0|#define log_warning(...)   log_full(LOG_WARNING, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  211|      0|        ({                                                             \
  |  |  |  |  212|      0|                if (BUILD_MODE_DEVELOPER)                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define BUILD_MODE_DEVELOPER 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (23:30): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  213|      0|                        assert(!strstr(fmt, "%m"));                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|      0|        } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  214|      0|                (void) log_full_errno_zerook(level, 0, fmt, ##__VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|        ({                                                              \
  |  |  |  |  |  |  190|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |  |  |  191|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (191:22): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|                        ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|        })
  |  |  |  |  ------------------
  |  |  |  |  215|      0|        })
  |  |  ------------------
  ------------------
 1366|  1.20k|}
log_parse_environment:
 1368|  1.20k|void log_parse_environment(void) {
 1369|       |        /* Do not call from library code. */
 1370|       |
 1371|  1.20k|        if (should_parse_proc_cmdline())
  ------------------
  |  Branch (1371:13): [True: 0, False: 1.20k]
  ------------------
 1372|      0|                (void) proc_cmdline_parse(parse_proc_cmdline_item, NULL, PROC_CMDLINE_STRIP_RD_PREFIX);
 1373|       |
 1374|  1.20k|        log_parse_environment_variables();
 1375|  1.20k|}
log_show_color:
 1409|      1|void log_show_color(bool b) {
 1410|      1|        show_color = b;
 1411|      1|}
log_on_console:
 1485|  1.20k|bool log_on_console(void) {
 1486|  1.20k|        if (IN_SET(log_target, LOG_TARGET_CONSOLE,
  ------------------
  |  |  361|  1.20k|        ({                                                              \
  |  |  ------------------
  |  |  |  Branch (361:9): [True: 0, False: 1.20k]
  |  |  ------------------
  |  |  362|  1.20k|                bool _found = false;                                    \
  |  |  363|  1.20k|                /* If the build breaks in the line below, you need to extend the case macros. We use typeof(+x) \
  |  |  364|  1.20k|                 * here to widen the type of x if it is a bit-field as this would otherwise be illegal. */      \
  |  |  365|  1.20k|                static const typeof(+x) __assert_in_set[] _unused_ = { first, __VA_ARGS__ }; \
  |  |  366|  1.20k|                assert_cc(ELEMENTSOF(__assert_in_set) <= 20);           \
  |  |  ------------------
  |  |  |  |  142|  1.20k|#define assert_cc(expr) _Static_assert(expr, #expr)
  |  |  ------------------
  |  |  367|  1.20k|                switch (x) {                                            \
  |  |  368|      0|                FOR_EACH_MAKE_CASE(first, __VA_ARGS__)                  \
  |  |  ------------------
  |  |  |  |  356|      0|        GET_CASE_F(__VA_ARGS__,CASE_F_20,CASE_F_19,CASE_F_18,CASE_F_17,CASE_F_16,CASE_F_15,CASE_F_14,CASE_F_13,CASE_F_12,CASE_F_11, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define GET_CASE_F(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,NAME,...) NAME
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  334|      0|#define  CASE_F_2(X, ...) case X:  CASE_F_1( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  333|      0|#define  CASE_F_1(X)      case X:
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (333:27): [True: 0, False: 1.20k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (334:27): [True: 0, False: 1.20k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  358|      0|                   (__VA_ARGS__)
  |  |  ------------------
  |  |  369|      0|                        _found = true;                                  \
  |  |  370|      0|                        break;                                          \
  |  |  371|  1.20k|                default:                                                \
  |  |  ------------------
  |  |  |  Branch (371:17): [True: 1.20k, False: 0]
  |  |  ------------------
  |  |  372|  1.20k|                        ;                                               \
  |  |  373|  1.20k|                }                                                       \
  |  |  374|  1.20k|                _found;                                                 \
  |  |  375|  1.20k|        })
  ------------------
 1487|  1.20k|                               LOG_TARGET_CONSOLE_PREFIXED))
 1488|      0|                return true;
 1489|       |
 1490|  1.20k|        return syslog_fd < 0 && kmsg_fd < 0 && journal_fd < 0;
  ------------------
  |  Branch (1490:16): [True: 1.20k, False: 0]
  |  Branch (1490:33): [True: 1.20k, False: 0]
  |  Branch (1490:48): [True: 1.20k, False: 0]
  ------------------
 1491|  1.20k|}
log_setup:
 1714|  1.20k|void log_setup(void) {
 1715|  1.20k|        log_set_target(LOG_TARGET_AUTO);
 1716|  1.20k|        log_parse_environment();
 1717|  1.20k|        (void) log_open();
 1718|  1.20k|        if (log_on_console() && show_color < 0)
  ------------------
  |  Branch (1718:13): [True: 1.20k, False: 0]
  |  Branch (1718:33): [True: 1, False: 1.20k]
  ------------------
 1719|      1|                log_show_color(true);
 1720|  1.20k|}
log.c:log_close_journal:
  202|  1.20k|static void log_close_journal(void) {
  203|       |        /* If the journal FD is bad, safe_close will fail, and will try to log, which will fail, so we'll
  204|       |         * try to close the journal FD, which is bad, so safe_close will fail... Whether we can close it
  205|       |         * or not, invalidate it immediately so that we don't get in a recursive loop until we run out of
  206|       |         * stack. */
  207|  1.20k|        (void) safe_close(TAKE_FD(journal_fd));
  ------------------
  |  |   99|  1.20k|#define TAKE_FD(fd) TAKE_GENERIC(fd, int, -EBADF)
  |  |  ------------------
  |  |  |  |  380|  1.20k|        ({                                                       \
  |  |  |  |  381|  1.20k|                type *_pvar_ = &(var);                           \
  |  |  |  |  382|  1.20k|                type _var_ = *_pvar_;                            \
  |  |  |  |  383|  1.20k|                type _nullvalue_ = nullvalue;                    \
  |  |  |  |  384|  1.20k|                *_pvar_ = _nullvalue_;                           \
  |  |  |  |  385|  1.20k|                _var_;                                           \
  |  |  |  |  386|  1.20k|        })
  |  |  ------------------
  ------------------
  208|  1.20k|}
log.c:log_close_syslog:
  136|  1.20k|static void log_close_syslog(void) {
  137|       |        /* See comment in log_close_journal() */
  138|  1.20k|        (void) safe_close(TAKE_FD(syslog_fd));
  ------------------
  |  |   99|  1.20k|#define TAKE_FD(fd) TAKE_GENERIC(fd, int, -EBADF)
  |  |  ------------------
  |  |  |  |  380|  1.20k|        ({                                                       \
  |  |  |  |  381|  1.20k|                type *_pvar_ = &(var);                           \
  |  |  |  |  382|  1.20k|                type _var_ = *_pvar_;                            \
  |  |  |  |  383|  1.20k|                type _nullvalue_ = nullvalue;                    \
  |  |  |  |  384|  1.20k|                *_pvar_ = _nullvalue_;                           \
  |  |  |  |  385|  1.20k|                _var_;                                           \
  |  |  |  |  386|  1.20k|        })
  |  |  ------------------
  ------------------
  139|  1.20k|}
log.c:log_open_console:
   96|  1.20k|static int log_open_console(void) {
   97|       |
   98|  1.20k|        if (!always_reopen_console) {
  ------------------
  |  Branch (98:13): [True: 1.20k, False: 0]
  ------------------
   99|  1.20k|                console_fd = STDERR_FILENO;
  100|  1.20k|                console_fd_is_tty = -1;
  101|  1.20k|                return 0;
  102|  1.20k|        }
  103|       |
  104|      0|        if (console_fd < 3) {
  ------------------
  |  Branch (104:13): [True: 0, False: 0]
  ------------------
  105|      0|                int fd;
  106|       |
  107|      0|                fd = open_terminal("/dev/console", O_WRONLY|O_NOCTTY|O_CLOEXEC);
  108|      0|                if (fd < 0)
  ------------------
  |  Branch (108:21): [True: 0, False: 0]
  ------------------
  109|      0|                        return fd;
  110|       |
  111|      0|                console_fd = fd_move_above_stdio(fd);
  112|      0|                console_fd_is_tty = true;
  113|      0|        }
  114|       |
  115|      0|        return 0;
  116|      0|}
log.c:should_parse_proc_cmdline:
 1312|  1.20k|static bool should_parse_proc_cmdline(void) {
 1313|       |        /* PID1 always reads the kernel command line. */
 1314|  1.20k|        if (getpid_cached() == 1)
  ------------------
  |  Branch (1314:13): [True: 0, False: 1.20k]
  ------------------
 1315|      0|                return true;
 1316|       |
 1317|       |        /* Otherwise, parse the command line if invoked directly by systemd. */
 1318|  1.20k|        return invoked_by_systemd();
 1319|  1.20k|}

alloc-util.c:memcpy_safe:
   18|  1.20k|static inline void* memcpy_safe(void *dst, const void *src, size_t n) {
   19|  1.20k|        if (n == 0)
  ------------------
  |  Branch (19:13): [True: 0, False: 1.20k]
  ------------------
   20|      0|                return dst;
   21|  1.20k|        assert(src);
  ------------------
  |  |   72|  1.20k|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|  1.20k|        do {                                                            \
  |  |  |  |   59|  1.20k|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  1.20k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 1.20k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|  1.20k|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|  1.20k|        } while (false)
  |  |  ------------------
  ------------------
   22|  1.20k|        return memcpy(dst, src, n);
   23|  1.20k|}

getpid_cached:
 1387|  2.40k|pid_t getpid_cached(void) {
 1388|  2.40k|        static bool installed = false;
 1389|  2.40k|        pid_t current_value = CACHED_PID_UNSET;
  ------------------
  |  | 1377|  2.40k|#define CACHED_PID_UNSET ((pid_t) 0)
  ------------------
 1390|       |
 1391|       |        /* getpid_cached() is much like getpid(), but caches the value in local memory, to avoid having to invoke a
 1392|       |         * system call each time. This restores glibc behaviour from before 2.24, when getpid() was unconditionally
 1393|       |         * cached. Starting with 2.24 getpid() started to become prohibitively expensive when used for detecting when
 1394|       |         * objects were used across fork()s. With this caching the old behaviour is somewhat restored.
 1395|       |         *
 1396|       |         * https://bugzilla.redhat.com/show_bug.cgi?id=1443976
 1397|       |         * https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c579f48edba88380635ab98cb612030e3ed8691e
 1398|       |         */
 1399|       |
 1400|  2.40k|        (void) __atomic_compare_exchange_n(
 1401|  2.40k|                        &cached_pid,
 1402|  2.40k|                        &current_value,
 1403|  2.40k|                        CACHED_PID_BUSY,
  ------------------
  |  | 1378|  2.40k|#define CACHED_PID_BUSY ((pid_t) -1)
  ------------------
 1404|  2.40k|                        false,
 1405|  2.40k|                        __ATOMIC_SEQ_CST,
 1406|  2.40k|                        __ATOMIC_SEQ_CST);
 1407|       |
 1408|  2.40k|        switch (current_value) {
 1409|       |
 1410|      1|        case CACHED_PID_UNSET: { /* Not initialized yet, then do so now */
  ------------------
  |  | 1377|      1|#define CACHED_PID_UNSET ((pid_t) 0)
  ------------------
  |  Branch (1410:9): [True: 1, False: 2.40k]
  ------------------
 1411|      1|                pid_t new_pid;
 1412|       |
 1413|      1|                new_pid = getpid();
 1414|       |
 1415|      1|                if (!installed) {
  ------------------
  |  Branch (1415:21): [True: 1, False: 0]
  ------------------
 1416|       |                        /* __register_atfork() either returns 0 or -ENOMEM, in its glibc implementation. Since it's
 1417|       |                         * only half-documented (glibc doesn't document it but LSB does — though only superficially)
 1418|       |                         * we'll check for errors only in the most generic fashion possible. */
 1419|       |
 1420|      1|                        if (pthread_atfork(NULL, NULL, reset_cached_pid) != 0) {
  ------------------
  |  Branch (1420:29): [True: 0, False: 1]
  ------------------
 1421|       |                                /* OOM? Let's try again later */
 1422|      0|                                cached_pid = CACHED_PID_UNSET;
  ------------------
  |  | 1377|      0|#define CACHED_PID_UNSET ((pid_t) 0)
  ------------------
 1423|      0|                                return new_pid;
 1424|      0|                        }
 1425|       |
 1426|      1|                        installed = true;
 1427|      1|                }
 1428|       |
 1429|      1|                cached_pid = new_pid;
 1430|      1|                return new_pid;
 1431|      1|        }
 1432|       |
 1433|      0|        case CACHED_PID_BUSY: /* Somebody else is currently initializing */
  ------------------
  |  | 1378|      0|#define CACHED_PID_BUSY ((pid_t) -1)
  ------------------
  |  Branch (1433:9): [True: 0, False: 2.40k]
  ------------------
 1434|      0|                return getpid();
 1435|       |
 1436|  2.40k|        default: /* Properly initialized */
  ------------------
  |  Branch (1436:9): [True: 2.40k, False: 1]
  ------------------
 1437|  2.40k|                return current_value;
 1438|  2.40k|        }
 1439|  2.40k|}

log_level_is_valid:
  101|  1.20k|bool log_level_is_valid(int level) {
  102|  1.20k|        return level >= 0 && level <= LOG_DEBUG;
  ------------------
  |  Branch (102:16): [True: 1.20k, False: 0]
  |  Branch (102:30): [True: 1.20k, False: 0]
  ------------------
  103|  1.20k|}

char16_strlen:
  491|     34|size_t char16_strlen(const char16_t *s) {
  492|     34|        size_t n = 0;
  493|       |
  494|     34|        assert(s);
  ------------------
  |  |   72|     34|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|     34|        do {                                                            \
  |  |  |  |   59|     34|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|     34|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 34]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|     34|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|     34|        } while (false)
  |  |  ------------------
  ------------------
  495|       |
  496|  33.1k|        while (*s != 0)
  ------------------
  |  Branch (496:16): [True: 33.0k, False: 34]
  ------------------
  497|  33.0k|                n++, s++;
  498|       |
  499|     34|        return n;
  500|     34|}

get_bcd_title:
  221|  1.20k|char16_t *get_bcd_title(uint8_t *bcd, size_t bcd_len) {
  222|  1.20k|        assert(bcd);
  ------------------
  |  |   72|  1.20k|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|  1.20k|        do {                                                            \
  |  |  |  |   59|  1.20k|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  1.20k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 1.20k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|  1.20k|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|  1.20k|        } while (false)
  |  |  ------------------
  ------------------
  223|       |
  224|  1.20k|        if (HIVE_CELL_OFFSET >= bcd_len)
  ------------------
  |  |   47|  1.20k|#define HIVE_CELL_OFFSET (sizeof(BaseBlock) + 4)
  ------------------
  |  Branch (224:13): [True: 38, False: 1.16k]
  ------------------
  225|     38|                return NULL;
  226|       |
  227|  1.16k|        BaseBlock *base_block = (BaseBlock *) bcd;
  228|  1.16k|        if (base_block->sig != SIG_BASE_BLOCK ||
  ------------------
  |  Branch (228:13): [True: 53, False: 1.11k]
  ------------------
  229|  1.16k|            base_block->version_major != 1 ||
  ------------------
  |  Branch (229:13): [True: 44, False: 1.06k]
  ------------------
  230|  1.16k|            base_block->version_minor != 3 ||
  ------------------
  |  Branch (230:13): [True: 46, False: 1.02k]
  ------------------
  231|  1.16k|            base_block->type != 0 ||
  ------------------
  |  Branch (231:13): [True: 47, False: 974]
  ------------------
  232|  1.16k|            base_block->primary_seqnum != base_block->secondary_seqnum)
  ------------------
  |  Branch (232:13): [True: 47, False: 927]
  ------------------
  233|    237|                return NULL;
  234|       |
  235|    927|        bcd += HIVE_CELL_OFFSET;
  ------------------
  |  |   47|    927|#define HIVE_CELL_OFFSET (sizeof(BaseBlock) + 4)
  ------------------
  236|    927|        bcd_len -= HIVE_CELL_OFFSET;
  ------------------
  |  |   47|    927|#define HIVE_CELL_OFFSET (sizeof(BaseBlock) + 4)
  ------------------
  237|       |
  238|    927|        const Key *objects_key = get_key(bcd, bcd_len, base_block->root_cell_offset, "\0Objects\0");
  239|    927|        if (!objects_key)
  ------------------
  |  Branch (239:13): [True: 275, False: 652]
  ------------------
  240|    275|                return NULL;
  241|       |
  242|    652|        const Key *displayorder_key = get_subkey(
  243|    652|                        bcd,
  244|    652|                        bcd_len,
  245|    652|                        objects_key->subkeys_offset,
  246|    652|                        "{9dea862c-5cdd-4e70-acc1-f32b344d4795}\0Elements\00024000001\0");
  247|    652|        if (!displayorder_key)
  ------------------
  |  Branch (247:13): [True: 196, False: 456]
  ------------------
  248|    196|                return NULL;
  249|       |
  250|    456|        const KeyValue *displayorder_value = get_key_value(bcd, bcd_len, displayorder_key, "Element");
  251|    456|        if (!displayorder_value)
  ------------------
  |  Branch (251:13): [True: 202, False: 254]
  ------------------
  252|    202|                return NULL;
  253|       |
  254|    254|        char order_guid[sizeof("{00000000-0000-0000-0000-000000000000}\0")];
  255|    254|        if (displayorder_value->data_type != REG_MULTI_SZ ||
  ------------------
  |  Branch (255:13): [True: 53, False: 201]
  ------------------
  256|    254|            displayorder_value->data_size != sizeof(char16_t[sizeof(order_guid)]) ||
  ------------------
  |  Branch (256:13): [True: 24, False: 177]
  ------------------
  257|    254|            (uintptr_t) (bcd + displayorder_value->data_offset) % alignof(char16_t) != 0)
  ------------------
  |  Branch (257:13): [True: 1, False: 176]
  ------------------
  258|       |                /* BCD is multi-boot. */
  259|     78|                return NULL;
  260|       |
  261|       |        /* Keys are stored as ASCII in registry hives if the data fits (and GUIDS always should). */
  262|    176|        char16_t *order_guid_utf16 = (char16_t *) (bcd + displayorder_value->data_offset);
  263|  5.99k|        for (size_t i = 0; i < sizeof(order_guid) - 2; i++) {
  ------------------
  |  Branch (263:28): [True: 5.88k, False: 112]
  ------------------
  264|  5.88k|                char16_t c = order_guid_utf16[i];
  265|  5.88k|                switch (c) {
  266|    500|                case '-':
  ------------------
  |  Branch (266:17): [True: 500, False: 5.38k]
  ------------------
  267|    663|                case '{':
  ------------------
  |  Branch (267:17): [True: 163, False: 5.71k]
  ------------------
  268|    828|                case '}':
  ------------------
  |  Branch (268:17): [True: 165, False: 5.71k]
  ------------------
  269|  3.56k|                case '0' ... '9':
  ------------------
  |  Branch (269:17): [True: 2.73k, False: 3.14k]
  ------------------
  270|  4.83k|                case 'a' ... 'f':
  ------------------
  |  Branch (270:17): [True: 1.26k, False: 4.61k]
  ------------------
  271|  5.81k|                case 'A' ... 'F':
  ------------------
  |  Branch (271:17): [True: 986, False: 4.89k]
  ------------------
  272|  5.81k|                        order_guid[i] = c;
  273|  5.81k|                        break;
  274|     64|                default:
  ------------------
  |  Branch (274:17): [True: 64, False: 5.81k]
  ------------------
  275|       |                        /* Not a valid GUID. */
  276|     64|                        return NULL;
  277|  5.88k|                }
  278|  5.88k|        }
  279|       |        /* Our functions expect the lookup key to be double-derminated. */
  280|    112|        order_guid[sizeof(order_guid) - 2] = '\0';
  281|    112|        order_guid[sizeof(order_guid) - 1] = '\0';
  282|       |
  283|    112|        const Key *default_key = get_subkey(bcd, bcd_len, objects_key->subkeys_offset, order_guid);
  284|    112|        if (!default_key)
  ------------------
  |  Branch (284:13): [True: 16, False: 96]
  ------------------
  285|     16|                return NULL;
  286|       |
  287|     96|        const Key *description_key = get_subkey(
  288|     96|                        bcd, bcd_len, default_key->subkeys_offset, "Elements\00012000004\0");
  289|     96|        if (!description_key)
  ------------------
  |  Branch (289:13): [True: 1, False: 95]
  ------------------
  290|      1|                return NULL;
  291|       |
  292|     95|        const KeyValue *description_value = get_key_value(bcd, bcd_len, description_key, "Element");
  293|     95|        if (!description_value)
  ------------------
  |  Branch (293:13): [True: 4, False: 91]
  ------------------
  294|      4|                return NULL;
  295|       |
  296|     91|        if (description_value->data_type != REG_SZ ||
  ------------------
  |  Branch (296:13): [True: 42, False: 49]
  ------------------
  297|     91|            description_value->data_size < sizeof(char16_t) ||
  ------------------
  |  Branch (297:13): [True: 3, False: 46]
  ------------------
  298|     91|            description_value->data_size % sizeof(char16_t) != 0 ||
  ------------------
  |  Branch (298:13): [True: 10, False: 36]
  ------------------
  299|     91|            (uintptr_t) (bcd + description_value->data_offset) % alignof(char16_t))
  ------------------
  |  Branch (299:13): [True: 2, False: 34]
  ------------------
  300|     57|                return NULL;
  301|       |
  302|       |        /* The data should already be NUL-terminated. */
  303|     34|        char16_t *title = (char16_t *) (bcd + description_value->data_offset);
  304|     34|        title[description_value->data_size / sizeof(char16_t) - 1] = '\0';
  305|     34|        return title;
  306|     91|}
bcd.c:get_key:
  137|  7.02k|static const Key *get_key(const uint8_t *bcd, uint32_t bcd_len, uint32_t offset, const char *name) {
  138|  7.02k|        assert(bcd);
  ------------------
  |  |   72|  7.02k|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|  7.02k|        do {                                                            \
  |  |  |  |   59|  7.02k|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  7.02k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 7.02k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|  7.02k|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|  7.02k|        } while (false)
  |  |  ------------------
  ------------------
  139|  7.02k|        assert(name);
  ------------------
  |  |   72|  7.02k|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|  7.02k|        do {                                                            \
  |  |  |  |   59|  7.02k|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  7.02k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 7.02k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|  7.02k|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|  7.02k|        } while (false)
  |  |  ------------------
  ------------------
  140|       |
  141|  7.02k|        if (BAD_STRUCT(Key, offset, bcd_len))
  ------------------
  |  |  100|  7.02k|        ((uint64_t) (offset) + sizeof(type) >= (max))
  |  |  ------------------
  |  |  |  Branch (100:9): [True: 1.08k, False: 5.93k]
  |  |  ------------------
  ------------------
  142|  1.08k|                return NULL;
  143|       |
  144|  5.93k|        const Key *key = (const Key *) (bcd + offset);
  145|  5.93k|        if (key->sig != SIG_KEY)
  ------------------
  |  Branch (145:13): [True: 564, False: 5.37k]
  ------------------
  146|    564|                return NULL;
  147|       |
  148|  5.37k|        if (BAD_ARRAY(Key, key_name, offset, key->key_name_len, bcd_len))
  ------------------
  |  |  103|  5.37k|        ((uint64_t) (offset) + offsetof(type, array) + \
  |  |  ------------------
  |  |  |  Branch (103:9): [True: 232, False: 5.14k]
  |  |  ------------------
  |  |  104|  5.37k|         sizeof((type){}.array[0]) * (uint64_t) (array_len) >= (max))
  ------------------
  149|    232|                return NULL;
  150|       |
  151|  5.14k|        if (*name) {
  ------------------
  |  Branch (151:13): [True: 4.31k, False: 830]
  ------------------
  152|  4.31k|                if (strncaseeq8(name, key->key_name, key->key_name_len) && strlen8(name) == key->key_name_len)
  ------------------
  |  Branch (152:21): [True: 4.01k, False: 302]
  |  Branch (152:76): [True: 3.63k, False: 379]
  ------------------
  153|  3.63k|                        name += key->key_name_len;
  154|    681|                else
  155|    681|                        return NULL;
  156|  4.31k|        }
  157|       |
  158|  4.46k|        name++;
  159|  4.46k|        return *name ? get_subkey(bcd, bcd_len, key->subkeys_offset, name) : key;
  ------------------
  |  Branch (159:16): [True: 3.16k, False: 1.29k]
  ------------------
  160|  5.14k|}
bcd.c:get_subkey:
  108|  4.02k|static const Key *get_subkey(const uint8_t *bcd, uint32_t bcd_len, uint32_t offset, const char *name) {
  109|  4.02k|        assert(bcd);
  ------------------
  |  |   72|  4.02k|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|  4.02k|        do {                                                            \
  |  |  |  |   59|  4.02k|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  4.02k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 4.02k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|  4.02k|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|  4.02k|        } while (false)
  |  |  ------------------
  ------------------
  110|  4.02k|        assert(name);
  ------------------
  |  |   72|  4.02k|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|  4.02k|        do {                                                            \
  |  |  |  |   59|  4.02k|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  4.02k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 4.02k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|  4.02k|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|  4.02k|        } while (false)
  |  |  ------------------
  ------------------
  111|       |
  112|  4.02k|        if (BAD_STRUCT(SubkeyFast, offset, bcd_len))
  ------------------
  |  |  100|  4.02k|        ((uint64_t) (offset) + sizeof(type) >= (max))
  |  |  ------------------
  |  |  |  Branch (100:9): [True: 310, False: 3.71k]
  |  |  ------------------
  ------------------
  113|    310|                return NULL;
  114|       |
  115|  3.71k|        const SubkeyFast *subkey = (const SubkeyFast *) (bcd + offset);
  116|  3.71k|        if (subkey->sig != SIG_SUBKEY_FAST)
  ------------------
  |  Branch (116:13): [True: 254, False: 3.45k]
  ------------------
  117|    254|                return NULL;
  118|       |
  119|  3.45k|        if (BAD_ARRAY(SubkeyFast, entries, offset, subkey->n_entries, bcd_len))
  ------------------
  |  |  103|  3.45k|        ((uint64_t) (offset) + offsetof(type, array) + \
  |  |  ------------------
  |  |  |  Branch (103:9): [True: 262, False: 3.19k]
  |  |  ------------------
  |  |  104|  3.45k|         sizeof((type){}.array[0]) * (uint64_t) (array_len) >= (max))
  ------------------
  120|    262|                return NULL;
  121|       |
  122|   121k|        for (uint16_t i = 0; i < subkey->n_entries; i++) {
  ------------------
  |  Branch (122:30): [True: 120k, False: 890]
  ------------------
  123|   120k|                if (!strncaseeq8(name, subkey->entries[i].name_hint, sizeof(subkey->entries[i].name_hint)))
  ------------------
  |  Branch (123:21): [True: 114k, False: 6.09k]
  ------------------
  124|   114k|                        continue;
  125|       |
  126|  6.09k|                const Key *key = get_key(bcd, bcd_len, subkey->entries[i].key_offset, name);
  127|  6.09k|                if (key)
  ------------------
  |  Branch (127:21): [True: 2.30k, False: 3.78k]
  ------------------
  128|  2.30k|                        return key;
  129|  6.09k|        }
  130|       |
  131|    890|        return NULL;
  132|  3.19k|}
bcd.c:get_key_value:
  162|    551|static const KeyValue *get_key_value(const uint8_t *bcd, uint32_t bcd_len, const Key *key, const char *name) {
  163|    551|        assert(bcd);
  ------------------
  |  |   72|    551|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    551|        do {                                                            \
  |  |  |  |   59|    551|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    551|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 551]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    551|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    551|        } while (false)
  |  |  ------------------
  ------------------
  164|    551|        assert(key);
  ------------------
  |  |   72|    551|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    551|        do {                                                            \
  |  |  |  |   59|    551|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    551|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 551]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    551|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    551|        } while (false)
  |  |  ------------------
  ------------------
  165|    551|        assert(name);
  ------------------
  |  |   72|    551|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    551|        do {                                                            \
  |  |  |  |   59|    551|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    551|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 551]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    551|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    551|        } while (false)
  |  |  ------------------
  ------------------
  166|       |
  167|    551|        if (key->n_key_values == 0)
  ------------------
  |  Branch (167:13): [True: 1, False: 550]
  ------------------
  168|      1|                return NULL;
  169|       |
  170|    550|        if (BAD_OFFSET(key->key_values_offset, sizeof(uint32_t) * (uint64_t) key->n_key_values, bcd_len) ||
  ------------------
  |  |   97|  1.10k|        ((uint64_t) (offset) + (len) >= (max))
  |  |  ------------------
  |  |  |  Branch (97:9): [True: 81, False: 469]
  |  |  ------------------
  ------------------
  171|    550|            (uintptr_t) (bcd + key->key_values_offset) % alignof(uint32_t) != 0)
  ------------------
  |  Branch (171:13): [True: 3, False: 466]
  ------------------
  172|     84|                return NULL;
  173|       |
  174|    466|        const uint32_t *key_value_list = (const uint32_t *) (bcd + key->key_values_offset);
  175|   177k|        for (uint32_t i = 0; i < key->n_key_values; i++) {
  ------------------
  |  Branch (175:30): [True: 176k, False: 121]
  ------------------
  176|   176k|                uint32_t offset = *(key_value_list + i);
  177|       |
  178|   176k|                if (BAD_STRUCT(KeyValue, offset, bcd_len))
  ------------------
  |  |  100|   176k|        ((uint64_t) (offset) + sizeof(type) >= (max))
  |  |  ------------------
  |  |  |  Branch (100:9): [True: 110k, False: 66.0k]
  |  |  ------------------
  ------------------
  179|   110k|                        continue;
  180|       |
  181|  66.0k|                const KeyValue *kv = (const KeyValue *) (bcd + offset);
  182|  66.0k|                if (kv->sig != SIG_KEY_VALUE)
  ------------------
  |  Branch (182:21): [True: 46.0k, False: 19.9k]
  ------------------
  183|  46.0k|                        continue;
  184|       |
  185|  19.9k|                if (BAD_ARRAY(KeyValue, name, offset, kv->name_len, bcd_len))
  ------------------
  |  |  103|  19.9k|        ((uint64_t) (offset) + offsetof(type, array) + \
  |  |  ------------------
  |  |  |  Branch (103:9): [True: 4.49k, False: 15.4k]
  |  |  ------------------
  |  |  104|  19.9k|         sizeof((type){}.array[0]) * (uint64_t) (array_len) >= (max))
  ------------------
  186|  4.49k|                        continue;
  187|       |
  188|       |                /* If most significant bit is set, data is stored in data_offset itself, but
  189|       |                 * we are only interested in UTF16 strings. The only strings that could fit
  190|       |                 * would have just one char in it, so let's not bother with this. */
  191|  15.4k|                if (FLAGS_SET(kv->data_size, UINT32_C(1) << 31))
  ------------------
  |  |  414|  15.4k|        ((~(v) & (flags)) == 0)
  |  |  ------------------
  |  |  |  Branch (414:9): [True: 810, False: 14.6k]
  |  |  ------------------
  ------------------
  192|    810|                        continue;
  193|       |
  194|  14.6k|                if (BAD_OFFSET(kv->data_offset, kv->data_size, bcd_len))
  ------------------
  |  |   97|  14.6k|        ((uint64_t) (offset) + (len) >= (max))
  |  |  ------------------
  |  |  |  Branch (97:9): [True: 2.12k, False: 12.4k]
  |  |  ------------------
  ------------------
  195|  2.12k|                        continue;
  196|       |
  197|  12.4k|                if (strncaseeq8(name, kv->name, kv->name_len) && strlen8(name) == kv->name_len)
  ------------------
  |  Branch (197:21): [True: 8.50k, False: 3.98k]
  |  Branch (197:66): [True: 345, False: 8.15k]
  ------------------
  198|    345|                        return kv;
  199|  12.4k|        }
  200|       |
  201|    121|        return NULL;
  202|    466|}

strnlen8:
   23|  12.5k|        size_t name(const type *s, size_t n) { \
   24|  12.5k|                if (!s)                        \
  ------------------
  |  Branch (24:21): [True: 0, False: 12.5k]
  ------------------
   25|  12.5k|                        return 0;              \
   26|  12.5k|                                               \
   27|  12.5k|                size_t len = 0;                \
   28|   129k|                while (len < n && *s) {        \
  ------------------
  |  Branch (28:24): [True: 129k, False: 0]
  |  Branch (28:35): [True: 117k, False: 12.5k]
  ------------------
   29|   117k|                        s++;                   \
   30|   117k|                        len++;                 \
   31|   117k|                }                              \
   32|  12.5k|                                               \
   33|  12.5k|                return len;                    \
   34|  12.5k|        }
strncasecmp8:
   58|   136k|        int name(const type *s1, const type *s2, size_t n) { \
   59|   136k|                if (!s1 || !s2)                              \
  ------------------
  |  Branch (59:21): [True: 0, False: 136k]
  |  Branch (59:28): [True: 0, False: 136k]
  ------------------
   60|   136k|                        return CMP(s1, s2);                  \
  ------------------
  |  |  288|      0|#define CMP(a, b) __CMP(UNIQ, (a), UNIQ, (b))
  |  |  ------------------
  |  |  |  |  290|      0|        ({                                              \
  |  |  |  |  291|      0|                const typeof(a) UNIQ_T(A, aq) = (a);    \
  |  |  |  |  292|      0|                const typeof(b) UNIQ_T(B, bq) = (b);    \
  |  |  |  |  293|      0|                UNIQ_T(A, aq) < UNIQ_T(B, bq) ? -1 :    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|      0|#define UNIQ_T(x, uniq) CONCATENATE(__unique_prefix_, CONCATENATE(x, uniq))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|      0|#define CONCATENATE(x, y) XCONCATENATE(x, y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|      0|#define XCONCATENATE(x, y) x ## y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                               UNIQ_T(A, aq) < UNIQ_T(B, bq) ? -1 :    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|      0|#define UNIQ_T(x, uniq) CONCATENATE(__unique_prefix_, CONCATENATE(x, uniq))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|      0|#define CONCATENATE(x, y) XCONCATENATE(x, y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|      0|#define XCONCATENATE(x, y) x ## y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (293:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  294|      0|                UNIQ_T(A, aq) > UNIQ_T(B, bq) ? 1 : 0;  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|      0|#define UNIQ_T(x, uniq) CONCATENATE(__unique_prefix_, CONCATENATE(x, uniq))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|      0|#define CONCATENATE(x, y) XCONCATENATE(x, y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|      0|#define XCONCATENATE(x, y) x ## y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                               UNIQ_T(A, aq) > UNIQ_T(B, bq) ? 1 : 0;  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|      0|#define UNIQ_T(x, uniq) CONCATENATE(__unique_prefix_, CONCATENATE(x, uniq))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|      0|#define CONCATENATE(x, y) XCONCATENATE(x, y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|      0|#define XCONCATENATE(x, y) x ## y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  295|      0|        })
  |  |  ------------------
  ------------------
   61|   136k|                                                             \
   62|   277k|                while (n > 0) {                              \
  ------------------
  |  Branch (62:24): [True: 266k, False: 11.0k]
  ------------------
   63|   266k|                        type c1 = *s1, c2 = *s2;             \
   64|   266k|                        if (tolower) {                       \
  ------------------
  |  Branch (64:29): [Folded - Ignored]
  ------------------
   65|   266k|                                c1 = TOLOWER(c1);            \
  ------------------
  |  |   40|   266k|        ({                                                        \
  |  |   41|   266k|                typeof(c) _c = (c);                               \
  |  |   42|   266k|                (_c >= 'A' && _c <= 'Z') ? _c + ('a' - 'A') : _c; \
  |  |  ------------------
  |  |  |  Branch (42:18): [True: 210k, False: 55.7k]
  |  |  |  Branch (42:31): [True: 74.7k, False: 136k]
  |  |  ------------------
  |  |   43|   266k|        })
  ------------------
   66|   266k|                                c2 = TOLOWER(c2);            \
  ------------------
  |  |   40|   266k|        ({                                                        \
  |  |   41|   266k|                typeof(c) _c = (c);                               \
  |  |   42|   266k|                (_c >= 'A' && _c <= 'Z') ? _c + ('a' - 'A') : _c; \
  |  |  ------------------
  |  |  |  Branch (42:18): [True: 146k, False: 119k]
  |  |  |  Branch (42:31): [True: 25.5k, False: 121k]
  |  |  ------------------
  |  |   43|   266k|        })
  ------------------
   67|   266k|                        }                                    \
   68|   266k|                        if (!c1 || c1 != c2)                 \
  ------------------
  |  Branch (68:29): [True: 7.59k, False: 258k]
  |  Branch (68:36): [True: 118k, False: 140k]
  ------------------
   69|   266k|                                return CMP(c1, c2);          \
  ------------------
  |  |  288|   125k|#define CMP(a, b) __CMP(UNIQ, (a), UNIQ, (b))
  |  |  ------------------
  |  |  |  |  290|   125k|        ({                                              \
  |  |  |  |  291|   125k|                const typeof(a) UNIQ_T(A, aq) = (a);    \
  |  |  |  |  292|   125k|                const typeof(b) UNIQ_T(B, bq) = (b);    \
  |  |  |  |  293|   125k|                UNIQ_T(A, aq) < UNIQ_T(B, bq) ? -1 :    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   125k|#define UNIQ_T(x, uniq) CONCATENATE(__unique_prefix_, CONCATENATE(x, uniq))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|   125k|#define CONCATENATE(x, y) XCONCATENATE(x, y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|   125k|#define XCONCATENATE(x, y) x ## y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                               UNIQ_T(A, aq) < UNIQ_T(B, bq) ? -1 :    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   125k|#define UNIQ_T(x, uniq) CONCATENATE(__unique_prefix_, CONCATENATE(x, uniq))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|   125k|#define CONCATENATE(x, y) XCONCATENATE(x, y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|   125k|#define XCONCATENATE(x, y) x ## y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (293:17): [True: 21.8k, False: 103k]
  |  |  |  |  ------------------
  |  |  |  |  294|   125k|                UNIQ_T(A, aq) > UNIQ_T(B, bq) ? 1 : 0;  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   103k|#define UNIQ_T(x, uniq) CONCATENATE(__unique_prefix_, CONCATENATE(x, uniq))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|   103k|#define CONCATENATE(x, y) XCONCATENATE(x, y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|   103k|#define XCONCATENATE(x, y) x ## y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                               UNIQ_T(A, aq) > UNIQ_T(B, bq) ? 1 : 0;  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   103k|#define UNIQ_T(x, uniq) CONCATENATE(__unique_prefix_, CONCATENATE(x, uniq))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|   103k|#define CONCATENATE(x, y) XCONCATENATE(x, y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|   103k|#define XCONCATENATE(x, y) x ## y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:17): [True: 96.4k, False: 7.51k]
  |  |  |  |  ------------------
  |  |  |  |  295|   125k|        })
  |  |  ------------------
  ------------------
   70|   266k|                                                             \
   71|   266k|                        s1++;                                \
   72|   140k|                        s2++;                                \
   73|   140k|                        n--;                                 \
   74|   140k|                }                                            \
   75|   136k|                                                             \
   76|   136k|                return 0;                                    \
   77|   136k|        }

bcd.c:strncaseeq8:
   65|   136k|static inline int strncaseeq8(const char *s1, const char *s2, size_t n) {
   66|   136k|        return strncasecmp8(s1, s2, n) == 0;
   67|   136k|}
bcd.c:strlen8:
    9|  12.5k|static inline size_t strlen8(const char *s) {
   10|  12.5k|        return strnlen8(s, SIZE_MAX);
   11|  12.5k|}

LLVMFuzzerTestOneInput:
    8|  1.20k|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
    9|  1.20k|        _cleanup_free_ void *p = NULL;
  ------------------
  |  |   82|  1.20k|#define _cleanup_free_ _cleanup_(freep)
  |  |  ------------------
  |  |  |  |   78|  1.20k|#define _cleanup_(x) __attribute__((__cleanup__(x)))
  |  |  ------------------
  ------------------
   10|       |
   11|       |        /* This limit was borrowed from src/boot/efi/boot.c */
   12|  1.20k|        if (outside_size_range(size, 0, 100*1024))
  ------------------
  |  Branch (12:13): [True: 4, False: 1.20k]
  ------------------
   13|      4|                return 0;
   14|       |
   15|  1.20k|        fuzz_setup_logging();
   16|       |
   17|  1.20k|        p = memdup(data, size);
   18|  1.20k|        assert_se(p);
  ------------------
  |  |   65|  1.20k|#define assert_se(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|  1.20k|        do {                                                            \
  |  |  |  |   59|  1.20k|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  1.20k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 1.20k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|  1.20k|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|  1.20k|        } while (false)
  |  |  ------------------
  ------------------
   19|       |
   20|  1.20k|        char16_t *title = get_bcd_title(p, size);
   21|       |        /* If we get something, it must be NUL-terminated, but an empty string is still valid! */
   22|  1.20k|        DO_NOT_OPTIMIZE(title && char16_strlen(title));
  ------------------
  |  |   41|  1.23k|#define DO_NOT_OPTIMIZE(value) ({ asm volatile("" : : "g"(value) : "memory"); })
  |  |  ------------------
  |  |  |  Branch (41:59): [True: 34, False: 1.16k]
  |  |  |  Branch (41:59): [True: 31, False: 3]
  |  |  ------------------
  ------------------
   23|  1.20k|        return 0;
   24|  1.20k|}

fuzz-bcd.c:outside_size_range:
   24|  1.20k|static inline bool outside_size_range(size_t size, size_t lower, size_t upper) {
   25|  1.20k|        if (size < lower)
  ------------------
  |  Branch (25:13): [True: 0, False: 1.20k]
  ------------------
   26|      0|                return true;
   27|  1.20k|        if (size > upper)
  ------------------
  |  Branch (27:13): [True: 4, False: 1.20k]
  ------------------
   28|      4|                return FUZZ_USE_SIZE_LIMIT;
  ------------------
  |  |  262|      4|#define FUZZ_USE_SIZE_LIMIT 1
  ------------------
   29|  1.20k|        return false;
   30|  1.20k|}
fuzz-bcd.c:fuzz_setup_logging:
   32|  1.20k|static inline void fuzz_setup_logging(void) {
   33|       |        /* We don't want to fill the logs and slow down stuff when running
   34|       |         * in a fuzzing mode, so disable most of the logging. */
   35|  1.20k|        log_set_assert_return_is_critical(true);
   36|  1.20k|        log_set_max_level(LOG_CRIT);
   37|  1.20k|        log_setup();
   38|  1.20k|}

