; LLVM IR from schostac/Advanced-Algorithms-and-Complexity :: week5 (heavy_hitters)

; 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.count_sketch = type { i32, i32, %"class.std::vector", %"class.std::vector.0", %"class.std::vector.5" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<funcs, std::allocator<funcs>>::_Vector_impl" }
%"struct.std::_Vector_base<funcs, std::allocator<funcs>>::_Vector_impl" = type { %"struct.std::_Vector_base<funcs, std::allocator<funcs>>::_Vector_impl_data" }
%"struct.std::_Vector_base<funcs, std::allocator<funcs>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::vector<long>, std::allocator<std::vector<long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<long>, std::allocator<std::vector<long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<long>, std::allocator<std::vector<long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<long>, std::allocator<std::vector<long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca %struct.count_sketch, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 80, ptr %6) #5
  %15 = load i64, ptr %2, align 8, !tbaa !5
  call void @_ZN12count_sketchC2El(ptr noundef nonnull align 8 dereferenceable(80) %6, i64 noundef %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !5
  br label %16

16:                                               ; preds = %26, %0
  %17 = load i64, ptr %7, align 8, !tbaa !5
  %18 = load i64, ptr %2, align 8, !tbaa !5
  %19 = icmp slt i64 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %33

21:                                               ; preds = %16
  %22 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %4, ptr noundef %5)
          to label %23 unwind label %29

23:                                               ; preds = %21
  %24 = load i64, ptr %4, align 8, !tbaa !5
  %25 = load i64, ptr %5, align 8, !tbaa !5
  call void @_ZN12count_sketch6updateEll(ptr noundef nonnull align 8 dereferenceable(80) %6, i64 noundef %24, i64 noundef %25) #5
  br label %26

26:                                               ; preds = %23
  %27 = load i64, ptr %7, align 8, !tbaa !5
  %28 = add nsw i64 %27, 1
  store i64 %28, ptr %7, align 8, !tbaa !5
  br label %16, !llvm.loop !9

29:                                               ; preds = %21
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %8, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %89

33:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 0, ptr %10, align 8, !tbaa !5
  br label %34

34:                                               ; preds = %45, %33
  %35 = load i64, ptr %10, align 8, !tbaa !5
  %36 = load i64, ptr %2, align 8, !tbaa !5
  %37 = icmp slt i64 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %52

39:                                               ; preds = %34
  %40 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %4, ptr noundef %5)
          to label %41 unwind label %48

41:                                               ; preds = %39
  %42 = load i64, ptr %4, align 8, !tbaa !5
  %43 = load i64, ptr %5, align 8, !tbaa !5
  %44 = sub nsw i64 0, %43
  call void @_ZN12count_sketch6updateEll(ptr noundef nonnull align 8 dereferenceable(80) %6, i64 noundef %42, i64 noundef %44) #5
  br label %45

45:                                               ; preds = %41
  %46 = load i64, ptr %10, align 8, !tbaa !5
  %47 = add nsw i64 %46, 1
  store i64 %47, ptr %10, align 8, !tbaa !5
  br label %34, !llvm.loop !11

48:                                               ; preds = %39
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %8, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %89

52:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !12
  %53 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %11)
          to label %54 unwind label %60

54:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !12
  br label %55

55:                                               ; preds = %77, %54
  %56 = load i32, ptr %12, align 4, !tbaa !12
  %57 = load i32, ptr %11, align 4, !tbaa !12
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %64, label %59

59:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %84

60:                                               ; preds = %84, %52
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %8, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %9, align 4
  br label %88

64:                                               ; preds = %55
  %65 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %13)
          to label %66 unwind label %80

66:                                               ; preds = %64
  %67 = load i32, ptr %13, align 4, !tbaa !12
  %68 = sext i32 %67 to i64
  %69 = call noundef i64 @_ZN12count_sketch8estimateEl(ptr noundef nonnull align 8 dereferenceable(80) %6, i64 noundef %68) #5
  %70 = load i64, ptr %3, align 8, !tbaa !5
  %71 = icmp sge i64 %69, %70
  %72 = zext i1 %71 to i64
  %73 = select i1 %71, i8 49, i8 48
  %74 = sext i8 %73 to i32
  %75 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %74)
          to label %76 unwind label %80

76:                                               ; preds = %66
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %12, align 4, !tbaa !12
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %12, align 4, !tbaa !12
  br label %55, !llvm.loop !14

80:                                               ; preds = %66, %64
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %8, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %88

84:                                               ; preds = %59
  %85 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.5)
          to label %86 unwind label %60

86:                                               ; preds = %84
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @_ZN12count_sketchD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %87 = load i32, ptr %1, align 4
  ret i32 %87

88:                                               ; preds = %80, %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %89

89:                                               ; preds = %88, %48, %29
  call void @_ZN12count_sketchD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %90

90:                                               ; preds = %89
  %91 = load ptr, ptr %8, align 8
  %92 = load i32, ptr %9, align 4
  %93 = insertvalue { ptr, i32 } poison, ptr %91, 0
  %94 = insertvalue { ptr, i32 } %93, i32 %92, 1
  resume { ptr, i32 } %94
}

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN12count_sketchC2El(ptr noundef nonnull align 8 dereferenceable(80), i64 noundef) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN12count_sketch6updateEll(ptr noundef nonnull align 8 dereferenceable(80), i64 noundef, i64 noundef) #3 align 2

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

declare i32 @printf(ptr noundef, ...) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN12count_sketch8estimateEl(ptr noundef nonnull align 8 dereferenceable(80), i64 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN12count_sketchD2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 align 2

attributes #0 = { mustprogress norecurse 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 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 #4 = { 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 #5 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !10}


; 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.count_sketch = type { i32, i32, %"class.std::vector", %"class.std::vector.0", %"class.std::vector.5" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<funcs, std::allocator<funcs>>::_Vector_impl" }
%"struct.std::_Vector_base<funcs, std::allocator<funcs>>::_Vector_impl" = type { %"struct.std::_Vector_base<funcs, std::allocator<funcs>>::_Vector_impl_data" }
%"struct.std::_Vector_base<funcs, std::allocator<funcs>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::vector<long>, std::allocator<std::vector<long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<long>, std::allocator<std::vector<long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<long>, std::allocator<std::vector<long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<long>, std::allocator<std::vector<long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %struct.count_sketch, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %5) #5
  %9 = load i64, ptr %1, align 8, !tbaa !5
  call void @_ZN12count_sketchC2El(ptr noundef nonnull align 8 dereferenceable(80) %5, i64 noundef %9) #5
  %10 = load i64, ptr %1, align 8, !tbaa !5
  %11 = icmp sgt i64 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

.preheader:                                       ; preds = %.lr.ph
  %12 = icmp sgt i64 %17, 0
  br i1 %12, label %.lr.ph11, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.089 = phi i64 [ %16, %.lr.ph ], [ 0, %0 ]
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %14 = load i64, ptr %3, align 8, !tbaa !5
  %15 = load i64, ptr %4, align 8, !tbaa !5
  call void @_ZN12count_sketch6updateEll(ptr noundef nonnull align 8 dereferenceable(80) %5, i64 noundef %14, i64 noundef %15) #5
  %16 = add nuw nsw i64 %.089, 1
  %17 = load i64, ptr %1, align 8, !tbaa !5
  %18 = icmp slt i64 %16, %17
  br i1 %18, label %.lr.ph, label %.preheader, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph11, %0, %.preheader
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  store i32 0, ptr %6, align 4, !tbaa !11
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %6)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  store i32 0, ptr %7, align 4, !tbaa !11
  %20 = load i32, ptr %6, align 4, !tbaa !11
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph14, label %._crit_edge15

.lr.ph11:                                         ; preds = %.preheader, %.lr.ph11
  %.0710 = phi i64 [ %26, %.lr.ph11 ], [ 0, %.preheader ]
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %23 = load i64, ptr %3, align 8, !tbaa !5
  %24 = load i64, ptr %4, align 8, !tbaa !5
  %25 = sub nsw i64 0, %24
  call void @_ZN12count_sketch6updateEll(ptr noundef nonnull align 8 dereferenceable(80) %5, i64 noundef %23, i64 noundef %25) #5
  %26 = add nuw nsw i64 %.0710, 1
  %27 = load i64, ptr %1, align 8, !tbaa !5
  %28 = icmp slt i64 %26, %27
  br i1 %28, label %.lr.ph11, label %._crit_edge, !llvm.loop !13

._crit_edge15:                                    ; preds = %.lr.ph14, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  %29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @_ZN12count_sketchD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 0

.lr.ph14:                                         ; preds = %._crit_edge, %.lr.ph14
  %.012 = phi i32 [ %37, %.lr.ph14 ], [ 0, %._crit_edge ]
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %7)
  %31 = load i32, ptr %7, align 4, !tbaa !11
  %32 = sext i32 %31 to i64
  %33 = call noundef i64 @_ZN12count_sketch8estimateEl(ptr noundef nonnull align 8 dereferenceable(80) %5, i64 noundef %32) #5
  %34 = load i64, ptr %2, align 8, !tbaa !5
  %.not = icmp slt i64 %33, %34
  %35 = select i1 %.not, i32 48, i32 49
  %36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %35)
  %37 = add nuw nsw i32 %.012, 1
  %38 = load i32, ptr %6, align 4, !tbaa !11
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %.lr.ph14, label %._crit_edge15, !llvm.loop !14
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN12count_sketchC2El(ptr noundef nonnull align 8 dereferenceable(80), i64 noundef) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN12count_sketch6updateEll(ptr noundef nonnull align 8 dereferenceable(80), i64 noundef, i64 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN12count_sketch8estimateEl(ptr noundef nonnull align 8 dereferenceable(80), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN12count_sketchD2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 align 2

attributes #0 = { mustprogress norecurse 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree 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 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 #4 = { 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 #5 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass