{"$schema": "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json",
 "version": "2.1.0",
 "runs": [{"tool": {"driver": {"name": "GNU C23",
                               "fullName": "GNU C23 (GCC) version 16.1.1 20260703 (Red Hat 16.1.1-4) (x86_64-redhat-linux)",
                               "version": "16.1.1 20260703 (Red Hat 16.1.1-4)",
                               "informationUri": "https://gcc.gnu.org/gcc-16/",
                               "rules": [{"id": "-Wanalyzer-use-of-uninitialized-value",
                                          "helpUri": "https://gcc.gnu.org/onlinedocs/gcc-16.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-use-of-uninitialized-value"}]}},
           "taxonomies": [{"name": "CWE",
                           "version": "4.7",
                           "organization": "MITRE",
                           "shortDescription": {"text": "The MITRE Common Weakness Enumeration"},
                           "taxa": [{"id": "457",
                                     "helpUri": "https://cwe.mitre.org/data/definitions/457.html"}]}],
           "invocations": [{"arguments": ["/usr/libexec/gcc/x86_64-redhat-linux/16/cc1",
                                          "-quiet",
                                          "-I",
                                          ".",
                                          "-D",
                                          "PACKAGE_NAME=\"libbytesize\"",
                                          "-D",
                                          "PACKAGE_TARNAME=\"libbytesize\"",
                                          "-D",
                                          "PACKAGE_VERSION=\"2.12\"",
                                          "-D",
                                          "PACKAGE_STRING=\"libbytesize 2.12\"",
                                          "-D",
                                          "PACKAGE_BUGREPORT=\"\"",
                                          "-D",
                                          "PACKAGE_URL=\"https://github.com/storaged-project/libbytesize\"",
                                          "-D",
                                          "PACKAGE=\"libbytesize\"",
                                          "-D",
                                          "VERSION=\"2.12\"",
                                          "-D",
                                          "HAVE_STDIO_H=1",
                                          "-D",
                                          "HAVE_STDLIB_H=1",
                                          "-D",
                                          "HAVE_STRING_H=1",
                                          "-D",
                                          "HAVE_INTTYPES_H=1",
                                          "-D",
                                          "HAVE_STDINT_H=1",
                                          "-D",
                                          "HAVE_STRINGS_H=1",
                                          "-D",
                                          "HAVE_SYS_STAT_H=1",
                                          "-D",
                                          "HAVE_SYS_TYPES_H=1",
                                          "-D",
                                          "HAVE_UNISTD_H=1",
                                          "-D",
                                          "STDC_HEADERS=1",
                                          "-D",
                                          "HAVE_DLFCN_H=1",
                                          "-D",
                                          "LT_OBJDIR=\".libs/\"",
                                          "-D",
                                          "HAVE_LIBGMP=1",
                                          "-D",
                                          "HAVE_LANGINFO_H=1",
                                          "-D",
                                          "HAVE_GMP_H=1",
                                          "-D",
                                          "HAVE_MPFR_H=1",
                                          "-D",
                                          "HAVE_STDINT_H=1",
                                          "-D",
                                          "HAVE_STDBOOL_H=1",
                                          "-D",
                                          "HAVE_STDARG_H=1",
                                          "-D",
                                          "HAVE_STRING_H=1",
                                          "-D",
                                          "HAVE_STDIO_H=1",
                                          "-D",
                                          "HAVE_CTYPE_H=1",
                                          "-D",
                                          "LOCALEDIR=\"/usr/share/locale\"",
                                          "-D",
                                          "DEFAULT_TEXT_DOMAIN=\"libbytesize\"",
                                          "-D",
                                          "_GNU_SOURCE",
                                          "-D",
                                          "ENABLE_NLS",
                                          "-D",
                                          "PIC",
                                          "bs_size.c",
                                          "-quiet",
                                          "-dumpbase",
                                          "bs_size.c",
                                          "-dumpbase-ext",
                                          ".c",
                                          "-m64",
                                          "-mtune=generic",
                                          "-march=x86-64",
                                          "-mtls-dialect=gnu2",
                                          "-O2",
                                          "-Wno-overflow",
                                          "-Wno-unknown-pragmas",
                                          "-flto=auto",
                                          "-ffat-lto-objects",
                                          "-fexceptions",
                                          "-fstack-protector-strong",
                                          "-fasynchronous-unwind-tables",
                                          "-fstack-clash-protection",
                                          "-fcf-protection=full",
                                          "-fno-omit-frame-pointer",
                                          "-fPIC",
                                          "-fanalyzer",
                                          "-fdiagnostics-path-format=separate-events",
                                          "-fno-diagnostics-show-caret",
                                          "-fno-lto",
                                          "-fanalyzer-assume-nothrow",
                                          "-fdiagnostics-text-art-charset=none",
                                          "-fdiagnostics-set-output=sarif:file=/builddir/gcc-results/2392-oCV8.sarif",
                                          "-o",
                                          "/tmp/ccZiegel.s"],
                            "workingDirectory": {"uri": "/builddir/build/BUILD/libbytesize-2.12-build/libbytesize-2.12/src"},
                            "startTimeUtc": "2026-08-03T17:02:11Z",
                            "executionSuccessful": true,
                            "toolExecutionNotifications": [],
                            "endTimeUtc": "2026-08-03T17:02:11Z"}],
           "originalUriBaseIds": {"PWD": {"uri": "file:///builddir/build/BUILD/libbytesize-2.12-build/libbytesize-2.12/src/"}},
           "artifacts": [{"location": {"uri": "bs_size.c",
                                       "uriBaseId": "PWD"},
                          "sourceLanguage": "c",
                          "contents": {"text": "#include <gmp.h>\n#include <mpfr.h>\n#include <langinfo.h>\n#include <stdarg.h>\n#include <stdio.h>\n#include <inttypes.h>\n#include <string.h>\n#include <ctype.h>\n#include <limits.h>\n\n/* set code unit width to 8 so we can use generic macros like 'pcre2_compile'\n * instead of 'pcre2_compile_8'\n */\n#define PCRE2_CODE_UNIT_WIDTH 8\n#include <pcre2.h>\n\n#include \"bs_size.h\"\n#include \"gettext.h\"\n\n#define  _(String) gettext (String)\n#define N_(String) String\n\n#define ERROR_BUFFER_LEN 256\n\n/**\n * SECTION: bs_size\n * @title: BSSize\n * @short_description: a class facilitating work with sizes in bytes\n * @include: bs_size.h\n *\n * #BSSize is a type that facilitates work with sizes in bytes by providing\n * functions/methods that are required for parsing users input when entering\n * size, showing size in nice human-readable format, storing sizes bigger than\n * UINT64_MAX and doing calculations with sizes without loss of\n * precision/information. The class is able to hold negative sizes and do\n * operations on/with them, but some of the (division and multiplication)\n * operations simply ignore the signs of the operands (check the documentation).\n *\n * The reason why some functions take or return a float as a string instead of a\n * float directly is because a string \"0.3\" can be translated into 0.3 with\n * appropriate precision while 0.3 as float is probably something like\n * 0.294343... with unknown precision.\n *\n */\n\n\n/***************\n * STATIC DATA *\n ***************/\nstatic char const * const b_units[BS_BUNIT_UNDEF] = {\n    /* TRANSLATORS: 'B' for bytes */\n    N_(\"B\"),\n    /* TRANSLATORS: abbreviation for kibibyte, 2**10 bytes */\n    N_(\"KiB\"),\n    /* TRANSLATORS: abbreviation for mebibyte, 2**20 bytes */\n    N_(\"MiB\"),\n    /* TRANSLATORS: abbreviation for gibibyte, 2**30 bytes */\n    N_(\"GiB\"),\n    /* TRANSLATORS: abbreviation for tebibyte, 2**40 bytes */\n    N_(\"TiB\"),\n    /* TRANSLATORS: abbreviation for pebibyte, 2**50 bytes */\n    N_(\"PiB\"),\n    /* TRANSLATORS: abbreviation for exbibyte, 2**60 bytes */\n    N_(\"EiB\"),\n    /* TRANSLATORS: abbreviation for zebibyte, 2**70 bytes */\n    N_(\"ZiB\"),\n    /* TRANSLATORS: abbreviation for yobibyte, 2**80 bytes */\n    N_(\"YiB\")\n};\n\nstatic char const * const d_units[BS_DUNIT_UNDEF] = {\n    /* TRANSLATORS: 'B' for bytes */\n    N_(\"B\"),\n    /* TRANSLATORS: abbreviation for kilobyte, 10**3 bytes */\n    N_(\"KB\"),\n    /* TRANSLATORS: abbreviation for megabyte, 10**6 bytes */\n    N_(\"MB\"),\n    /* TRANSLATORS: abbreviation for gigabyte, 10**9 bytes */\n    N_(\"GB\"),\n    /* TRANSLATORS: abbreviation for terabyte, 10**12 bytes */\n    N_(\"TB\"),\n    /* TRANSLATORS: abbreviation for petabyte, 10**15 bytes */\n    N_(\"PB\"),\n    /* TRANSLATORS: abbreviation for exabyte, 10**18 bytes */\n    N_(\"EB\"),\n    /* TRANSLATORS: abbreviation for zettabyte, 10**21 bytes */\n    N_(\"ZB\"),\n    /* TRANSLATORS: abbreviation for yottabyte, 10**24 bytes */\n    N_(\"YB\")\n};\n\n\n/****************************\n * STRUCT DEFINITIONS       *\n ****************************/\n/**\n * BSSize:\n *\n * The BSSize struct contains only private fields and should not be directly\n * accessed.\n */\nstruct _BSSize {\n    mpz_t bytes;\n};\n\n\n/********************\n * HELPER FUNCTIONS *\n ********************/\nstatic void bs_size_init (BSSize size) {\n    /* let's start with 64 bits of space */\n    mpz_init2 (size->bytes, (mp_bitcnt_t) 64);\n}\n\nstatic char *strdup_printf (const char *fmt, ...) {\n    int num = 0;\n    char *ret = NULL;\n    va_list ap;\n    va_start (ap, fmt);\n    num = vasprintf (&ret, fmt, ap);\n    va_end (ap);\n    if (num <= 0)\n        /* make sure we return NULL on error */\n        ret = NULL;\n    return ret;\n}\n\n/**\n * replace_char_with_str: (skip)\n *\n * Replaces all appearances of @char in @str with @new.\n */\nstatic char *replace_char_with_str (const char *str, char orig, const char *new) {\n    uint64_t offset = 0;\n    uint64_t i = 0;\n    uint64_t j = 0;\n    char *ret = NULL;\n    const char *next = NULL;\n    uint64_t count = 0;\n\n    if (!str)\n        return NULL;\n\n    next = str;\n    for (next=strchr (next, orig); next; count++, next=strchr (++next, orig));\n\n    /* allocate space for the string [strlen(str)] with the char replaced by the\n       string [strlen(new) - 1] $count times and a \\0 byte at the end [ + 1] */\n    ret = malloc (sizeof(char) * (strlen(str) + (strlen(new) - 1) * count + 1));\n    if (!ret)\n        return NULL;\n\n    for (i=0; str[i]; i++) {\n        if (str[i] == orig)\n            for (j=0; new[j]; j++) {\n                ret[i+offset] = new[j];\n                if (new[j+1])\n                    /* something more to copy over */\n                    offset++;\n            }\n        else\n            ret[i+offset] = str[i];\n    }\n    ret[i+offset] = '\\0';\n\n    return ret;\n}\n\n\n/**\n * replace_str_with_str: (skip)\n *\n * Replaces the first appearance of @orig in @str with @new.\n */\nstatic char *replace_str_with_str (const char *str, const char *orig, const char *new) {\n    const char *pos = NULL;\n    int str_len = 0;\n    int orig_len = 0;\n    int new_len = 0;\n    char *ret = NULL;\n    int ret_size = 0;\n    char *dest = NULL;\n\n    pos = strstr (str, orig);\n    if (!pos)\n        /* nothing to do, just return a copy */\n        return strdup (str);\n\n    str_len = strlen (str);\n    orig_len = strlen (orig);\n    new_len = strlen (new);\n    ret_size = str_len + new_len - orig_len + 1;\n    ret = malloc (sizeof(char) * ret_size);\n    if (!ret)\n        return NULL;\n    memset (ret, 0, ret_size);\n    memcpy (ret, str, pos - str);\n    dest = ret + (pos - str);\n    memcpy (dest, new, new_len);\n    dest = dest + new_len;\n    memcpy (dest, pos + orig_len, str_len - (pos - str) - orig_len);\n\n    return ret;\n}\n\n/**\n * strstrip: (skip)\n *\n * Strips leading and trailing whitespace from the string (**IN-PLACE**)\n */\nstatic void strstrip(char *str) {\n    int i = 0;\n    int begin = 0;\n    int end = strlen(str) - 1;\n\n    while (isspace(str[begin]))\n        begin++;\n    while ((end >= begin) && isspace(str[end]))\n        end--;\n\n    for (i=begin; i <= end; i++)\n        str[i - begin] = str[i];\n\n    str[i-begin] = '\\0';\n}\n\nstatic bool multiply_size_by_unit (mpfr_t size, char *unit_str) {\n    BSBunit bunit = BS_BUNIT_UNDEF;\n    BSDunit dunit = BS_DUNIT_UNDEF;\n    uint64_t pwr = 0;\n    mpfr_t dec_mul;\n    size_t unit_str_len = 0;\n\n    unit_str_len = strlen (unit_str);\n\n    for (bunit=BS_BUNIT_B; bunit < BS_BUNIT_UNDEF; bunit++)\n        if (strncasecmp (unit_str, b_units[bunit-BS_BUNIT_B], unit_str_len) == 0) {\n            pwr = (uint64_t) bunit - BS_BUNIT_B;\n            mpfr_mul_2exp (size, size, 10 * pwr, MPFR_RNDN);\n            return true;\n        }\n\n    mpfr_init2 (dec_mul, BS_FLOAT_PREC_BITS);\n    mpfr_set_ui (dec_mul, 1000, MPFR_RNDN);\n    for (dunit=BS_DUNIT_B; dunit < BS_DUNIT_UNDEF; dunit++)\n        if (strncasecmp (unit_str, d_units[dunit-BS_DUNIT_B], unit_str_len) == 0) {\n            pwr = (uint64_t) (dunit - BS_DUNIT_B);\n            mpfr_pow_ui (dec_mul, dec_mul, pwr, MPFR_RNDN);\n            mpfr_mul (size, size, dec_mul, MPFR_RNDN);\n            mpfr_clear (dec_mul);\n            return true;\n        }\n\n    /* not found among the binary and decimal units, let's try their translated\n       versions */\n    for (bunit=BS_BUNIT_B; bunit < BS_BUNIT_UNDEF; bunit++)\n        if (strncasecmp (unit_str, _(b_units[bunit-BS_BUNIT_B]), unit_str_len) == 0) {\n            pwr = (uint64_t) bunit - BS_BUNIT_B;\n            mpfr_mul_2exp (size, size, 10 * pwr, MPFR_RNDN);\n            return true;\n        }\n\n    mpfr_init2 (dec_mul, BS_FLOAT_PREC_BITS);\n    mpfr_set_ui (dec_mul, 1000, MPFR_RNDN);\n    for (dunit=BS_DUNIT_B; dunit < BS_DUNIT_UNDEF; dunit++)\n        if (strncasecmp (unit_str, _(d_units[dunit-BS_DUNIT_B]), unit_str_len) == 0) {\n            pwr = (uint64_t) (dunit - BS_DUNIT_B);\n            mpfr_pow_ui (dec_mul, dec_mul, pwr, MPFR_RNDN);\n            mpfr_mul (size, size, dec_mul, MPFR_RNDN);\n            mpfr_clear (dec_mul);\n            return true;\n        }\n\n    return false;\n}\n\n/**\n * set_error: (skip)\n *\n * Sets @error to @code and @msg (if not %NULL). **TAKES OVER @msg.**\n */\nstatic void set_error (BSError **error, BSErrorCode code, char *msg) {\n    if (error == NULL) {\n        free (msg);\n        return;\n    }\n\n    *error = (BSError *) malloc (sizeof(BSError));\n    if (*error == NULL) {\n        free (msg);\n        return;\n    }\n    (*error)->code = code;\n    (*error)->msg = msg;\n    return;\n}\n\ntypedef void (*MpzOp) (mpz_t ROP, const mpz_t OP1, unsigned long int OP2);\nstatic void do_64bit_add_sub (MpzOp op, mpz_t rop, const mpz_t op1, uint64_t op2) {\n    uint64_t i = 0;\n    uint64_t div = 0;\n    uint64_t mod = 0;\n\n    /* small enough to just work */\n    if (op2 < (uint64_t) ULONG_MAX) {\n        op (rop, op1, (unsigned long int) op2);\n        return;\n    }\n\n    mpz_set (rop, op1);\n    div = op2 / (uint64_t) ULONG_MAX;\n    mod = op2 % (uint64_t) ULONG_MAX;\n    for (i=0; i < div; i++)\n        op (rop, rop, (unsigned long int) ULONG_MAX);\n    op (rop, rop, (unsigned long int) mod);\n}\n\nstatic void mul_64bit (mpz_t rop, const mpz_t op1, uint64_t op2) {\n    uint64_t i = 0;\n    uint64_t div = 0;\n    uint64_t mod = 0;\n    mpz_t aux;\n    mpz_t res;\n\n    /* small enough to just work */\n    if (op2 < (uint64_t) ULONG_MAX) {\n        mpz_mul_ui (rop, op1, (unsigned long int) op2);\n        return;\n    }\n\n    mpz_init2 (aux, (mp_bitcnt_t) 64);\n    mpz_init2 (res, (mp_bitcnt_t) 64);\n\n    mpz_set_ui (res, 0);\n    div = op2 / (uint64_t) ULONG_MAX;\n    mod = op2 % (uint64_t) ULONG_MAX;\n    for (i=0; i < div; i++) {\n        mpz_mul_ui (aux, op1, (unsigned long int) ULONG_MAX);\n        mpz_add (res, res, aux);\n    }\n    mpz_mul_ui (aux, op1, (unsigned long int) mod);\n    mpz_add (res, res, aux);\n\n    mpz_set (rop, res);\n    mpz_clear (aux);\n    mpz_clear (res);\n}\n\n\n\n/***************\n * DESTRUCTORS *\n * *************/\n/**\n * bs_size_free:\n * @size: (nullable): %BSSize to free\n *\n * Clears @size and frees the allocated resources.\n */\nvoid bs_size_free (BSSize size) {\n    if (size) {\n        mpz_clear (size->bytes);\n        free (size);\n    }\n    return;\n}\n\n/**\n * bs_clear_error:\n * @error: (nullable): %BSError to clear\n *\n * Clears @error and frees the allocated resources.\n */\nvoid bs_clear_error (BSError **error) {\n    if (error && *error) {\n        free ((*error)->msg);\n        free (*error);\n        *error = NULL;\n    }\n    return;\n}\n\n\n/****************\n * CONSTRUCTORS *\n ****************/\n/**\n * bs_size_new: (constructor)\n *\n * Creates a new #BSSize instance initialized to 0.\n *\n * Returns: a new #BSSize initialized to 0.\n */\nBSSize bs_size_new (void) {\n    BSSize ret = (BSSize) malloc (sizeof(struct _BSSize));\n    bs_size_init (ret);\n    return ret;\n}\n\n/**\n * bs_size_new_from_bytes: (constructor)\n * @bytes: number of bytes\n * @sgn: sign of the size -- if being -1, the size is initialized to\n *       -@bytes, other values are ignored\n *\n * Creates a new #BSSize instance.\n *\n * Returns: a new #BSSize\n */\nBSSize bs_size_new_from_bytes (uint64_t bytes, int sgn) {\n    char *num_str = NULL;\n    BSSize ret = bs_size_new ();\n    int ok = 0;\n\n    ok = asprintf (&num_str, \"%\"PRIu64, bytes);\n    if (ok == -1)\n        /* probably cannot allocate memory, there's nothing more we can do */\n        return ret;\n    mpz_set_str (ret->bytes, num_str, 10);\n    free (num_str);\n    if (sgn == -1)\n        mpz_neg (ret->bytes, ret->bytes);\n    return ret;\n}\n\n\n/**\n * bs_size_new_from_str: (constructor)\n * @size_str: string representing the size as a number and an optional unit\n *            (e.g. \"1 GiB\")\n * @error: (out) (optional): place to store error (if any)\n *\n * Creates a new #BSSize instance.\n *\n * Returns: a new #BSSize\n */\nBSSize bs_size_new_from_str (const char *size_str, BSError **error) {\n    char const * const pattern = \"^\\\\s*         # white space \\n\" \\\n                                  \"(?P<numeric>  # the numeric part consists of three parts, below \\n\" \\\n                                  \" (-|\\\\+)?     # optional sign character \\n\" \\\n                                  \" (?P<base>([0-9\\\\.%s]+))       # base \\n\" \\\n                                  \" (?P<exp>(e|E)(-|\\\\+)?[0-9]+)?) # exponent \\n\" \\\n                                  \"\\\\s*               # white space \\n\" \\\n                                  \"(?P<rest>[^\\\\s]*)\\\\s*$ # unit specification\";\n    char *real_pattern = NULL;\n    pcre2_code *regex = NULL;\n    int errorcode = 0;\n    PCRE2_SIZE erroffset;\n    int str_len = 0;\n    pcre2_match_data *match_data = NULL;\n    int str_count = 0;\n    const char *radix_char = NULL;\n    char *loc_size_str = NULL;\n    mpf_t parsed_size;\n    mpfr_t size;\n    int status = 0;\n    BSSize ret = NULL;\n    PCRE2_UCHAR *substring = NULL;\n    PCRE2_SIZE substring_len = 0;\n    PCRE2_UCHAR error_buffer[ERROR_BUFFER_LEN];\n\n    radix_char = nl_langinfo (RADIXCHAR);\n    if (strncmp (radix_char, \".\", 1) != 0)\n        real_pattern = strdup_printf (pattern, radix_char);\n    else\n        real_pattern = strdup_printf (pattern, \"\");\n\n    regex = pcre2_compile ((PCRE2_SPTR) real_pattern, PCRE2_ZERO_TERMINATED, PCRE2_EXTENDED, &errorcode, &erroffset, NULL);\n    free (real_pattern);\n    if (!regex) {\n        status = pcre2_get_error_message (errorcode, error_buffer, ERROR_BUFFER_LEN);\n        switch (status) {\n            case PCRE2_ERROR_BADDATA:\n                /* unknown/invalid error code */\n                set_error (error, BS_ERROR_INVALID_SPEC,\n                           strdup_printf (\"Failed to compile pattern at offset %d: Unknown error.\", erroffset));\n                break;\n            case PCRE2_ERROR_NOMEMORY:\n                /* error buffer is too short */\n                set_error (error, BS_ERROR_INVALID_SPEC,\n                           strdup_printf (\"Failed to compile pattern at offset %d: %s (truncated)\", erroffset, error_buffer));\n                break;\n\n            default:\n                set_error (error, BS_ERROR_INVALID_SPEC,\n                           strdup_printf (\"Failed to compile pattern at offset %d: %s\", erroffset, error_buffer));\n                break;\n        }\n        return NULL;\n    }\n\n    loc_size_str = replace_char_with_str (size_str, '.', radix_char);\n    if (!loc_size_str) {\n        set_error (error, BS_ERROR_INVALID_SPEC, strdup_printf (\"Failed to parse size spec: %s\", size_str));\n        pcre2_code_free (regex);\n        return NULL;\n    }\n    str_len = strlen (loc_size_str);\n\n    match_data = pcre2_match_data_create_from_pattern (regex, NULL);\n\n    str_count = pcre2_match (regex, (PCRE2_SPTR) loc_size_str, str_len,\n                             0, 0, match_data, NULL);\n    if (str_count < 0) {\n        set_error (error, BS_ERROR_INVALID_SPEC, strdup_printf (\"Failed to parse size spec: %s\", size_str));\n        pcre2_match_data_free (match_data);\n        pcre2_code_free (regex);\n        free (loc_size_str);\n        return NULL;\n    }\n\n    status = pcre2_substring_get_byname (match_data, (PCRE2_SPTR) \"numeric\", &substring, &substring_len);\n    if (status < 0 || substring_len < 1) {\n        set_error (error, BS_ERROR_INVALID_SPEC, strdup_printf (\"Failed to parse size spec: %s\", size_str));\n        pcre2_match_data_free (match_data);\n        pcre2_code_free (regex);\n        free (loc_size_str);\n        return NULL;\n    }\n\n    /* parse the number using GMP because it knows how to handle localization\n       much better than MPFR */\n    mpf_init2 (parsed_size, BS_FLOAT_PREC_BITS);\n    status = mpf_set_str (parsed_size, *substring == '+' ? (const char *) substring+1 : (const char *) substring, 10);\n    pcre2_substring_free (substring);\n    if (status != 0) {\n        set_error (error, BS_ERROR_INVALID_SPEC, strdup_printf (\"Failed to parse size spec: %s\", size_str));\n        pcre2_match_data_free (match_data);\n        pcre2_code_free (regex);\n        free (loc_size_str);\n        mpf_clear (parsed_size);\n        return NULL;\n    }\n    /* but use MPFR from now on because GMP thinks 0.1*1000 = 99 */\n    mpfr_init2 (size, BS_FLOAT_PREC_BITS);\n    mpfr_set_f (size, parsed_size, MPFR_RNDN);\n    mpf_clear (parsed_size);\n\n    status = pcre2_substring_get_byname (match_data, (PCRE2_SPTR) \"rest\", &substring, &substring_len);\n    if ((status >= 0) && strncmp ((const char *) substring, \"\", 1) != 0) {\n        strstrip ((char *) substring);\n        if (!multiply_size_by_unit (size, (char *) substring)) {\n            set_error (error, BS_ERROR_INVALID_SPEC, strdup_printf (\"Failed to recognize unit from the spec: %s\", size_str));\n            pcre2_substring_free (substring);\n            pcre2_match_data_free (match_data);\n            pcre2_code_free (regex);\n            free (loc_size_str);\n            mpfr_clear (size);\n            return NULL;\n        }\n    }\n    pcre2_substring_free (substring);\n    pcre2_match_data_free (match_data);\n    pcre2_code_free (regex);\n\n    ret = bs_size_new ();\n    mpfr_get_z (ret->bytes, size, MPFR_RNDZ);\n\n    free (loc_size_str);\n    mpfr_clear (size);\n\n    return ret;\n}\n\n/**\n * bs_size_new_from_size: (constructor)\n * @size: the size to create a new instance from (a copy of)\n *\n * Creates a new instance of #BSSize.\n *\n * Returns: (transfer full): a new #BSSize instance which is copy of @size.\n */\nBSSize bs_size_new_from_size (const BSSize size) {\n    BSSize ret = NULL;\n\n    ret = bs_size_new ();\n    mpz_set (ret->bytes, size->bytes);\n\n    return ret;\n}\n\n\n/*****************\n * QUERY METHODS *\n *****************/\n/**\n * bs_size_get_bytes:\n * @sgn: (out) (optional): sign of the @size - -1, 0 or 1 for negative, zero or positive\n *                         size respectively\n * @error: (out) (optional): place to store error (if any)\n *\n * Get the number of bytes of the @size.\n *\n * Returns: the @size in a number of bytes\n */\nuint64_t bs_size_get_bytes (const BSSize size, int *sgn, BSError **error) {\n    char *num_str = NULL;\n    mpz_t max;\n    uint64_t ret = 0;\n    int ok = 0;\n\n    mpz_init2 (max, (mp_bitcnt_t) 64);\n    ok = asprintf (&num_str, \"%\"PRIu64, UINT64_MAX);\n    if (ok == -1) {\n        /* we probably cannot allocate memory so we are doomed */\n        set_error (error, BS_ERROR_FAIL, strdup(\"Failed to allocate memory\"));\n        mpz_clear (max);\n        return 0;\n    }\n    mpz_set_str (max, num_str, 10);\n    free (num_str);\n    if (mpz_cmp (size->bytes, max) > 0) {\n        set_error (error, BS_ERROR_OVER, strdup(\"The size is too big, cannot be returned as a 64bit number of bytes\"));\n        return 0;\n    }\n    mpz_clear (max);\n    if (sgn)\n        *sgn = mpz_sgn (size->bytes);\n    if (mpz_cmp_ui (size->bytes, UINT64_MAX) <= 0)\n        return (uint64_t) mpz_get_ui (size->bytes);\n    else {\n        num_str = bs_size_get_bytes_str (size);\n        ret = strtoull (num_str, NULL, 10);\n        free (num_str);\n        return ret;\n    }\n}\n\n/**\n * bs_size_sgn:\n *\n * Get the sign of the size.\n *\n * Returns: -1, 0 or 1 if @size is negative, zero or positive, respectively\n */\nint bs_size_sgn (const BSSize size) {\n    return mpz_sgn (size->bytes);\n}\n\n/**\n * bs_size_get_bytes_str:\n *\n * Get the number of bytes in @size as a string. This way, the caller doesn't\n * have to care about the limitations of some particular integer type.\n *\n * Returns: (transfer full): the string representing the @size as a number of bytes.\n */\nchar* bs_size_get_bytes_str (const BSSize size) {\n    return mpz_get_str (NULL, 10, size->bytes);\n}\n\n/**\n * bs_size_convert_to:\n * @unit: the unit to convert @size to\n * @error: (out) (optional): place to store error (if any)\n *\n * Get the @size converted to @unit as a string representing a floating-point\n * number.\n *\n * Returns: (transfer full): a string representing the floating-point number\n *                           that equals to @size converted to @unit\n */\nchar* bs_size_convert_to (const BSSize size, BSUnit unit, BSError **error) {\n    BSBunit b_unit = BS_BUNIT_B;\n    BSDunit d_unit = BS_DUNIT_B;\n    mpf_t divisor;\n    mpf_t result;\n    bool found_match = false;\n    char *ret = NULL;\n\n    mpf_init2 (divisor, BS_FLOAT_PREC_BITS);\n    for (b_unit = BS_BUNIT_B; !found_match && b_unit != BS_BUNIT_UNDEF; b_unit++) {\n        if (unit.bunit == b_unit) {\n            found_match = true;\n            mpf_set_ui (divisor, 1);\n            mpf_mul_2exp (divisor, divisor, 10 * (b_unit - BS_BUNIT_B));\n        }\n    }\n\n    for (d_unit = BS_DUNIT_B; !found_match && d_unit != BS_DUNIT_UNDEF; d_unit++) {\n        if (unit.dunit == d_unit) {\n            found_match = true;\n            mpf_set_ui (divisor, 1000);\n            mpf_pow_ui (divisor, divisor, (d_unit - BS_DUNIT_B));\n        }\n    }\n\n    if (!found_match) {\n        set_error (error, BS_ERROR_INVALID_SPEC, strdup (\"Invalid unit spec given\"));\n        mpf_clear (divisor);\n        return NULL;\n    }\n\n    mpf_init2 (result, BS_FLOAT_PREC_BITS);\n    mpf_set_z (result, size->bytes);\n\n    mpf_div (result, result, divisor);\n\n    gmp_asprintf (&ret, \"%.*Fg\", BS_FLOAT_PREC_BITS/3, result);\n    mpf_clears (divisor, result, NULL);\n\n    return ret;\n}\n\n/**\n * bs_size_human_readable:\n * @min_unit: the smallest unit the returned representation should use\n * @max_places: maximum number of decimal places the representation should use\n * @xlate: whether to try to translate the representation or not\n *\n * Get a human-readable representation of @size.\n *\n * Returns: (transfer full): a string which is human-readable representation of\n *                           @size according to the restrictions given by the\n *                           other parameters\n */\nchar* bs_size_human_readable (const BSSize size, BSBunit min_unit, int max_places, bool xlate) {\n    mpf_t cur_val;\n    char *num_str = NULL;\n    char *ret = NULL;\n    int len = 0;\n    char *zero = NULL;\n    char *radix_char = NULL;\n    int sign = 0;\n    char *loc_num_str = NULL;\n    bool at_radix = false;\n\n    mpf_init2 (cur_val, BS_FLOAT_PREC_BITS);\n    mpf_set_z (cur_val, size->bytes);\n\n    if (min_unit == BS_BUNIT_UNDEF)\n        min_unit = BS_BUNIT_B;\n\n    sign = mpf_sgn (cur_val);\n    mpf_abs (cur_val, cur_val);\n\n    mpf_div_2exp (cur_val, cur_val, 10 * (min_unit - BS_BUNIT_B));\n    while ((mpf_cmp_ui (cur_val, 1024) > 0) && min_unit != BS_BUNIT_YiB) {\n        mpf_div_2exp (cur_val, cur_val, 10);\n        min_unit++;\n    }\n\n    if (sign == -1)\n        mpf_neg (cur_val, cur_val);\n\n    len = gmp_asprintf (&num_str, \"%.*Ff\", max_places >= 0 ? max_places : BS_FLOAT_PREC_BITS,\n                        cur_val);\n    mpf_clear (cur_val);\n\n    /* should use the proper radix char according to @xlate */\n    radix_char = nl_langinfo (RADIXCHAR);\n    if (!xlate) {\n        loc_num_str = replace_str_with_str (num_str, radix_char, \".\");\n        free (num_str);\n        radix_char = \".\";\n    } else\n        loc_num_str = num_str;\n\n    /* remove trailing zeros and the radix char */\n    /* if max_places == 0, there can't be anything trailing */\n    if (max_places != 0) {\n        zero = loc_num_str + (len - 1);\n        while ((zero != loc_num_str) && ((*zero == '0') || (*zero == *radix_char)) && !at_radix) {\n            at_radix = *zero == *radix_char;\n            zero--;\n        }\n        zero[1] = '\\0';\n    }\n\n    ret = strdup_printf (\"%s %s\", loc_num_str, xlate ? _(b_units[min_unit - BS_BUNIT_B]) : b_units[min_unit - BS_BUNIT_B]);\n    free (loc_num_str);\n\n    return ret;\n}\n\n\n/***************\n * ARITHMETIC *\n ***************/\n/**\n * bs_size_add:\n *\n * Add two sizes.\n *\n * Returns: (transfer full): a new instance of #BSSize which is a sum of @size1 and @size2\n */\nBSSize bs_size_add (const BSSize size1, const BSSize size2) {\n    BSSize ret = bs_size_new ();\n    mpz_add (ret->bytes, size1->bytes, size2->bytes);\n\n    return ret;\n}\n\n/**\n * bs_size_grow:\n *\n * Grows @size1 by @size2. IOW, adds @size2 to @size1 in-place (modifying\n * @size1).\n *\n * Basically an in-place variant of bs_size_add().\n *\n * Returns: (transfer none): @size1 modified by adding @size2 to it\n */\nBSSize bs_size_grow (BSSize size1, const BSSize size2) {\n    mpz_add (size1->bytes, size1->bytes, size2->bytes);\n\n    return size1;\n}\n\n/**\n * bs_size_add_bytes:\n *\n * Add @bytes to the @size. To add a negative number of bytes use\n * bs_size_sub_bytes().\n *\n * Returns: (transfer full): a new instance of #BSSize which is a sum of @size and @bytes\n */\nBSSize bs_size_add_bytes (const BSSize size, uint64_t bytes) {\n    BSSize ret = bs_size_new ();\n    do_64bit_add_sub (mpz_add_ui, ret->bytes, size->bytes, bytes);\n\n    return ret;\n}\n\n/**\n * bs_size_grow_bytes:\n *\n * Grows @size by @bytes. IOW, adds @bytes to @size in-place (modifying @size).\n *\n * Basically an in-place variant of bs_size_add_bytes().\n *\n * Returns: (transfer none): @size modified by adding @bytes to it\n */\nBSSize bs_size_grow_bytes (BSSize size, const uint64_t bytes) {\n    do_64bit_add_sub (mpz_add_ui, size->bytes, size->bytes, bytes);\n\n    return size;\n}\n\n/**\n * bs_size_sub:\n *\n * Subtract @size2 from @size1.\n *\n * Returns: (transfer full): a new instance of #BSSize which is equals to @size1 - @size2\n */\nBSSize bs_size_sub (const BSSize size1, const BSSize size2) {\n    BSSize ret = bs_size_new ();\n    mpz_sub (ret->bytes, size1->bytes, size2->bytes);\n\n    return ret;\n}\n\n/**\n * bs_size_shrink:\n *\n * Shrinks @size1 by @size2. IOW, subtracts @size2 from @size1 in-place\n * (modifying @size1).\n *\n * Basically an in-place variant of bs_size_sub().\n *\n * Returns: (transfer none): @size1 modified by subtracting @size2 from it\n */\nBSSize bs_size_shrink (BSSize size1, const BSSize size2) {\n    mpz_sub (size1->bytes, size1->bytes, size2->bytes);\n\n    return size1;\n}\n\n/**\n * bs_size_sub_bytes:\n *\n * Subtract @bytes from the @size. To subtract a negative number of bytes use\n * bs_size_add_bytes().\n *\n * Returns: (transfer full): a new instance of #BSSize which equals to @size - @bytes\n */\nBSSize bs_size_sub_bytes (const BSSize size, uint64_t bytes) {\n    BSSize ret = bs_size_new ();\n    do_64bit_add_sub (mpz_sub_ui, ret->bytes, size->bytes, bytes);\n\n    return ret;\n}\n\n/**\n * bs_size_shrink_bytes:\n *\n * Shrinks @size by @bytes. IOW, subtracts @bytes from @size in-place\n * (modifying @size). To shrink by a negative number of bytes use\n * bs_size_grow_bytes().\n *\n * Basically an in-place variant of bs_size_sub_bytes().\n *\n * Returns: (transfer none): @size modified by subtracting @bytes from it\n */\nBSSize bs_size_shrink_bytes (BSSize size, uint64_t bytes) {\n    do_64bit_add_sub (mpz_sub_ui, size->bytes, size->bytes, bytes);\n\n    return size;\n}\n\n/**\n * bs_size_mul_int:\n *\n * Multiply @size by @times.\n *\n * Returns: (transfer full): a new instance of #BSSize which equals to @size * @times\n */\nBSSize bs_size_mul_int (const BSSize size, uint64_t times) {\n    BSSize ret = bs_size_new ();\n    mul_64bit (ret->bytes, size->bytes, times);\n\n    return ret;\n}\n\n/**\n * bs_size_grow_mul_int:\n *\n * Grow @size @times times. IOW, multiply @size by @times in-place.\n *\n * Basically an in-place variant of bs_size_mul_int().\n *\n * Returns: (transfer none): @size modified by growing it @times times\n */\nBSSize bs_size_grow_mul_int (BSSize size, uint64_t times) {\n    mul_64bit (size->bytes, size->bytes, times);\n\n    return size;\n}\n\n/**\n * bs_size_mul_float_str:\n * @error: (out) (optional): place to store error (if any)\n *\n * Multiply @size by the floating-point number @float_str represents.\n *\n * Returns: (transfer full): a new #BSSize instance which equals to\n *                           @size * @times_str\n *\n */\nBSSize bs_size_mul_float_str (const BSSize size, const char *float_str, BSError **error) {\n    mpf_t op1, op2;\n    int status = 0;\n    BSSize ret = NULL;\n    const char *radix_char = NULL;\n    char *loc_float_str = NULL;\n\n    radix_char = nl_langinfo (RADIXCHAR);\n\n    mpf_init2 (op1, BS_FLOAT_PREC_BITS);\n    mpf_init2 (op2, BS_FLOAT_PREC_BITS);\n\n    mpf_set_z (op1, size->bytes);\n    loc_float_str = replace_char_with_str (float_str, '.', radix_char);\n    status = mpf_set_str (op2, loc_float_str, 10);\n    if (status != 0) {\n        set_error (error, BS_ERROR_INVALID_SPEC, strdup_printf (\"'%s' is not a valid floating point number string\", loc_float_str));\n        free (loc_float_str);\n        mpf_clears (op1, op2, NULL);\n        return NULL;\n    }\n    free (loc_float_str);\n\n    mpf_mul (op1, op1, op2);\n\n    ret = bs_size_new ();\n    mpz_set_f (ret->bytes, op1);\n    mpf_clears (op1, op2, NULL);\n\n    return ret;\n}\n\n/**\n * bs_size_grow_mul_float_str:\n * @error: (out) (optional): place to store error (if any)\n *\n * Grow @size by the floating-point number @float_str represents times. IOW,\n * multiply @size by @float_str in-place.\n *\n * Basically an in-place variant of bs_size_grow_mul_float_str().\n *\n * Returns: (transfer none): @size modified by growing it @float_str times.\n */\nBSSize bs_size_grow_mul_float_str (BSSize size, const char *float_str, BSError **error) {\n    mpf_t op1, op2;\n    int status = 0;\n    const char *radix_char = NULL;\n    char *loc_float_str = NULL;\n\n    radix_char = nl_langinfo (RADIXCHAR);\n\n    mpf_init2 (op1, BS_FLOAT_PREC_BITS);\n    mpf_init2 (op2, BS_FLOAT_PREC_BITS);\n\n    mpf_set_z (op1, size->bytes);\n    loc_float_str = replace_char_with_str (float_str, '.', radix_char);\n    status = mpf_set_str (op2, loc_float_str, 10);\n    if (status != 0) {\n        set_error (error, BS_ERROR_INVALID_SPEC, strdup_printf (\"'%s' is not a valid floating point number string\", loc_float_str));\n        free (loc_float_str);\n        mpf_clears (op1, op2, NULL);\n        return NULL;\n    }\n    free (loc_float_str);\n\n    mpf_mul (op1, op1, op2);\n\n    mpz_set_f (size->bytes, op1);\n    mpf_clears (op1, op2, NULL);\n\n    return size;\n}\n\n/**\n * bs_size_div:\n * @sgn: (out) (optional): sign of the result\n * @error: (out) (optional): place to store error (if any)\n *\n * Divide @size1 by @size2. Gives the answer to the question \"How many times\n * does @size2 fit in @size1?\".\n *\n * Returns: integer number x so that x * @size1 < @size2 and (x+1) * @size1 > @size2\n *          (IOW, @size1 / @size2 using integer division)\n */\nuint64_t bs_size_div (const BSSize size1, const BSSize size2, int *sgn, BSError **error) {\n    mpz_t result;\n    uint64_t ret = 0;\n\n    if (mpz_cmp_ui (size2->bytes, 0) == 0) {\n        set_error (error, BS_ERROR_ZERO_DIV, strdup_printf (\"Division by zero\"));\n        return 0;\n    }\n\n    if (sgn)\n        *sgn = mpz_sgn (size1->bytes) * mpz_sgn (size2->bytes);\n    mpz_init (result);\n    mpz_tdiv_q (result, size1->bytes, size2->bytes);\n\n    if (mpz_cmp_ui (result, UINT64_MAX) > 0) {\n        set_error (error, BS_ERROR_OVER, strdup_printf (\"The size is too big, cannot be returned as a 64bit number\"));\n        mpz_clear (result);\n        return 0;\n    }\n    ret = (uint64_t) mpz_get_ui (result);\n\n    mpz_clear (result);\n    return ret;\n}\n\n/**\n * bs_size_div_int:\n * @error: (out) (optional): place to store error (if any)\n *\n * Divide @size by @divisor. Gives the answer to the question \"What is the size\n * of each chunk if @size is split into a @divisor number of pieces?\"\n *\n * Note: Due to the limitations of the current implementation the maximum value\n * @divisor is ULONG_MAX (which can differ from UINT64_MAX). An error\n * (BS_ERROR_OVER) is returned if overflow happens.\n *\n * Returns: (transfer full): a #BSSize instance x so that x * @divisor = @size,\n *                           rounded to a number of bytes\n */\nBSSize bs_size_div_int (const BSSize size, uint64_t divisor, BSError **error) {\n    BSSize ret = NULL;\n\n    if (divisor == 0) {\n        set_error (error, BS_ERROR_ZERO_DIV, strdup_printf (\"Division by zero\"));\n        return NULL;\n    } else if (divisor > ULONG_MAX) {\n        set_error (error, BS_ERROR_OVER, strdup_printf (\"Divisor too big, must be less or equal to %lu\", ULONG_MAX));\n        return NULL;\n    }\n    ret = bs_size_new ();\n    mpz_tdiv_q_ui (ret->bytes, size->bytes, divisor);\n\n    return ret;\n}\n\n/**\n * bs_size_shrink_div_int:\n * @error: (out) (optional): place to store error (if any)\n *\n * Shrink @size by dividing by @divisor. IOW, divide @size by @divisor in-place.\n *\n * Basically an in-place variant of bs_size_div_int().\n *\n * Note: Due to the limitations of the current implementation the maximum value\n * @divisor is ULONG_MAX (which can differ from UINT64_MAX). An error\n * (BS_ERROR_OVER) is returned if overflow happens.\n *\n * Returns: (transfer none): @size modified by division by @divisor\n */\nBSSize bs_size_shrink_div_int (BSSize size, uint64_t divisor, BSError **error) {\n    if (divisor == 0) {\n        set_error (error, BS_ERROR_ZERO_DIV, strdup_printf (\"Division by zero\"));\n        return NULL;\n    } else if (divisor > ULONG_MAX) {\n        set_error (error, BS_ERROR_OVER, strdup_printf (\"Divisor too big, must be less or equal to %lu\", ULONG_MAX));\n        return NULL;\n    }\n\n    mpz_tdiv_q_ui (size->bytes, size->bytes, divisor);\n\n    return size;\n}\n\n/**\n * bs_size_true_div:\n * @error: (out) (optional): place to store error (if any)\n *\n * Divides @size1 by @size2.\n *\n * Returns: (transfer full): a string representing the floating-point number\n *                           that equals to @size1 / @size2\n */\nchar* bs_size_true_div (const BSSize size1, const BSSize size2, BSError **error) {\n    mpf_t op1;\n    mpf_t op2;\n    char *ret = NULL;\n\n    if (mpz_cmp_ui (size2->bytes, 0) == 0) {\n        set_error (error, BS_ERROR_ZERO_DIV, strdup_printf(\"Division by zero\"));\n        return 0;\n    }\n\n    mpf_init2 (op1, BS_FLOAT_PREC_BITS);\n    mpf_init2 (op2, BS_FLOAT_PREC_BITS);\n    mpf_set_z (op1, size1->bytes);\n    mpf_set_z (op2, size2->bytes);\n\n    mpf_div (op1, op1, op2);\n\n    gmp_asprintf (&ret, \"%.*Fg\", BS_FLOAT_PREC_BITS/3, op1);\n\n    mpf_clears (op1, op2, NULL);\n\n    return ret;\n}\n\n/**\n * bs_size_true_div_int:\n * @error: (out) (optional): place to store error (if any)\n *\n * Divides @size by @divisor.\n *\n * Note: Due to the limitations of the current implementation the maximum value\n * @divisor is ULONG_MAX (which can differ from UINT64_MAX). An error\n * (BS_ERROR_OVER) is returned if overflow happens.\n *\n * Returns: (transfer full): a string representing the floating-point number\n *                           that equals to @size / @divisor\n */\nchar* bs_size_true_div_int (const BSSize size, uint64_t divisor, BSError **error) {\n    mpf_t op1;\n    char *ret = NULL;\n\n    if (divisor == 0) {\n        set_error (error, BS_ERROR_ZERO_DIV, strdup_printf (\"Division by zero\"));\n        return 0;\n    } else if (divisor > ULONG_MAX) {\n        set_error (error, BS_ERROR_OVER, strdup_printf (\"Divisor too big, must be less or equal to %lu\", ULONG_MAX));\n        return NULL;\n    }\n\n    mpf_init2 (op1, BS_FLOAT_PREC_BITS);\n    mpf_set_z (op1, size->bytes);\n\n    mpf_div_ui (op1, op1, divisor);\n\n    gmp_asprintf (&ret, \"%.*Fg\", BS_FLOAT_PREC_BITS/3, op1);\n\n    mpf_clear (op1);\n\n    return ret;\n}\n\n/**\n * bs_size_mod:\n * @error: (out) (optional): place to store error (if any)\n *\n * Gives @size1 modulo @size2 (i.e. the remainder of integer division @size1 /\n * @size2). Gives the answer to the question \"If I split @size1 into chunks of\n * size @size2, what will be the remainder?\"\n * **This function ignores the signs of the sizes.**\n *\n * Returns: (transfer full): a #BSSize instance that is a remainder of\n *                           @size1 / @size2 using integer division\n */\nBSSize bs_size_mod (const BSSize size1, const BSSize size2, BSError **error) {\n    mpz_t aux;\n    BSSize ret = NULL;\n    if (mpz_cmp_ui (size2->bytes, 0) == 0) {\n        set_error (error, BS_ERROR_ZERO_DIV, strdup_printf (\"Division by zero\"));\n        return 0;\n    }\n\n    mpz_init (aux);\n    mpz_set (aux, size1->bytes);\n    if (mpz_sgn (size1->bytes) == -1)\n        /* negative @size1, get the absolute value so that we get results\n           matching the specification/documentation of this function */\n        mpz_neg (aux, aux);\n\n    ret = bs_size_new ();\n    mpz_mod (ret->bytes, aux, size2->bytes);\n\n    return ret;\n}\n\n/**\n * bs_size_round_to_nearest:\n * @round_to: to a multiple of what to round @size\n * @dir: %BS_ROUND_DIR_UP to round up (to the nearest multiple of @round_to\n *       bigger than @size) or %BS_ROUND_DIR_DOWN to round down (to the\n *       nearest multiple of @round_to smaller than @size)\n * @error: (out) (optional): place to store error (if any)\n *\n * Round @size to the nearest multiple of @round_to according to the direction\n * given by @dir.\n *\n * Returns: (transfer full): a new instance of #BSSize that is @size rounded to\n *                           a multiple of @round_to according to @dir\n */\nBSSize bs_size_round_to_nearest (const BSSize size, const BSSize round_to, BSRoundDir dir, BSError **error) {\n    BSSize ret = NULL;\n    mpz_t q;\n    mpz_t aux_size;\n\n    if (mpz_cmp_ui (round_to->bytes, 0) == 0) {\n        set_error (error, BS_ERROR_ZERO_DIV, strdup_printf (\"Division by zero\"));\n        return NULL;\n    }\n\n    mpz_init (q);\n\n    if (dir == BS_ROUND_DIR_UP) {\n        mpz_cdiv_q (q, size->bytes, round_to->bytes);\n    } else if (dir == BS_ROUND_DIR_HALF_UP) {\n        /* round half up == add half of what to round to and round down */\n        mpz_init (aux_size);\n        mpz_fdiv_q_ui (aux_size, round_to->bytes, 2);\n        mpz_add (aux_size, aux_size, size->bytes);\n        mpz_fdiv_q (q, aux_size, round_to->bytes);\n        mpz_clear (aux_size);\n    } else\n        mpz_fdiv_q (q, size->bytes, round_to->bytes);\n\n    ret = bs_size_new ();\n    mpz_mul (ret->bytes, q, round_to->bytes);\n\n    mpz_clear (q);\n\n    return ret;\n}\n\n\n/***************\n * COMPARISONS *\n ***************/\n/**\n * bs_size_cmp:\n * @abs: whether to compare absolute values of @size1 and @size2 instead\n *\n * Compare @size1 and @size2. This function behaves like the standard *cmp*()\n * functions.\n *\n * Returns: -1, 0, or 1 if @size1 is smaller, equal to or bigger than\n *          @size2 respectively comparing absolute values if @abs is %TRUE\n */\nint bs_size_cmp (const BSSize size1, const BSSize size2, bool abs) {\n    int ret = 0;\n    if (abs)\n        ret = mpz_cmpabs (size1->bytes, size2->bytes);\n    else\n        ret = mpz_cmp (size1->bytes, size2->bytes);\n    /* make sure we don't return things like 2 or -2 (which GMP can give us) */\n    if (ret > 0)\n        ret = 1;\n    else if (ret < 0)\n        ret = -1;\n    return ret;\n}\n\n/**\n * bs_size_cmp_bytes:\n * @abs: whether to compare absolute values of @size and @bytes instead.\n *\n * Compare @size and @bytes, i.e. the number of bytes @size has with\n * @bytes. This function behaves like the standard *cmp*() functions.\n *\n * Returns: -1, 0, or 1 if @size is smaller, equal to or bigger than\n *          @bytes respectively comparing absolute values if @abs is %TRUE\n */\nint bs_size_cmp_bytes (const BSSize size, uint64_t bytes, bool abs) {\n    int ret = 0;\n    if (abs)\n        ret = mpz_cmpabs_ui (size->bytes, bytes);\n    else\n        ret = mpz_cmp_ui (size->bytes, bytes);\n    /* make sure we don't return things like 2 or -2 (which GMP can give us) */\n    if (ret > 0)\n        ret = 1;\n    else if (ret < 0)\n        ret = -1;\n    return ret;\n}\n"},
                          "roles": ["analysisTarget",
                                    "tracedFile"]},
                         {"location": {"uri": "/usr/include/string.h"},
                          "sourceLanguage": "c",
                          "contents": {"text": "/* Copyright (C) 1991-2026 Free Software Foundation, Inc.\n   This file is part of the GNU C Library.\n\n   The GNU C Library is free software; you can redistribute it and/or\n   modify it under the terms of the GNU Lesser General Public\n   License as published by the Free Software Foundation; either\n   version 2.1 of the License, or (at your option) any later version.\n\n   The GNU C Library is distributed in the hope that it will be useful,\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n   Lesser General Public License for more details.\n\n   You should have received a copy of the GNU Lesser General Public\n   License along with the GNU C Library; if not, see\n   <https://www.gnu.org/licenses/>.  */\n\n/*\n *\tISO C99 Standard: 7.21 String handling\t<string.h>\n */\n\n#ifndef\t_STRING_H\n#define\t_STRING_H\t1\n\n#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION\n#include <bits/libc-header-start.h>\n\n__BEGIN_DECLS\n\n#if __GLIBC_USE (ISOC23)\n# define __STDC_VERSION_STRING_H__ 202311L\n#endif\n\n/* Get size_t and NULL from <stddef.h>.  */\n#define\t__need_size_t\n#define\t__need_NULL\n#include <stddef.h>\n\n/* Tell the caller that we provide correct C++ prototypes.  */\n#if defined __cplusplus && (__GNUC_PREREQ (4, 4) \\\n\t\t\t    || __glibc_clang_prereq (3, 5))\n# define __CORRECT_ISO_CPP_STRING_H_PROTO\n#endif\n\n\n/* Copy N bytes of SRC to DEST.  */\nextern void *memcpy (void *__restrict __dest, const void *__restrict __src,\n\t\t     size_t __n) __THROW __nonnull ((1, 2));\n/* Copy N bytes of SRC to DEST, guaranteeing\n   correct behavior for overlapping strings.  */\nextern void *memmove (void *__dest, const void *__src, size_t __n)\n     __THROW __nonnull ((1, 2));\n\n/* Copy no more than N bytes of SRC to DEST, stopping when C is found.\n   Return the position in DEST one byte past where C was copied,\n   or NULL if C was not found in the first N bytes of SRC.  */\n#if defined __USE_MISC || defined __USE_XOPEN || __GLIBC_USE (ISOC23)\nextern void *memccpy (void *__restrict __dest, const void *__restrict __src,\n\t\t      int __c, size_t __n)\n    __THROW __nonnull ((1, 2)) __attr_access ((__write_only__, 1, 4));\n#endif /* Misc || X/Open.  */\n\n\n/* Set N bytes of S to C.  */\nextern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));\n\n#if defined __USE_MISC || __GLIBC_USE (ISOC23)\n/* Like memset, but the compiler will not delete a call to this\n   function, even if S is dead after the call.  */\nextern void *memset_explicit (void *__s, int __c, size_t __n)\n     __THROW __nonnull ((1)) __fortified_attr_access (__write_only__, 1, 3);\n#endif\n\n/* Compare N bytes of S1 and S2.  */\nextern int memcmp (const void *__s1, const void *__s2, size_t __n)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n\n/* Compare N bytes of S1 and S2.  Return zero if S1 and S2 are equal.\n   Return some non-zero value otherwise.\n\n   Essentially __memcmpeq has the exact same semantics as memcmp\n   except the return value is less constrained.  memcmp is always a\n   correct implementation of __memcmpeq.  As well !!memcmp, -memcmp,\n   or bcmp are correct implementations.\n\n   __memcmpeq is meant to be used by compilers when memcmp return is\n   only used for its boolean value.\n\n   __memcmpeq is declared only for use by compilers.  Programs should\n   continue to use memcmp.  */\nextern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n\n/* Search N bytes of S for C.  */\n#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO\nextern \"C++\"\n{\nextern void *memchr (void *__s, int __c, size_t __n)\n      __THROW __asm (\"memchr\") __attribute_pure__ __nonnull ((1));\nextern const void *memchr (const void *__s, int __c, size_t __n)\n      __THROW __asm (\"memchr\") __attribute_pure__ __nonnull ((1));\n\n# ifdef __OPTIMIZE__\n__extern_always_inline void *\nmemchr (void *__s, int __c, size_t __n) __THROW\n{\n  return __builtin_memchr (__s, __c, __n);\n}\n\n__extern_always_inline const void *\nmemchr (const void *__s, int __c, size_t __n) __THROW\n{\n  return __builtin_memchr (__s, __c, __n);\n}\n# endif\n}\n#else\nextern void *memchr (const void *__s, int __c, size_t __n)\n      __THROW __attribute_pure__ __nonnull ((1));\n# if __GLIBC_USE (ISOC23) && defined __glibc_const_generic && !defined _LIBC\n#  define memchr(S, C, N)\t\t\t\t\t\\\n  __glibc_const_generic (S, const void *, memchr (S, C, N))\n# endif\n#endif\n\n#ifdef __USE_GNU\n/* Search in S for C.  This is similar to `memchr' but there is no\n   length limit.  */\n# ifdef __CORRECT_ISO_CPP_STRING_H_PROTO\nextern \"C++\" void *rawmemchr (void *__s, int __c)\n     __THROW __asm (\"rawmemchr\") __attribute_pure__ __nonnull ((1));\nextern \"C++\" const void *rawmemchr (const void *__s, int __c)\n     __THROW __asm (\"rawmemchr\") __attribute_pure__ __nonnull ((1));\n# else\nextern void *rawmemchr (const void *__s, int __c)\n     __THROW __attribute_pure__ __nonnull ((1));\n# endif\n\n/* Search N bytes of S for the final occurrence of C.  */\n# ifdef __CORRECT_ISO_CPP_STRING_H_PROTO\nextern \"C++\" void *memrchr (void *__s, int __c, size_t __n)\n      __THROW __asm (\"memrchr\") __attribute_pure__ __nonnull ((1))\n      __attr_access ((__read_only__, 1, 3));\nextern \"C++\" const void *memrchr (const void *__s, int __c, size_t __n)\n      __THROW __asm (\"memrchr\") __attribute_pure__ __nonnull ((1))\n      __attr_access ((__read_only__, 1, 3));\n# else\nextern void *memrchr (const void *__s, int __c, size_t __n)\n      __THROW __attribute_pure__ __nonnull ((1))\n      __attr_access ((__read_only__, 1, 3));\n# endif\n#endif\n\n\n/* Copy SRC to DEST.  */\nextern char *strcpy (char *__restrict __dest, const char *__restrict __src)\n     __THROW __nonnull ((1, 2));\n/* Copy no more than N characters of SRC to DEST.  */\nextern char *strncpy (char *__restrict __dest,\n\t\t      const char *__restrict __src, size_t __n)\n     __THROW __nonnull ((1, 2));\n\n/* Append SRC onto DEST.  */\nextern char *strcat (char *__restrict __dest, const char *__restrict __src)\n     __THROW __nonnull ((1, 2));\n/* Append no more than N characters from SRC onto DEST.  */\nextern char *strncat (char *__restrict __dest, const char *__restrict __src,\n\t\t      size_t __n) __THROW __nonnull ((1, 2));\n\n/* Compare S1 and S2.  */\nextern int strcmp (const char *__s1, const char *__s2)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n/* Compare N characters of S1 and S2.  */\nextern int strncmp (const char *__s1, const char *__s2, size_t __n)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n\n/* Compare the collated forms of S1 and S2.  */\nextern int strcoll (const char *__s1, const char *__s2)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n/* Put a transformation of SRC into no more than N bytes of DEST.  */\nextern size_t strxfrm (char *__restrict __dest,\n\t\t       const char *__restrict __src, size_t __n)\n    __THROW __nonnull ((2)) __attr_access ((__write_only__, 1, 3));\n\n#ifdef __USE_XOPEN2K8\n/* POSIX.1-2008 extended locale interface (see locale.h).  */\n# include <bits/types/locale_t.h>\n\n/* Compare the collated forms of S1 and S2, using sorting rules from L.  */\nextern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)\n     __THROW __attribute_pure__ __nonnull ((1, 2, 3));\n/* Put a transformation of SRC into no more than N bytes of DEST,\n   using sorting rules from L.  */\nextern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,\n\t\t\t locale_t __l) __THROW __nonnull ((2, 4))\n     __attr_access ((__write_only__, 1, 3));\n#endif\n\n#if (defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8\t\\\n     || __GLIBC_USE (LIB_EXT2) || __GLIBC_USE (ISOC23))\n/* Duplicate S, returning an identical malloc'd string.  */\nextern char *strdup (const char *__s)\n     __THROW __attribute_malloc__ __nonnull ((1));\n#endif\n\n/* Return a malloc'd copy of at most N bytes of STRING.  The\n   resultant string is terminated even if no null terminator\n   appears before STRING[N].  */\n#if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2) || __GLIBC_USE (ISOC23)\nextern char *strndup (const char *__string, size_t __n)\n     __THROW __attribute_malloc__ __nonnull ((1));\n#endif\n\n#if defined __USE_GNU && defined __GNUC__\n/* Duplicate S, returning an identical alloca'd string.  */\n# define strdupa(s)\t\t\t\t\t\t\t      \\\n  (__extension__\t\t\t\t\t\t\t      \\\n    ({\t\t\t\t\t\t\t\t\t      \\\n      const char *__old = (s);\t\t\t\t\t\t      \\\n      size_t __len = strlen (__old) + 1;\t\t\t\t      \\\n      char *__new = (char *) __builtin_alloca (__len);\t\t\t      \\\n      (char *) memcpy (__new, __old, __len);\t\t\t\t      \\\n    }))\n\n/* Return an alloca'd copy of at most N bytes of string.  */\n# define strndupa(s, n)\t\t\t\t\t\t\t      \\\n  (__extension__\t\t\t\t\t\t\t      \\\n    ({\t\t\t\t\t\t\t\t\t      \\\n      const char *__old = (s);\t\t\t\t\t\t      \\\n      size_t __len = strnlen (__old, (n));\t\t\t\t      \\\n      char *__new = (char *) __builtin_alloca (__len + 1);\t\t      \\\n      __new[__len] = '\\0';\t\t\t\t\t\t      \\\n      (char *) memcpy (__new, __old, __len);\t\t\t\t      \\\n    }))\n#endif\n\n/* Find the first occurrence of C in S.  */\n#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO\nextern \"C++\"\n{\nextern char *strchr (char *__s, int __c)\n     __THROW __asm (\"strchr\") __attribute_pure__ __nonnull ((1));\nextern const char *strchr (const char *__s, int __c)\n     __THROW __asm (\"strchr\") __attribute_pure__ __nonnull ((1));\n\n# ifdef __OPTIMIZE__\n__extern_always_inline char *\nstrchr (char *__s, int __c) __THROW\n{\n  return __builtin_strchr (__s, __c);\n}\n\n__extern_always_inline const char *\nstrchr (const char *__s, int __c) __THROW\n{\n  return __builtin_strchr (__s, __c);\n}\n# endif\n}\n#else\nextern char *strchr (const char *__s, int __c)\n     __THROW __attribute_pure__ __nonnull ((1));\n# if __GLIBC_USE (ISOC23) && defined __glibc_const_generic && !defined _LIBC\n#  define strchr(S, C)\t\t\t\t\t\t\\\n  __glibc_const_generic (S, const char *, strchr (S, C))\n# endif\n#endif\n/* Find the last occurrence of C in S.  */\n#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO\nextern \"C++\"\n{\nextern char *strrchr (char *__s, int __c)\n     __THROW __asm (\"strrchr\") __attribute_pure__ __nonnull ((1));\nextern const char *strrchr (const char *__s, int __c)\n     __THROW __asm (\"strrchr\") __attribute_pure__ __nonnull ((1));\n\n# ifdef __OPTIMIZE__\n__extern_always_inline char *\nstrrchr (char *__s, int __c) __THROW\n{\n  return __builtin_strrchr (__s, __c);\n}\n\n__extern_always_inline const char *\nstrrchr (const char *__s, int __c) __THROW\n{\n  return __builtin_strrchr (__s, __c);\n}\n# endif\n}\n#else\nextern char *strrchr (const char *__s, int __c)\n     __THROW __attribute_pure__ __nonnull ((1));\n# if __GLIBC_USE (ISOC23) && defined __glibc_const_generic && !defined _LIBC\n#  define strrchr(S, C)\t\t\t\t\t\t\\\n  __glibc_const_generic (S, const char *, strrchr (S, C))\n# endif\n#endif\n\n#ifdef __USE_MISC\n/* This function is similar to `strchr'.  But it returns a pointer to\n   the closing NUL byte in case C is not found in S.  */\n# ifdef __CORRECT_ISO_CPP_STRING_H_PROTO\nextern \"C++\" char *strchrnul (char *__s, int __c)\n     __THROW __asm (\"strchrnul\") __attribute_pure__ __nonnull ((1));\nextern \"C++\" const char *strchrnul (const char *__s, int __c)\n     __THROW __asm (\"strchrnul\") __attribute_pure__ __nonnull ((1));\n# else\nextern char *strchrnul (const char *__s, int __c)\n     __THROW __attribute_pure__ __nonnull ((1));\n# endif\n#endif\n\n/* Return the length of the initial segment of S which\n   consists entirely of characters not in REJECT.  */\nextern size_t strcspn (const char *__s, const char *__reject)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n/* Return the length of the initial segment of S which\n   consists entirely of characters in ACCEPT.  */\nextern size_t strspn (const char *__s, const char *__accept)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n/* Find the first occurrence in S of any character in ACCEPT.  */\n#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO\nextern \"C++\"\n{\nextern char *strpbrk (char *__s, const char *__accept)\n     __THROW __asm (\"strpbrk\") __attribute_pure__ __nonnull ((1, 2));\nextern const char *strpbrk (const char *__s, const char *__accept)\n     __THROW __asm (\"strpbrk\") __attribute_pure__ __nonnull ((1, 2));\n\n# ifdef __OPTIMIZE__\n__extern_always_inline char *\nstrpbrk (char *__s, const char *__accept) __THROW\n{\n  return __builtin_strpbrk (__s, __accept);\n}\n\n__extern_always_inline const char *\nstrpbrk (const char *__s, const char *__accept) __THROW\n{\n  return __builtin_strpbrk (__s, __accept);\n}\n# endif\n}\n#else\nextern char *strpbrk (const char *__s, const char *__accept)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n# if __GLIBC_USE (ISOC23) && defined __glibc_const_generic && !defined _LIBC\n#  define strpbrk(S, ACCEPT)\t\t\t\t\t\\\n  __glibc_const_generic (S, const char *, strpbrk (S, ACCEPT))\n# endif\n#endif\n/* Find the first occurrence of NEEDLE in HAYSTACK.  */\n#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO\nextern \"C++\"\n{\nextern char *strstr (char *__haystack, const char *__needle)\n     __THROW __asm (\"strstr\") __attribute_pure__ __nonnull ((1, 2));\nextern const char *strstr (const char *__haystack, const char *__needle)\n     __THROW __asm (\"strstr\") __attribute_pure__ __nonnull ((1, 2));\n\n# ifdef __OPTIMIZE__\n__extern_always_inline char *\nstrstr (char *__haystack, const char *__needle) __THROW\n{\n  return __builtin_strstr (__haystack, __needle);\n}\n\n__extern_always_inline const char *\nstrstr (const char *__haystack, const char *__needle) __THROW\n{\n  return __builtin_strstr (__haystack, __needle);\n}\n# endif\n}\n#else\nextern char *strstr (const char *__haystack, const char *__needle)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n# if __GLIBC_USE (ISOC23) && defined __glibc_const_generic && !defined _LIBC\n#  define strstr(HAYSTACK, NEEDLE)\t\t\t\\\n  __glibc_const_generic (HAYSTACK, const char *,\t\\\n\t\t\t strstr (HAYSTACK, NEEDLE))\n# endif\n#endif\n\n\n/* Divide S into tokens separated by characters in DELIM.  */\nextern char *strtok (char *__restrict __s, const char *__restrict __delim)\n     __THROW __nonnull ((2));\n\n/* Divide S into tokens separated by characters in DELIM.  Information\n   passed between calls are stored in SAVE_PTR.  */\nextern char *__strtok_r (char *__restrict __s,\n\t\t\t const char *__restrict __delim,\n\t\t\t char **__restrict __save_ptr)\n     __THROW __nonnull ((2, 3));\n#ifdef __USE_POSIX\nextern char *strtok_r (char *__restrict __s, const char *__restrict __delim,\n\t\t       char **__restrict __save_ptr)\n     __THROW __nonnull ((2, 3));\n#endif\n\n#ifdef __USE_MISC\n/* Similar to `strstr' but this function ignores the case of both strings.  */\n# ifdef __CORRECT_ISO_CPP_STRING_H_PROTO\nextern \"C++\" char *strcasestr (char *__haystack, const char *__needle)\n     __THROW __asm (\"strcasestr\") __attribute_pure__ __nonnull ((1, 2));\nextern \"C++\" const char *strcasestr (const char *__haystack,\n\t\t\t\t     const char *__needle)\n     __THROW __asm (\"strcasestr\") __attribute_pure__ __nonnull ((1, 2));\n# else\nextern char *strcasestr (const char *__haystack, const char *__needle)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n# endif\n#endif\n\n#ifdef __USE_MISC\n/* Find the first occurrence of NEEDLE in HAYSTACK.\n   NEEDLE is NEEDLELEN bytes long;\n   HAYSTACK is HAYSTACKLEN bytes long.  */\nextern void *memmem (const void *__haystack, size_t __haystacklen,\n\t\t     const void *__needle, size_t __needlelen)\n     __THROW __attribute_pure__ __nonnull ((1, 3))\n    __attr_access ((__read_only__, 1, 2))\n    __attr_access ((__read_only__, 3, 4));\n\n/* Copy N bytes of SRC to DEST, return pointer to bytes after the\n   last written byte.  */\nextern void *__mempcpy (void *__restrict __dest,\n\t\t\tconst void *__restrict __src, size_t __n)\n     __THROW __nonnull ((1, 2));\nextern void *mempcpy (void *__restrict __dest,\n\t\t      const void *__restrict __src, size_t __n)\n     __THROW __nonnull ((1, 2));\n#endif\n\n\n/* Return the length of S.  */\nextern size_t strlen (const char *__s)\n     __THROW __attribute_pure__ __nonnull ((1));\n\n#ifdef\t__USE_XOPEN2K8\n/* Find the length of STRING, but scan at most MAXLEN characters.\n   If no '\\0' terminator is found in that many characters, return MAXLEN.  */\nextern size_t strnlen (const char *__string, size_t __maxlen)\n     __THROW __attribute_pure__ __nonnull ((1));\n#endif\n\n\n/* Return a string describing the meaning of the `errno' code in ERRNUM.  */\nextern char *strerror (int __errnum) __THROW;\n#ifdef __USE_XOPEN2K\n/* Reentrant version of `strerror'.\n   There are 2 flavors of `strerror_r', GNU which returns the string\n   and may or may not use the supplied temporary buffer and POSIX one\n   which fills the string into the buffer.\n   To use the POSIX version, -D_XOPEN_SOURCE=600 or -D_POSIX_C_SOURCE=200112L\n   without -D_GNU_SOURCE is needed, otherwise the GNU version is\n   preferred.  */\n# if defined __USE_XOPEN2K && !defined __USE_GNU\n/* Fill BUF with a string describing the meaning of the `errno' code in\n   ERRNUM.  */\n#  ifdef __REDIRECT_NTH\nextern int __REDIRECT_NTH (strerror_r,\n\t\t\t   (int __errnum, char *__buf, size_t __buflen),\n\t\t\t   __xpg_strerror_r) __nonnull ((2))\n    __attr_access ((__write_only__, 2, 3));\n#  else\nextern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen)\n     __THROW __nonnull ((2)) __attr_access ((__write_only__, 2, 3));\n#   define strerror_r __xpg_strerror_r\n#  endif\n# else\n/* If a temporary buffer is required, at most BUFLEN bytes of BUF will be\n   used.  */\nextern char *strerror_r (int __errnum, char *__buf, size_t __buflen)\n     __THROW __nonnull ((2)) __wur  __attr_access ((__write_only__, 2, 3));\n# endif\n\n# ifdef __USE_GNU\n/* Return a string describing the meaning of tthe error in ERR.  */\nextern const char *strerrordesc_np (int __err) __THROW;\n/* Return a string with the error name in ERR.  */\nextern const char *strerrorname_np (int __err) __THROW;\n# endif\n#endif\n\n#ifdef __USE_XOPEN2K8\n/* Translate error number to string according to the locale L.  */\nextern char *strerror_l (int __errnum, locale_t __l) __THROW;\n#endif\n\n#ifdef __USE_MISC\n# include <strings.h>\n\n/* Set N bytes of S to 0.  The compiler will not delete a call to this\n   function, even if S is dead after the call.  */\nextern void explicit_bzero (void *__s, size_t __n) __THROW __nonnull ((1))\n    __fortified_attr_access (__write_only__, 1, 2);\n\n/* Return the next DELIM-delimited token from *STRINGP,\n   terminating it with a '\\0', and update *STRINGP to point past it.  */\nextern char *strsep (char **__restrict __stringp,\n\t\t     const char *__restrict __delim)\n     __THROW __nonnull ((1, 2));\n#endif\n\n#ifdef\t__USE_XOPEN2K8\n/* Return a string describing the meaning of the signal number in SIG.  */\nextern char *strsignal (int __sig) __THROW;\n\n# ifdef __USE_GNU\n/* Return an abbreviation string for the signal number SIG.  */\nextern const char *sigabbrev_np (int __sig) __THROW;\n/* Return a string describing the meaning of the signal number in SIG,\n   the result is not translated.  */\nextern const char *sigdescr_np (int __sig) __THROW;\n# endif\n\n/* Copy SRC to DEST, returning the address of the terminating '\\0' in DEST.  */\nextern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)\n     __THROW __nonnull ((1, 2));\nextern char *stpcpy (char *__restrict __dest, const char *__restrict __src)\n     __THROW __nonnull ((1, 2));\n\n/* Copy no more than N characters of SRC to DEST, returning the address of\n   the last character written into DEST.  */\nextern char *__stpncpy (char *__restrict __dest,\n\t\t\tconst char *__restrict __src, size_t __n)\n     __THROW __nonnull ((1, 2));\nextern char *stpncpy (char *__restrict __dest,\n\t\t      const char *__restrict __src, size_t __n)\n     __THROW __nonnull ((1, 2));\n#endif\n\n#ifdef __USE_MISC\n/* Copy at most N - 1 characters from SRC to DEST.  */\nextern size_t strlcpy (char *__restrict __dest,\n\t\t       const char *__restrict __src, size_t __n)\n  __THROW __nonnull ((1, 2)) __attr_access ((__write_only__, 1, 3));\n\n/* Append SRC to DEST, possibly with truncation to keep the total size\n   below N.  */\nextern size_t strlcat (char *__restrict __dest,\n\t\t       const char *__restrict __src, size_t __n)\n  __THROW __nonnull ((1, 2))  __attr_access ((__read_write__, 1, 3));\n#endif\n\n#ifdef\t__USE_GNU\n/* Compare S1 and S2 as strings holding name & indices/version numbers.  */\nextern int strverscmp (const char *__s1, const char *__s2)\n     __THROW __attribute_pure__ __nonnull ((1, 2));\n\n/* Sautee STRING briskly.  */\nextern char *strfry (char *__string) __THROW __nonnull ((1));\n\n/* Frobnicate N bytes of S.  */\nextern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1))\n    __attr_access ((__read_write__, 1, 2));\n\n# ifndef basename\n/* Return the file name within directory of FILENAME.  We don't\n   declare the function if the `basename' macro is available (defined\n   in <libgen.h>) which makes the XPG version of this function\n   available.  */\n#  ifdef __CORRECT_ISO_CPP_STRING_H_PROTO\nextern \"C++\" char *basename (char *__filename)\n     __THROW __asm (\"basename\") __nonnull ((1));\nextern \"C++\" const char *basename (const char *__filename)\n     __THROW __asm (\"basename\") __nonnull ((1));\n#  else\nextern char *basename (const char *__filename) __THROW __nonnull ((1));\n#  endif\n# endif\n#endif\n\n#if __GNUC_PREREQ (3,4)\n# if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function\n/* Functions with security checks.  */\n#  include <bits/string_fortified.h>\n# endif\n#endif\n\n__END_DECLS\n\n#endif /* string.h  */\n"},
                          "roles": ["resultFile"]},
                         {"location": {"uri": "/usr/include/features.h"},
                          "sourceLanguage": "c"},
                         {"location": {"uri": "/usr/include/bits/libc-header-start.h"},
                          "sourceLanguage": "c"},
                         {"location": {"uri": "/usr/include/limits.h"},
                          "sourceLanguage": "c"},
                         {"location": {"uri": "/usr/lib/gcc/x86_64-redhat-linux/16/include/limits.h"},
                          "sourceLanguage": "c"},
                         {"location": {"uri": "/usr/lib/gcc/x86_64-redhat-linux/16/include/syslimits.h"},
                          "sourceLanguage": "c"},
                         {"location": {"uri": "/usr/include/gmp-x86_64.h"},
                          "sourceLanguage": "c"},
                         {"location": {"uri": "/usr/include/gmp.h"},
                          "sourceLanguage": "c"}],
           "results": [{"ruleId": "-Wanalyzer-use-of-uninitialized-value",
                        "taxa": [{"id": "457",
                                  "toolComponent": {"name": "cwe"}}],
                        "properties": {"gcc/analyzer/saved_diagnostic/ploc": {"enode": 3394},
                                       "gcc/analyzer/saved_diagnostic/idx": 0,
                                       "gcc/analyzer/pending_diagnostic/kind": "poisoned_value_diagnostic",
                                       "gcc/analyzer/poisoned_value_diagnostic/expr": "MEM[(char * {ref-all})_39]",
                                       "gcc/analyzer/poisoned_value_diagnostic/kind": "uninit",
                                       "gcc/analyzer/poisoned_value_diagnostic/src_region": "CAST_REG('char', HEAP_ALLOCATED_REGION(683))",
                                       "gcc/analyzer/poisoned_value_diagnostic/check_expr": null},
                        "level": "warning",
                        "message": {"text": "use of uninitialized value '*<unknown>'"},
                        "locations": [{"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                 "uriBaseId": "PWD"},
                                                            "region": {"startLine": 498,
                                                                       "startColumn": 15,
                                                                       "endColumn": 36},
                                                            "contextRegion": {"startLine": 498,
                                                                              "snippet": {"text": "    str_len = strlen (loc_size_str);\n"}}},
                                       "logicalLocations": [{"index": 0,
                                                             "fullyQualifiedName": "bs_size_new_from_str"}]}],
                        "codeFlows": [{"threadFlows": [{"id": "main",
                                                        "locations": [{"properties": {"gcc/analyzer/checker_event/emission_id": "(1)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 437,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 28},
                                                                                                         "contextRegion": {"startLine": 437,
                                                                                                                           "snippet": {"text": "BSSize bs_size_new_from_str (const char *size_str, BSError **error) {\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "bs_size_new_from_str"}],
                                                                                    "message": {"text": "entry to 'bs_size_new_from_str'"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 1},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(2)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 672,
                                                                                                                                 "dst_id": 691}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 470,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 470,
                                                                                                                           "snippet": {"text": "    if (!regex) {\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "bs_size_new_from_str"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 2},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(3)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 672,
                                                                                                                                 "dst_id": 691}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 492,
                                                                                                                    "startColumn": 20,
                                                                                                                    "endColumn": 69},
                                                                                                         "contextRegion": {"startLine": 492,
                                                                                                                           "snippet": {"text": "    loc_size_str = replace_char_with_str (size_str, '.', radix_char);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "bs_size_new_from_str"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 3},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(4)",
                                                                                      "gcc/analyzer/checker_event/kind": "call",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 691,
                                                                                                                                 "dst_id": 692}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 492,
                                                                                                                    "startColumn": 20,
                                                                                                                    "endColumn": 69},
                                                                                                         "contextRegion": {"startLine": 492,
                                                                                                                           "snippet": {"text": "    loc_size_str = replace_char_with_str (size_str, '.', radix_char);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "bs_size_new_from_str"}],
                                                                                    "message": {"text": "calling 'replace_char_with_str' from 'bs_size_new_from_str'"}},
                                                                       "kinds": ["call",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 4},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(5)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 133,
                                                                                                                    "startColumn": 14,
                                                                                                                    "endColumn": 35},
                                                                                                         "contextRegion": {"startLine": 133,
                                                                                                                           "snippet": {"text": "static char *replace_char_with_str (const char *str, char orig, const char *new) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "replace_char_with_str"}],
                                                                                    "message": {"text": "entry to 'replace_char_with_str'"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 5},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(6)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 1059,
                                                                                                                                 "dst_id": 1061}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 141,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 141,
                                                                                                                           "snippet": {"text": "    if (!str)\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "replace_char_with_str"}],
                                                                                    "message": {"text": "following 'false' branch (when 'str' is non-NULL)..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 6},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(7)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 1059,
                                                                                                                                 "dst_id": 1061}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 145,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 145,
                                                                                                                           "snippet": {"text": "    for (next=strchr (next, orig); next; count++, next=strchr (++next, orig));\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "replace_char_with_str"}],
                                                                                    "message": {"text": "...to here"},
                                                                                    "id": 0,
                                                                                    "relationships": [{"target": 1,
                                                                                                       "kinds": ["isIncludedBy"]}]},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 7},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(8)",
                                                                                      "gcc/analyzer/checker_event/kind": "custom"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 145,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 145,
                                                                                                                           "snippet": {"text": "    for (next=strchr (next, orig); next; count++, next=strchr (++next, orig));\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "replace_char_with_str"}],
                                                                                    "message": {"text": "when 'strchr' returns NULL"},
                                                                                    "id": 2,
                                                                                    "relationships": [{"target": 1,
                                                                                                       "kinds": ["isIncludedBy"]}]},
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 8},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(9)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 1066,
                                                                                                                                 "dst_id": 1072}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 145,
                                                                                                                    "startColumn": 36,
                                                                                                                    "endColumn": 40},
                                                                                                         "contextRegion": {"startLine": 145,
                                                                                                                           "snippet": {"text": "    for (next=strchr (next, orig); next; count++, next=strchr (++next, orig));\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "replace_char_with_str"}],
                                                                                    "message": {"text": "following 'false' branch (when 'next' is NULL)..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 9},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(10)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 1066,
                                                                                                                                 "dst_id": 1072}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 149,
                                                                                                                    "startColumn": 35,
                                                                                                                    "endColumn": 46},
                                                                                                         "contextRegion": {"startLine": 149,
                                                                                                                           "snippet": {"text": "    ret = malloc (sizeof(char) * (strlen(str) + (strlen(new) - 1) * count + 1));\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "replace_char_with_str"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 10},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(11)",
                                                                                      "gcc/analyzer/checker_event/kind": "region_creation"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 149,
                                                                                                                    "startColumn": 11,
                                                                                                                    "endColumn": 80},
                                                                                                         "contextRegion": {"startLine": 149,
                                                                                                                           "snippet": {"text": "    ret = malloc (sizeof(char) * (strlen(str) + (strlen(new) - 1) * count + 1));\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "replace_char_with_str"}],
                                                                                    "message": {"text": "region created on heap here"}},
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 11},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(12)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 1079,
                                                                                                                                 "dst_id": 1082}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 150,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 150,
                                                                                                                           "snippet": {"text": "    if (!ret)\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "replace_char_with_str"}],
                                                                                    "message": {"text": "following 'false' branch (when 'ret' is non-NULL)..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 12},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(13)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 1079,
                                                                                                                                 "dst_id": 1082}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 150,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 150,
                                                                                                                           "snippet": {"text": "    if (!ret)\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "replace_char_with_str"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 13},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(14)",
                                                                                      "gcc/analyzer/checker_event/kind": "return"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 492,
                                                                                                                    "startColumn": 20,
                                                                                                                    "endColumn": 69},
                                                                                                         "contextRegion": {"startLine": 492,
                                                                                                                           "snippet": {"text": "    loc_size_str = replace_char_with_str (size_str, '.', radix_char);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "bs_size_new_from_str"}],
                                                                                    "message": {"text": "returning to 'bs_size_new_from_str' from 'replace_char_with_str'"}},
                                                                       "kinds": ["return",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 14},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(15)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 692,
                                                                                                                                 "dst_id": 697}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 493,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 493,
                                                                                                                           "snippet": {"text": "    if (!loc_size_str) {\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "bs_size_new_from_str"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 15},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(16)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 692,
                                                                                                                                 "dst_id": 697}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 498,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 36},
                                                                                                         "contextRegion": {"startLine": 498,
                                                                                                                           "snippet": {"text": "    str_len = strlen (loc_size_str);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "bs_size_new_from_str"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 16},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(17)",
                                                                                      "gcc/analyzer/checker_event/kind": "custom"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 498,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 36},
                                                                                                         "contextRegion": {"startLine": 498,
                                                                                                                           "snippet": {"text": "    str_len = strlen (loc_size_str);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "bs_size_new_from_str"}],
                                                                                    "message": {"text": "while looking for null terminator for argument 1 ('<unknown>') of 'strlen'..."}},
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 17},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(18)",
                                                                                      "gcc/analyzer/checker_event/kind": "warning"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 498,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 36},
                                                                                                         "contextRegion": {"startLine": 498,
                                                                                                                           "snippet": {"text": "    str_len = strlen (loc_size_str);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "bs_size_new_from_str"}],
                                                                                    "message": {"text": "use of uninitialized value '*<unknown>' here"}},
                                                                       "kinds": ["danger"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 18}]}]}],
                        "relatedLocations": [{"physicalLocation": {"artifactLocation": {"uri": "/usr/include/string.h"},
                                                                   "region": {"startLine": 439,
                                                                              "startColumn": 15,
                                                                              "endColumn": 21},
                                                                   "contextRegion": {"startLine": 439,
                                                                                     "snippet": {"text": "extern size_t strlen (const char *__s)\n"}}},
                                              "message": {"text": "argument 1 of 'strlen' must be a pointer to a null-terminated string"},
                                              "properties": {"nestingLevel": 0},
                                              "id": 3,
                                              "relationships": [{"target": 4,
                                                                 "kinds": ["isIncludedBy"]}]},
                                             {"physicalLocation": {"artifactLocation": {"uri": "/usr/include/features.h"},
                                                                   "region": {"startLine": 540},
                                                                   "contextRegion": {"startLine": 540,
                                                                                     "snippet": {"text": "#  include <sys/cdefs.h>\n"}}},
                                              "relationships": [{"target": 0,
                                                                 "kinds": ["includes"]},
                                                                {"target": 2,
                                                                 "kinds": ["includes"]},
                                                                {"target": 5,
                                                                 "kinds": ["isIncludedBy"]}],
                                              "id": 1},
                                             {"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                        "uriBaseId": "PWD"},
                                                                   "region": {"startLine": 7},
                                                                   "contextRegion": {"startLine": 7,
                                                                                     "snippet": {"text": "#include <string.h>\n"}}},
                                              "relationships": [{"target": 3,
                                                                 "kinds": ["includes"]}],
                                              "id": 4},
                                             {"physicalLocation": {"artifactLocation": {"uri": "/usr/include/bits/libc-header-start.h"},
                                                                   "region": {"startLine": 33},
                                                                   "contextRegion": {"startLine": 33,
                                                                                     "snippet": {"text": "#include <features.h>\n"}}},
                                              "relationships": [{"target": 1,
                                                                 "kinds": ["includes"]},
                                                                {"target": 6,
                                                                 "kinds": ["isIncludedBy"]}],
                                              "id": 5},
                                             {"physicalLocation": {"artifactLocation": {"uri": "/usr/include/limits.h"},
                                                                   "region": {"startLine": 26},
                                                                   "contextRegion": {"startLine": 26,
                                                                                     "snippet": {"text": "#include <bits/libc-header-start.h>\n"}}},
                                              "relationships": [{"target": 5,
                                                                 "kinds": ["includes"]},
                                                                {"target": 7,
                                                                 "kinds": ["isIncludedBy"]}],
                                              "id": 6},
                                             {"physicalLocation": {"artifactLocation": {"uri": "/usr/lib/gcc/x86_64-redhat-linux/16/include/limits.h"},
                                                                   "region": {"startLine": 212},
                                                                   "contextRegion": {"startLine": 212,
                                                                                     "snippet": {"text": "#include_next <limits.h>\t\t/* recurse down to the real one */\n"}}},
                                              "relationships": [{"target": 6,
                                                                 "kinds": ["includes"]},
                                                                {"target": 8,
                                                                 "kinds": ["isIncludedBy"]}],
                                              "id": 7},
                                             {"physicalLocation": {"artifactLocation": {"uri": "/usr/lib/gcc/x86_64-redhat-linux/16/include/syslimits.h"},
                                                                   "region": {"startLine": 9},
                                                                   "contextRegion": {"startLine": 9,
                                                                                     "snippet": {"text": "#include_next <limits.h>\n"}}},
                                              "relationships": [{"target": 7,
                                                                 "kinds": ["includes"]},
                                                                {"target": 9,
                                                                 "kinds": ["isIncludedBy"]}],
                                              "id": 8},
                                             {"physicalLocation": {"artifactLocation": {"uri": "/usr/lib/gcc/x86_64-redhat-linux/16/include/limits.h"},
                                                                   "region": {"startLine": 34},
                                                                   "contextRegion": {"startLine": 34,
                                                                                     "snippet": {"text": "#include \"syslimits.h\"\n"}}},
                                              "relationships": [{"target": 8,
                                                                 "kinds": ["includes"]},
                                                                {"target": 10,
                                                                 "kinds": ["isIncludedBy"]}],
                                              "id": 9},
                                             {"physicalLocation": {"artifactLocation": {"uri": "/usr/include/gmp-x86_64.h"},
                                                                   "region": {"startLine": 57},
                                                                   "contextRegion": {"startLine": 57,
                                                                                     "snippet": {"text": "#include <limits.h>\n"}}},
                                              "relationships": [{"target": 9,
                                                                 "kinds": ["includes"]},
                                                                {"target": 11,
                                                                 "kinds": ["isIncludedBy"]}],
                                              "id": 10},
                                             {"physicalLocation": {"artifactLocation": {"uri": "/usr/include/gmp.h"},
                                                                   "region": {"startLine": 59},
                                                                   "contextRegion": {"startLine": 59,
                                                                                     "snippet": {"text": "#include \"gmp-x86_64.h\"\n"}}},
                                              "relationships": [{"target": 10,
                                                                 "kinds": ["includes"]},
                                                                {"target": 12,
                                                                 "kinds": ["isIncludedBy"]}],
                                              "id": 11},
                                             {"physicalLocation": {"artifactLocation": {"uri": "bs_size.c",
                                                                                        "uriBaseId": "PWD"},
                                                                   "region": {"startLine": 1},
                                                                   "contextRegion": {"startLine": 1,
                                                                                     "snippet": {"text": "#include <gmp.h>\n"}}},
                                              "relationships": [{"target": 11,
                                                                 "kinds": ["includes"]}],
                                              "id": 12}]}],
           "logicalLocations": [{"name": "bs_size_new_from_str",
                                 "fullyQualifiedName": "bs_size_new_from_str",
                                 "decoratedName": "bs_size_new_from_str",
                                 "kind": "function",
                                 "index": 0},
                                {"name": "replace_char_with_str",
                                 "fullyQualifiedName": "replace_char_with_str",
                                 "decoratedName": "replace_char_with_str",
                                 "kind": "function",
                                 "index": 1}]}]}
