<commit_before>class Cbmc < Formula
  desc "C Bounded Model Checker"
  homepage "https://www.cprover.org/cbmc/"
  url "https://github.com/diffblue/cbmc.git",
      tag:      "cbmc-5.66.0",
      revision: "c3a57ec2671f603f81ae2cd593edef1ae1abcf52"
  license "BSD-4-Clause"

  bottle do
    rebuild 1
    sha256 cellar: :any_skip_relocation, arm64_monterey: "681196a0001f7f6707163e620c09a1ecf4436d6ba5c64767991c16fea3a2ff0d"
    sha256 cellar: :any_skip_relocation, arm64_big_sur:  "5a88ddeabf9a9a2f9652f032a8169b74dd2e4a4e321515700f1ea19a56d58047"
    sha256 cellar: :any_skip_relocation, monterey:       "373f656b44f4aa23f054a73e12e6fced32852cbe3880b6e7b46f98e3fff5ae84"
    sha256 cellar: :any_skip_relocation, big_sur:        "54aad00c5ffe6de24513a5de302400c02fbc690ce221261a491f7a1585c97d65"
    sha256 cellar: :any_skip_relocation, catalina:       "be81f9eac4eb81e34ffbc549d32496e50f16f276a8f30adf17ee74a3b3157464"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "d707e99de9e978ea6a6e676f7b7a36cb4ed56dfb7fa5b0268ae999be8c3aa26f"
  end

  depends_on "cmake" => :build
  depends_on "maven" => :build
  depends_on "openjdk" => :build

  uses_from_macos "bison" => :build
  uses_from_macos "flex" => :build

  fails_with gcc: "5"

  def install
    system "cmake", "-S", ".", "-B", "build", *std_cmake_args
    system "cmake", "--build", "build"
    system "cmake", "--install", "build"

    # lib contains only `jar` files
    libexec.install lib
  end

  test do
    # Find a pointer out of bounds error
    (testpath/"main.c").write <<~EOS
      #include <stdlib.h>
      int main() {
        char *ptr = malloc(10);
        char c = ptr[10];
      }
    EOS
    assert_match "VERIFICATION FAILED",
                 shell_output("#{bin}/cbmc --pointer-check main.c", 10)
  end
end
<commit_msg>cbmc: update 5.66.0 bottle.<commit_after>class Cbmc < Formula
  desc "C Bounded Model Checker"
  homepage "https://www.cprover.org/cbmc/"
  url "https://github.com/diffblue/cbmc.git",
      tag:      "cbmc-5.66.0",
      revision: "c3a57ec2671f603f81ae2cd593edef1ae1abcf52"
  license "BSD-4-Clause"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_monterey: "f5aba8c8e8bc82b556cc3456c07f761808caa2b356ae4ad14e6c5e03c8aa02ac"
    sha256 cellar: :any_skip_relocation, arm64_big_sur:  "551479bc988b89bf9b0de68b7ec9a0f7d1b13c5d238d357e787d06b1e5085e1c"
    sha256 cellar: :any_skip_relocation, monterey:       "1878512a2eda0421992fec6ef20c20fabf24d12111a10e5c133355508add2bc4"
    sha256 cellar: :any_skip_relocation, big_sur:        "9c9de6d8f95e9c3e2a5df9025a6aba33b0c2dc9d78a17dfe7eace203613e68dd"
    sha256 cellar: :any_skip_relocation, catalina:       "a85ce39c82532da682825b8e6a92f4ec18b8957361c2c642c4df915f2a95b42b"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "9081d9bac9f3dcdf63efab17f6fd035759ac22aa9d69cde81ad697be232c9a44"
  end

  depends_on "cmake" => :build
  depends_on "maven" => :build
  depends_on "openjdk" => :build

  uses_from_macos "bison" => :build
  uses_from_macos "flex" => :build

  fails_with gcc: "5"

  def install
    system "cmake", "-S", ".", "-B", "build", *std_cmake_args
    system "cmake", "--build", "build"
    system "cmake", "--install", "build"

    # lib contains only `jar` files
    libexec.install lib
  end

  test do
    # Find a pointer out of bounds error
    (testpath/"main.c").write <<~EOS
      #include <stdlib.h>
      int main() {
        char *ptr = malloc(10);
        char c = ptr[10];
      }
    EOS
    assert_match "VERIFICATION FAILED",
                 shell_output("#{bin}/cbmc --pointer-check main.c", 10)
  end
end

{'fraction_non_alphanumeric': 0.10625345877144439, 'fraction_numerical': 0.16076369673491975, 'mean_word_length': 3.931787175989086, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '5773203', 'n_tokens_mistral': 1830, 'n_tokens_neox': 1543, 'n_words': 253}