; LLVM IR from martinus/nanobench :: src/comparisons/nanobench/main.ll (ZN6ankerl9nanobench6detail19PerformanceCountersC2Ev)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.ankerl::nanobench::detail::LinuxPerformanceCounters::Target" = type <{ ptr, i8, i8, [6 x i8] }>
%class.anon = type { i8 }
%"struct.ankerl::nanobench::detail::PerfCountSet.20" = type { i8, i8, i8, i8, i8, i8 }
%"class.ankerl::nanobench::detail::PerformanceCounters" = type <{ ptr, %"struct.ankerl::nanobench::detail::PerfCountSet", %"struct.ankerl::nanobench::detail::PerfCountSet.20", [2 x i8] }>
%"struct.ankerl::nanobench::detail::PerfCountSet" = type { i64, i64, i64, i64, i64, i64 }

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters7monitorE11perf_sw_idsNS2_6TargetE(ptr noundef nonnull align 8 dereferenceable(141), i32 noundef, ptr, i64) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters7monitorE10perf_hw_idNS2_6TargetE(ptr noundef nonnull align 8 dereferenceable(141), i32 noundef, ptr, i64) #4 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6ankerl9nanobench6detail19PerformanceCountersC2Ev(ptr noundef nonnull align 8 dereferenceable(62) %0) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"struct.ankerl::nanobench::detail::LinuxPerformanceCounters::Target", align 8
  %6 = alloca %"struct.ankerl::nanobench::detail::LinuxPerformanceCounters::Target", align 8
  %7 = alloca %"struct.ankerl::nanobench::detail::LinuxPerformanceCounters::Target", align 8
  %8 = alloca %"struct.ankerl::nanobench::detail::LinuxPerformanceCounters::Target", align 8
  %9 = alloca %"struct.ankerl::nanobench::detail::LinuxPerformanceCounters::Target", align 8
  %10 = alloca %"struct.ankerl::nanobench::detail::LinuxPerformanceCounters::Target", align 8
  %11 = alloca %"struct.ankerl::nanobench::detail::LinuxPerformanceCounters::Target", align 8
  %12 = alloca %class.anon, align 1
  %13 = alloca %"struct.ankerl::nanobench::detail::PerfCountSet.20", align 1
  store ptr %0, ptr %2, align 8, !tbaa !5
  %14 = load ptr, ptr %2, align 8
  %15 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 0
  %16 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 144) #8
  call void @llvm.memset.p0.i64(ptr align 16 %16, i8 0, i64 144, i1 false)
  invoke void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCountersC2Ev(ptr noundef nonnull align 8 dereferenceable(141) %16)
          to label %17 unwind label %49

17:                                               ; preds = %1
  store ptr %16, ptr %15, align 8, !tbaa !9
  %18 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 1
  call void @llvm.memset.p0.i64(ptr align 8 %18, i8 0, i64 48, i1 false)
  call void @_ZN6ankerl9nanobench6detail12PerfCountSetImEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %18) #9
  %19 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 2
  call void @llvm.memset.p0.i64(ptr align 8 %19, i8 0, i64 6, i1 false)
  call void @_ZN6ankerl9nanobench6detail12PerfCountSetIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(6) %19) #9
  %20 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 0
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 1
  %23 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet", ptr %22, i32 0, i32 1
  call void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters6TargetC2EPmbb(ptr noundef nonnull align 8 dereferenceable(10) %5, ptr noundef %23, i1 noundef zeroext true, i1 noundef zeroext false)
  %24 = getelementptr inbounds { ptr, i64 }, ptr %5, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8
  %26 = getelementptr inbounds { ptr, i64 }, ptr %5, i32 0, i32 1
  %27 = load i64, ptr %26, align 8
  %28 = call noundef zeroext i1 @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters7monitorE10perf_hw_idNS2_6TargetE(ptr noundef nonnull align 8 dereferenceable(141) %21, i32 noundef 9, ptr %25, i64 %27)
  %29 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 2
  %30 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet.20", ptr %29, i32 0, i32 1
  %31 = zext i1 %28 to i8
  store i8 %31, ptr %30, align 1, !tbaa !15
  %32 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 2
  %33 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet.20", ptr %32, i32 0, i32 1
  %34 = load i8, ptr %33, align 1, !tbaa !15, !range !16, !noundef !17
  %35 = trunc i8 %34 to i1
  br i1 %35, label %53, label %36

36:                                               ; preds = %17
  %37 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 0
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  %39 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 1
  %40 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet", ptr %39, i32 0, i32 1
  call void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters6TargetC2EPmbb(ptr noundef nonnull align 8 dereferenceable(10) %6, ptr noundef %40, i1 noundef zeroext true, i1 noundef zeroext false)
  %41 = getelementptr inbounds { ptr, i64 }, ptr %6, i32 0, i32 0
  %42 = load ptr, ptr %41, align 8
  %43 = getelementptr inbounds { ptr, i64 }, ptr %6, i32 0, i32 1
  %44 = load i64, ptr %43, align 8
  %45 = call noundef zeroext i1 @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters7monitorE10perf_hw_idNS2_6TargetE(ptr noundef nonnull align 8 dereferenceable(141) %38, i32 noundef 0, ptr %42, i64 %44)
  %46 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 2
  %47 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet.20", ptr %46, i32 0, i32 1
  %48 = zext i1 %45 to i8
  store i8 %48, ptr %47, align 1, !tbaa !15
  br label %53

49:                                               ; preds = %1
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %3, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %4, align 4
  call void @_ZdlPvm(ptr noundef %16, i64 noundef 144) #10
  br label %130

53:                                               ; preds = %36, %17
  %54 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 0
  %55 = load ptr, ptr %54, align 8, !tbaa !9
  %56 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 1
  %57 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet", ptr %56, i32 0, i32 3
  call void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters6TargetC2EPmbb(ptr noundef nonnull align 8 dereferenceable(10) %7, ptr noundef %57, i1 noundef zeroext true, i1 noundef zeroext true)
  %58 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8
  %60 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 1
  %61 = load i64, ptr %60, align 8
  %62 = call noundef zeroext i1 @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters7monitorE10perf_hw_idNS2_6TargetE(ptr noundef nonnull align 8 dereferenceable(141) %55, i32 noundef 1, ptr %59, i64 %61)
  %63 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 2
  %64 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet.20", ptr %63, i32 0, i32 3
  %65 = zext i1 %62 to i8
  store i8 %65, ptr %64, align 1, !tbaa !18
  %66 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8, !tbaa !9
  %68 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 1
  %69 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet", ptr %68, i32 0, i32 4
  call void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters6TargetC2EPmbb(ptr noundef nonnull align 8 dereferenceable(10) %8, ptr noundef %69, i1 noundef zeroext true, i1 noundef zeroext false)
  %70 = getelementptr inbounds { ptr, i64 }, ptr %8, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8
  %72 = getelementptr inbounds { ptr, i64 }, ptr %8, i32 0, i32 1
  %73 = load i64, ptr %72, align 8
  %74 = call noundef zeroext i1 @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters7monitorE10perf_hw_idNS2_6TargetE(ptr noundef nonnull align 8 dereferenceable(141) %67, i32 noundef 4, ptr %71, i64 %73)
  %75 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 2
  %76 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet.20", ptr %75, i32 0, i32 4
  %77 = zext i1 %74 to i8
  store i8 %77, ptr %76, align 4, !tbaa !19
  %78 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8, !tbaa !9
  %80 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 1
  %81 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet", ptr %80, i32 0, i32 5
  call void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters6TargetC2EPmbb(ptr noundef nonnull align 8 dereferenceable(10) %9, ptr noundef %81, i1 noundef zeroext true, i1 noundef zeroext false)
  %82 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 0
  %83 = load ptr, ptr %82, align 8
  %84 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 1
  %85 = load i64, ptr %84, align 8
  %86 = call noundef zeroext i1 @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters7monitorE10perf_hw_idNS2_6TargetE(ptr noundef nonnull align 8 dereferenceable(141) %79, i32 noundef 5, ptr %83, i64 %85)
  %87 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 2
  %88 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet.20", ptr %87, i32 0, i32 5
  %89 = zext i1 %86 to i8
  store i8 %89, ptr %88, align 1, !tbaa !20
  %90 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 0
  %91 = load ptr, ptr %90, align 8, !tbaa !9
  %92 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 1
  %93 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet", ptr %92, i32 0, i32 0
  call void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters6TargetC2EPmbb(ptr noundef nonnull align 8 dereferenceable(10) %10, ptr noundef %93, i1 noundef zeroext true, i1 noundef zeroext false)
  %94 = getelementptr inbounds { ptr, i64 }, ptr %10, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8
  %96 = getelementptr inbounds { ptr, i64 }, ptr %10, i32 0, i32 1
  %97 = load i64, ptr %96, align 8
  %98 = call noundef zeroext i1 @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters7monitorE11perf_sw_idsNS2_6TargetE(ptr noundef nonnull align 8 dereferenceable(141) %91, i32 noundef 2, ptr %95, i64 %97)
  %99 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 2
  %100 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet.20", ptr %99, i32 0, i32 0
  %101 = zext i1 %98 to i8
  store i8 %101, ptr %100, align 8, !tbaa !21
  %102 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 0
  %103 = load ptr, ptr %102, align 8, !tbaa !9
  %104 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 1
  %105 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet", ptr %104, i32 0, i32 2
  call void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters6TargetC2EPmbb(ptr noundef nonnull align 8 dereferenceable(10) %11, ptr noundef %105, i1 noundef zeroext true, i1 noundef zeroext false)
  %106 = getelementptr inbounds { ptr, i64 }, ptr %11, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8
  %108 = getelementptr inbounds { ptr, i64 }, ptr %11, i32 0, i32 1
  %109 = load i64, ptr %108, align 8
  %110 = call noundef zeroext i1 @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters7monitorE11perf_sw_idsNS2_6TargetE(ptr noundef nonnull align 8 dereferenceable(141) %103, i32 noundef 3, ptr %107, i64 %109)
  %111 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 2
  %112 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet.20", ptr %111, i32 0, i32 2
  %113 = zext i1 %110 to i8
  store i8 %113, ptr %112, align 2, !tbaa !22
  %114 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 0
  %115 = load ptr, ptr %114, align 8, !tbaa !9
  call void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters5startEv(ptr noundef nonnull align 8 dereferenceable(141) %115)
  %116 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 0
  %117 = load ptr, ptr %116, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #9
  call void @"_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters9calibrateIZNS1_19PerformanceCountersC1EvE3$_0EEvOT_"(ptr noundef nonnull align 8 dereferenceable(141) %117, ptr noundef nonnull align 1 dereferenceable(1) %12)
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #9
  %118 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !9
  %120 = call noundef zeroext i1 @_ZNK6ankerl9nanobench6detail24LinuxPerformanceCounters8hasErrorEv(ptr noundef nonnull align 8 dereferenceable(141) %119) #9
  br i1 %120, label %121, label %129

121:                                              ; preds = %53
  call void @llvm.lifetime.start.p0(i64 6, ptr %13) #9
  %122 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet.20", ptr %13, i32 0, i32 0
  store i8 0, ptr %122, align 1, !tbaa !23
  %123 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet.20", ptr %13, i32 0, i32 1
  store i8 0, ptr %123, align 1, !tbaa !24
  %124 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet.20", ptr %13, i32 0, i32 2
  store i8 0, ptr %124, align 1, !tbaa !25
  %125 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet.20", ptr %13, i32 0, i32 3
  store i8 0, ptr %125, align 1, !tbaa !26
  %126 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet.20", ptr %13, i32 0, i32 4
  store i8 0, ptr %126, align 1, !tbaa !27
  %127 = getelementptr inbounds %"struct.ankerl::nanobench::detail::PerfCountSet.20", ptr %13, i32 0, i32 5
  store i8 0, ptr %127, align 1, !tbaa !28
  %128 = getelementptr inbounds %"class.ankerl::nanobench::detail::PerformanceCounters", ptr %14, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %128, ptr align 1 %13, i64 6, i1 false), !tbaa.struct !29
  call void @llvm.lifetime.end.p0(i64 6, ptr %13) #9
  br label %129

129:                                              ; preds = %121, %53
  ret void

130:                                              ; preds = %49
  %131 = load ptr, ptr %3, align 8
  %132 = load i32, ptr %4, align 4
  %133 = insertvalue { ptr, i32 } poison, ptr %131, 0
  %134 = insertvalue { ptr, i32 } %133, i32 %132, 1
  resume { ptr, i32 } %134
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCountersC2Ev(ptr noundef nonnull align 8 dereferenceable(141)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6ankerl9nanobench6detail12PerfCountSetImEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6ankerl9nanobench6detail12PerfCountSetIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(6)) unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters6TargetC2EPmbb(ptr noundef nonnull align 8 dereferenceable(10), ptr noundef, i1 noundef zeroext, i1 noundef zeroext) unnamed_addr #7 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters5startEv(ptr noundef nonnull align 8 dereferenceable(141)) #6 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters9calibrateIZNS1_19PerformanceCountersC1EvE3$_0EEvOT_"(ptr noundef nonnull align 8 dereferenceable(141), ptr noundef nonnull align 1 dereferenceable(1)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6ankerl9nanobench6detail24LinuxPerformanceCounters8hasErrorEv(ptr noundef nonnull align 8 dereferenceable(141)) #7 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { nounwind }
attributes #10 = { builtin nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSN6ankerl9nanobench6detail19PerformanceCountersE", !6, i64 0, !11, i64 8, !13, i64 56}
!11 = !{!"_ZTSN6ankerl9nanobench6detail12PerfCountSetImEE", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40}
!12 = !{!"long", !7, i64 0}
!13 = !{!"_ZTSN6ankerl9nanobench6detail12PerfCountSetIbEE", !14, i64 0, !14, i64 1, !14, i64 2, !14, i64 3, !14, i64 4, !14, i64 5}
!14 = !{!"bool", !7, i64 0}
!15 = !{!10, !14, i64 57}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!10, !14, i64 59}
!19 = !{!10, !14, i64 60}
!20 = !{!10, !14, i64 61}
!21 = !{!10, !14, i64 56}
!22 = !{!10, !14, i64 58}
!23 = !{!13, !14, i64 0}
!24 = !{!13, !14, i64 1}
!25 = !{!13, !14, i64 2}
!26 = !{!13, !14, i64 3}
!27 = !{!13, !14, i64 4}
!28 = !{!13, !14, i64 5}
!29 = !{i64 0, i64 1, !30, i64 1, i64 1, !30, i64 2, i64 1, !30, i64 3, i64 1, !30, i64 4, i64 1, !30, i64 5, i64 1, !30}
!30 = !{!14, !14, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.ankerl::nanobench::detail::LinuxPerformanceCounters::Target" = type <{ ptr, i8, i8, [6 x i8] }>
%class.anon = type { i8 }

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters7monitorE11perf_sw_idsNS2_6TargetE(ptr noundef nonnull align 8 dereferenceable(141), i32 noundef, ptr, i64) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters7monitorE10perf_hw_idNS2_6TargetE(ptr noundef nonnull align 8 dereferenceable(141), i32 noundef, ptr, i64) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6ankerl9nanobench6detail19PerformanceCountersC2Ev(ptr noundef nonnull align 8 dereferenceable(62) %0) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"struct.ankerl::nanobench::detail::LinuxPerformanceCounters::Target", align 8
  %3 = alloca %"struct.ankerl::nanobench::detail::LinuxPerformanceCounters::Target", align 8
  %4 = alloca %"struct.ankerl::nanobench::detail::LinuxPerformanceCounters::Target", align 8
  %5 = alloca %"struct.ankerl::nanobench::detail::LinuxPerformanceCounters::Target", align 8
  %6 = alloca %"struct.ankerl::nanobench::detail::LinuxPerformanceCounters::Target", align 8
  %7 = alloca %"struct.ankerl::nanobench::detail::LinuxPerformanceCounters::Target", align 8
  %8 = alloca %"struct.ankerl::nanobench::detail::LinuxPerformanceCounters::Target", align 8
  %9 = alloca %class.anon, align 1
  %10 = tail call noalias noundef nonnull dereferenceable(144) ptr @_Znwm(i64 noundef 144) #7
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(144) %10, i8 0, i64 144, i1 false)
  invoke void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCountersC2Ev(ptr noundef nonnull align 8 dereferenceable(141) %10)
          to label %11 unwind label %29

11:                                               ; preds = %1
  store ptr %10, ptr %0, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %12, i8 0, i64 48, i1 false)
  tail call void @_ZN6ankerl9nanobench6detail12PerfCountSetImEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #8
  %13 = getelementptr inbounds i8, ptr %0, i64 56
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(6) %13, i8 0, i64 6, i1 false)
  tail call void @_ZN6ankerl9nanobench6detail12PerfCountSetIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(6) %13) #8
  %14 = load ptr, ptr %0, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  call void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters6TargetC2EPmbb(ptr noundef nonnull align 8 dereferenceable(10) %2, ptr noundef nonnull %15, i1 noundef zeroext true, i1 noundef zeroext false)
  %16 = load ptr, ptr %2, align 8
  %17 = getelementptr inbounds i8, ptr %2, i64 8
  %18 = load i64, ptr %17, align 8
  %19 = call noundef zeroext i1 @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters7monitorE10perf_hw_idNS2_6TargetE(ptr noundef nonnull align 8 dereferenceable(141) %14, i32 noundef 9, ptr %16, i64 %18)
  %20 = getelementptr inbounds i8, ptr %0, i64 57
  %21 = zext i1 %19 to i8
  store i8 %21, ptr %20, align 1, !tbaa !14
  br i1 %19, label %31, label %22

22:                                               ; preds = %11
  %23 = load ptr, ptr %0, align 8, !tbaa !5
  call void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters6TargetC2EPmbb(ptr noundef nonnull align 8 dereferenceable(10) %3, ptr noundef nonnull %15, i1 noundef zeroext true, i1 noundef zeroext false)
  %24 = load ptr, ptr %3, align 8
  %25 = getelementptr inbounds i8, ptr %3, i64 8
  %26 = load i64, ptr %25, align 8
  %27 = call noundef zeroext i1 @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters7monitorE10perf_hw_idNS2_6TargetE(ptr noundef nonnull align 8 dereferenceable(141) %23, i32 noundef 0, ptr %24, i64 %26)
  %28 = zext i1 %27 to i8
  store i8 %28, ptr %20, align 1, !tbaa !14
  br label %31

29:                                               ; preds = %1
  %30 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %10, i64 noundef 144) #9
  resume { ptr, i32 } %30

31:                                               ; preds = %22, %11
  %32 = load ptr, ptr %0, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %0, i64 32
  call void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters6TargetC2EPmbb(ptr noundef nonnull align 8 dereferenceable(10) %4, ptr noundef nonnull %33, i1 noundef zeroext true, i1 noundef zeroext true)
  %34 = load ptr, ptr %4, align 8
  %35 = getelementptr inbounds i8, ptr %4, i64 8
  %36 = load i64, ptr %35, align 8
  %37 = call noundef zeroext i1 @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters7monitorE10perf_hw_idNS2_6TargetE(ptr noundef nonnull align 8 dereferenceable(141) %32, i32 noundef 1, ptr %34, i64 %36)
  %38 = getelementptr inbounds i8, ptr %0, i64 59
  %39 = zext i1 %37 to i8
  store i8 %39, ptr %38, align 1, !tbaa !15
  %40 = load ptr, ptr %0, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %0, i64 40
  call void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters6TargetC2EPmbb(ptr noundef nonnull align 8 dereferenceable(10) %5, ptr noundef nonnull %41, i1 noundef zeroext true, i1 noundef zeroext false)
  %42 = load ptr, ptr %5, align 8
  %43 = getelementptr inbounds i8, ptr %5, i64 8
  %44 = load i64, ptr %43, align 8
  %45 = call noundef zeroext i1 @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters7monitorE10perf_hw_idNS2_6TargetE(ptr noundef nonnull align 8 dereferenceable(141) %40, i32 noundef 4, ptr %42, i64 %44)
  %46 = getelementptr inbounds i8, ptr %0, i64 60
  %47 = zext i1 %45 to i8
  store i8 %47, ptr %46, align 4, !tbaa !16
  %48 = load ptr, ptr %0, align 8, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %0, i64 48
  call void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters6TargetC2EPmbb(ptr noundef nonnull align 8 dereferenceable(10) %6, ptr noundef nonnull %49, i1 noundef zeroext true, i1 noundef zeroext false)
  %50 = load ptr, ptr %6, align 8
  %51 = getelementptr inbounds i8, ptr %6, i64 8
  %52 = load i64, ptr %51, align 8
  %53 = call noundef zeroext i1 @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters7monitorE10perf_hw_idNS2_6TargetE(ptr noundef nonnull align 8 dereferenceable(141) %48, i32 noundef 5, ptr %50, i64 %52)
  %54 = getelementptr inbounds i8, ptr %0, i64 61
  %55 = zext i1 %53 to i8
  store i8 %55, ptr %54, align 1, !tbaa !17
  %56 = load ptr, ptr %0, align 8, !tbaa !5
  call void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters6TargetC2EPmbb(ptr noundef nonnull align 8 dereferenceable(10) %7, ptr noundef nonnull %12, i1 noundef zeroext true, i1 noundef zeroext false)
  %57 = load ptr, ptr %7, align 8
  %58 = getelementptr inbounds i8, ptr %7, i64 8
  %59 = load i64, ptr %58, align 8
  %60 = call noundef zeroext i1 @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters7monitorE11perf_sw_idsNS2_6TargetE(ptr noundef nonnull align 8 dereferenceable(141) %56, i32 noundef 2, ptr %57, i64 %59)
  %61 = zext i1 %60 to i8
  store i8 %61, ptr %13, align 8, !tbaa !18
  %62 = load ptr, ptr %0, align 8, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %0, i64 24
  call void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters6TargetC2EPmbb(ptr noundef nonnull align 8 dereferenceable(10) %8, ptr noundef nonnull %63, i1 noundef zeroext true, i1 noundef zeroext false)
  %64 = load ptr, ptr %8, align 8
  %65 = getelementptr inbounds i8, ptr %8, i64 8
  %66 = load i64, ptr %65, align 8
  %67 = call noundef zeroext i1 @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters7monitorE11perf_sw_idsNS2_6TargetE(ptr noundef nonnull align 8 dereferenceable(141) %62, i32 noundef 3, ptr %64, i64 %66)
  %68 = getelementptr inbounds i8, ptr %0, i64 58
  %69 = zext i1 %67 to i8
  store i8 %69, ptr %68, align 2, !tbaa !19
  %70 = load ptr, ptr %0, align 8, !tbaa !5
  call void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters5startEv(ptr noundef nonnull align 8 dereferenceable(141) %70)
  %71 = load ptr, ptr %0, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #8
  call void @"_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters9calibrateIZNS1_19PerformanceCountersC1EvE3$_0EEvOT_"(ptr noundef nonnull align 8 dereferenceable(141) %71, ptr noundef nonnull align 1 dereferenceable(1) %9)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #8
  %72 = load ptr, ptr %0, align 8, !tbaa !5
  %73 = call noundef zeroext i1 @_ZNK6ankerl9nanobench6detail24LinuxPerformanceCounters8hasErrorEv(ptr noundef nonnull align 8 dereferenceable(141) %72) #8
  br i1 %73, label %74, label %75

74:                                               ; preds = %31
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(6) %13, i8 0, i64 6, i1 false)
  br label %75

75:                                               ; preds = %74, %31
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCountersC2Ev(ptr noundef nonnull align 8 dereferenceable(141)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6ankerl9nanobench6detail12PerfCountSetImEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6ankerl9nanobench6detail12PerfCountSetIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(6)) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters6TargetC2EPmbb(ptr noundef nonnull align 8 dereferenceable(10), ptr noundef, i1 noundef zeroext, i1 noundef zeroext) unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters5startEv(ptr noundef nonnull align 8 dereferenceable(141)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZN6ankerl9nanobench6detail24LinuxPerformanceCounters9calibrateIZNS1_19PerformanceCountersC1EvE3$_0EEvOT_"(ptr noundef nonnull align 8 dereferenceable(141), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6ankerl9nanobench6detail24LinuxPerformanceCounters8hasErrorEv(ptr noundef nonnull align 8 dereferenceable(141)) local_unnamed_addr #6 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { nounwind }
attributes #9 = { builtin nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN6ankerl9nanobench6detail19PerformanceCountersE", !7, i64 0, !10, i64 8, !12, i64 56}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN6ankerl9nanobench6detail12PerfCountSetImEE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40}
!11 = !{!"long", !8, i64 0}
!12 = !{!"_ZTSN6ankerl9nanobench6detail12PerfCountSetIbEE", !13, i64 0, !13, i64 1, !13, i64 2, !13, i64 3, !13, i64 4, !13, i64 5}
!13 = !{!"bool", !8, i64 0}
!14 = !{!6, !13, i64 57}
!15 = !{!6, !13, i64 59}
!16 = !{!6, !13, i64 60}
!17 = !{!6, !13, i64 61}
!18 = !{!6, !13, i64 56}
!19 = !{!6, !13, i64 58}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,SROAPass,SimplifyCFGPass,TailCallElimPass