12),
        *UL_MANLO_12(pld12),
        uint32_t ((*U_XT_12(pld12)) << 16)
    };

    if (round_mantissa(mantissa, 64))
    {
        // The MSB of the mantissa is explicit and should be 1
        // since we had a carry, the mantissa is now 0.
        mantissa[0] = MSB_ULONG;
        ++exponent;
    }

    *UL_MANHI_LD(result) = mantissa[0];
    *UL_MANLO_LD(result) = mantissa[1];
    *U_EXP_LD   (result) = sign | exponent;
}

extern "C" int __cdecl _atoldbl_l(_LDOUBLE* const result, char* const string, _locale_t const locale)
{
    _LocaleUpdate locale_update(locale);

    _LDBL12 intermediate_result{};
    SLD_STATUS const conversion_status = parse_floating_point(
        locale_update.GetLocaleT(),
        make_c_string_character_source(string, nullptr),
        &intermediate_result);

    convert_ld12_to_ldouble(&intermediate_result, result);
    return transform_into_return_value(conversion_status);
}

extern "C" int __cdecl _atoldbl(_LDOUBLE* const result, char* const string)
{
    return _atoldbl_l(result, string, nullptr);
}
