<commit_before>#pragma once
/*
* Copyright 2016 <NAME>
* Copyright 2017 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <cstdint>
#include <cassert>
#include <vector>

#ifdef __clang__
#define ZX_HAS_GCC_BUILTINS
#endif

namespace ZXing {
namespace BitHacks {

/**
* The code below is taken from https://graphics.stanford.edu/~seander/bithacks.html
* All credits go to <NAME> and other authors mentioned in that page.
*/

/// <summary>
/// Compute the number of zero bits on the left.
/// </summary>
inline int NumberOfLeadingZeros(uint32_t x)
{
	if (x == 0)
		return 32;
#ifdef ZX_HAS_GCC_BUILTINS
	return __builtin_ctz(x);
#else
	int n = 0;
	if ((x & 0xFFFF0000) == 0) { n = n + 16; x = x << 16; }
	if ((x & 0xFF000000) == 0) { n = n + 8; x = x << 8; }
	if ((x & 0xF0000000) == 0) { n = n + 4; x = x << 4; }
	if ((x & 0xC0000000) == 0) { n = n + 2; x = x << 2; }
	if ((x & 0x80000000) == 0) { n = n + 1; }
	return n;
#endif
}

/// <summary>
/// Compute the number of zero bits on the right.
/// </summary>
inline int NumberOfTrailingZeros(uint32_t v)<commit_msg>fix QRCode unit tests on clang<commit_after>#pragma once
/*
* Copyright 2016 <NAME>
* Copyright 2017 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <cstdint>
#include <cassert>
#include <vector>

#ifdef __clang__
#define ZX_HAS_GCC_BUILTINS
#endif

namespace ZXing {
namespace BitHacks {

/**
* The code below is taken from https://graphics.stanford.edu/~seander/bithacks.html
* All credits go to <NAME> and other authors mentioned in that page.
*/

/// <summary>
/// Compute the number of zero bits on the left.
/// </summary>
inline int NumberOfLeadingZeros(uint32_t x)
{
	if (x == 0)
		return 32;
#ifdef ZX_HAS_GCC_BUILTINS
	return __builtin_clz(x);
#else
	int n = 0;
	if ((x & 0xFFFF0000) == 0) { n = n + 16; x = x << 16; }
	if ((x & 0xFF000000) == 0) { n = n + 8; x = x << 8; }
	if ((x & 0xF0000000) == 0) { n = n + 4; x = x << 4; }
	if ((x & 0xC0000000) == 0) { n = n + 2; x = x << 2; }
	if ((x & 0x80000000) == 0) { n = n + 1; }
	return n;
#endif
}

/// <summary>
/// Compute the number of zero bits on the right.
/// </summary>
inline int NumberOfTrailingZeros(uint32_t v)
{'fraction_non_alphanumeric': 0.13132265158655357, 'fraction_numerical': 0.04586867734841345, 'mean_word_length': 3.509915014164306, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 23, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 6, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1413939', 'n_tokens_mistral': 1217, 'n_tokens_neox': 1080, 'n_words': 430}