; LLVM IR from xtaci/algorithms :: src (bloom_filter_demo)

; 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"

%"class.alg::BloomFilter" = type { i32, i32, %"class.alg::BitSet", [8 x %"struct.alg::UHash"] }
%"class.alg::BitSet" = type { i32, i32, ptr }
%"struct.alg::UHash" = type { [64 x i32], i32 }

@__const.main.strs = external hidden unnamed_addr constant [8 x ptr], align 16
@__const.main.strs2 = external hidden unnamed_addr constant [2 x ptr], align 16
@.str.8 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 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 [8 x ptr], align 16
  %3 = alloca [2 x ptr], align 16
  %4 = alloca i32, align 4
  %5 = alloca %"class.alg::BloomFilter", align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 64, ptr %2) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %2, ptr align 16 @__const.main.strs, i64 64, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %3, ptr align 16 @__const.main.strs2, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 8, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2104, ptr %5) #6
  %10 = load i32, ptr %4, align 4, !tbaa !5
  %11 = mul i32 %10, 10
  %12 = load i32, ptr %4, align 4, !tbaa !5
  call void @_ZN3alg11BloomFilterILj8EEC2Ejj(ptr noundef nonnull align 8 dereferenceable(2104) %5, i32 noundef %11, i32 noundef %12)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %30, %0
  %14 = load i32, ptr %6, align 4, !tbaa !5
  %15 = load i32, ptr %4, align 4, !tbaa !5
  %16 = icmp ult i32 %14, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %37

18:                                               ; preds = %13
  %19 = load i32, ptr %6, align 4, !tbaa !5
  %20 = zext i32 %19 to i64
  %21 = getelementptr inbounds [8 x ptr], ptr %2, i64 0, i64 %20
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  invoke void @_ZN3alg11BloomFilterILj8EE3setEPKc(ptr noundef nonnull align 8 dereferenceable(2104) %5, ptr noundef %22)
          to label %23 unwind label %33

23:                                               ; preds = %18
  %24 = load i32, ptr %6, align 4, !tbaa !5
  %25 = zext i32 %24 to i64
  %26 = getelementptr inbounds [8 x ptr], ptr %2, i64 0, i64 %25
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.8, ptr noundef %27)
          to label %29 unwind label %33

29:                                               ; preds = %23
  br label %30

30:                                               ; preds = %29
  %31 = load i32, ptr %6, align 4, !tbaa !5
  %32 = add i32 %31, 1
  store i32 %32, ptr %6, align 4, !tbaa !5
  br label %13, !llvm.loop !11

33:                                               ; preds = %23, %18
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %7, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %67

37:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %58, %37
  %39 = load i32, ptr %9, align 4, !tbaa !5
  %40 = zext i32 %39 to i64
  %41 = icmp ult i64 %40, 2
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %65

43:                                               ; preds = %38
  %44 = load i32, ptr %9, align 4, !tbaa !5
  %45 = zext i32 %44 to i64
  %46 = getelementptr inbounds [2 x ptr], ptr %3, i64 0, i64 %45
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  %48 = load i32, ptr %9, align 4, !tbaa !5
  %49 = zext i32 %48 to i64
  %50 = getelementptr inbounds [2 x ptr], ptr %3, i64 0, i64 %49
  %51 = load ptr, ptr %50, align 8, !tbaa !9
  %52 = invoke noundef zeroext i1 @_ZN3alg11BloomFilterILj8EE4testEPKc(ptr noundef nonnull align 8 dereferenceable(2104) %5, ptr noundef %51)
          to label %53 unwind label %61

53:                                               ; preds = %43
  %54 = zext i1 %52 to i64
  %55 = select i1 %52, ptr @.str.10, ptr @.str.11
  %56 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.9, ptr noundef %47, ptr noundef %55)
          to label %57 unwind label %61

57:                                               ; preds = %53
  br label %58

58:                                               ; preds = %57
  %59 = load i32, ptr %9, align 4, !tbaa !5
  %60 = add i32 %59, 1
  store i32 %60, ptr %9, align 4, !tbaa !5
  br label %38, !llvm.loop !13

61:                                               ; preds = %53, %43
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %7, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %67

65:                                               ; preds = %42
  store i32 0, ptr %1, align 4
  call void @_ZN3alg11BloomFilterILj8EED2Ev(ptr noundef nonnull align 8 dereferenceable(2104) %5) #6
  call void @llvm.lifetime.end.p0(i64 2104, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %2) #6
  %66 = load i32, ptr %1, align 4
  ret i32 %66

67:                                               ; preds = %61, %33
  call void @_ZN3alg11BloomFilterILj8EED2Ev(ptr noundef nonnull align 8 dereferenceable(2104) %5) #6
  call void @llvm.lifetime.end.p0(i64 2104, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %2) #6
  br label %68

68:                                               ; preds = %67
  %69 = load ptr, ptr %7, align 8
  %70 = load i32, ptr %8, align 4
  %71 = insertvalue { ptr, i32 } poison, ptr %69, 0
  %72 = insertvalue { ptr, i32 } %71, i32 %70, 1
  resume { ptr, i32 } %72
}

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

; 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) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3alg11BloomFilterILj8EEC2Ejj(ptr noundef nonnull align 8 dereferenceable(2104), i32 noundef, i32 noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3alg11BloomFilterILj8EE3setEPKc(ptr noundef nonnull align 8 dereferenceable(2104), ptr noundef) #3 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3alg11BloomFilterILj8EE4testEPKc(ptr noundef nonnull align 8 dereferenceable(2104), ptr noundef) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3alg11BloomFilterILj8EED2Ev(ptr noundef nonnull align 8 dereferenceable(2104)) unnamed_addr #5 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; 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"

%"class.alg::BloomFilter" = type { i32, i32, %"class.alg::BitSet", [8 x %"struct.alg::UHash"] }
%"class.alg::BitSet" = type { i32, i32, ptr }
%"struct.alg::UHash" = type { [64 x i32], i32 }

@__const.main.strs = external hidden unnamed_addr constant [8 x ptr], align 16
@__const.main.strs2 = external hidden unnamed_addr constant [2 x ptr], align 16
@.str.8 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.alg::BloomFilter", align 8
  call void @llvm.lifetime.start.p0(i64 2104, ptr nonnull %1) #5
  call void @_ZN3alg11BloomFilterILj8EEC2Ejj(ptr noundef nonnull align 8 dereferenceable(2104) %1, i32 noundef 80, i32 noundef 8)
  %2 = load ptr, ptr @__const.main.strs, align 16, !tbaa !5
  invoke void @_ZN3alg11BloomFilterILj8EE3setEPKc(ptr noundef nonnull align 8 dereferenceable(2104) %1, ptr noundef %2)
          to label %3 unwind label %27

3:                                                ; preds = %0
  %4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, ptr noundef %2)
  %5 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.main.strs, i64 8), align 8, !tbaa !5
  invoke void @_ZN3alg11BloomFilterILj8EE3setEPKc(ptr noundef nonnull align 8 dereferenceable(2104) %1, ptr noundef %5)
          to label %6 unwind label %27

6:                                                ; preds = %3
  %7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, ptr noundef %5)
  %8 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.main.strs, i64 16), align 16, !tbaa !5
  invoke void @_ZN3alg11BloomFilterILj8EE3setEPKc(ptr noundef nonnull align 8 dereferenceable(2104) %1, ptr noundef %8)
          to label %9 unwind label %27

9:                                                ; preds = %6
  %10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, ptr noundef %8)
  %11 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.main.strs, i64 24), align 8, !tbaa !5
  invoke void @_ZN3alg11BloomFilterILj8EE3setEPKc(ptr noundef nonnull align 8 dereferenceable(2104) %1, ptr noundef %11)
          to label %12 unwind label %27

12:                                               ; preds = %9
  %13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, ptr noundef %11)
  %14 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.main.strs, i64 32), align 16, !tbaa !5
  invoke void @_ZN3alg11BloomFilterILj8EE3setEPKc(ptr noundef nonnull align 8 dereferenceable(2104) %1, ptr noundef %14)
          to label %15 unwind label %27

15:                                               ; preds = %12
  %16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, ptr noundef %14)
  %17 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.main.strs, i64 40), align 8, !tbaa !5
  invoke void @_ZN3alg11BloomFilterILj8EE3setEPKc(ptr noundef nonnull align 8 dereferenceable(2104) %1, ptr noundef %17)
          to label %18 unwind label %27

18:                                               ; preds = %15
  %19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, ptr noundef %17)
  %20 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.main.strs, i64 48), align 16, !tbaa !5
  invoke void @_ZN3alg11BloomFilterILj8EE3setEPKc(ptr noundef nonnull align 8 dereferenceable(2104) %1, ptr noundef %20)
          to label %21 unwind label %27

21:                                               ; preds = %18
  %22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, ptr noundef %20)
  %23 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.main.strs, i64 56), align 8, !tbaa !5
  invoke void @_ZN3alg11BloomFilterILj8EE3setEPKc(ptr noundef nonnull align 8 dereferenceable(2104) %1, ptr noundef %23)
          to label %.preheader.preheader unwind label %27

.preheader.preheader:                             ; preds = %21
  %24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, ptr noundef %23)
  %25 = load ptr, ptr @__const.main.strs2, align 16, !tbaa !5
  %26 = invoke noundef zeroext i1 @_ZN3alg11BloomFilterILj8EE4testEPKc(ptr noundef nonnull align 8 dereferenceable(2104) %1, ptr noundef %25)
          to label %.preheader.1 unwind label %36

27:                                               ; preds = %21, %18, %15, %12, %9, %6, %3, %0
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %38

.preheader.1:                                     ; preds = %.preheader.preheader
  %29 = select i1 %26, ptr @.str.10, ptr @.str.11
  %30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, ptr noundef %25, ptr noundef nonnull %29)
  %31 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.main.strs2, i64 8), align 8, !tbaa !5
  %32 = invoke noundef zeroext i1 @_ZN3alg11BloomFilterILj8EE4testEPKc(ptr noundef nonnull align 8 dereferenceable(2104) %1, ptr noundef %31)
          to label %33 unwind label %36

33:                                               ; preds = %.preheader.1
  %34 = select i1 %32, ptr @.str.10, ptr @.str.11
  %35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, ptr noundef %31, ptr noundef nonnull %34)
  call void @_ZN3alg11BloomFilterILj8EED2Ev(ptr noundef nonnull align 8 dereferenceable(2104) %1) #5
  call void @llvm.lifetime.end.p0(i64 2104, ptr nonnull %1) #5
  ret i32 0

36:                                               ; preds = %.preheader.1, %.preheader.preheader
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %38

38:                                               ; preds = %36, %27
  %.pn = phi { ptr, i32 } [ %28, %27 ], [ %37, %36 ]
  call void @_ZN3alg11BloomFilterILj8EED2Ev(ptr noundef nonnull align 8 dereferenceable(2104) %1) #5
  call void @llvm.lifetime.end.p0(i64 2104, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3alg11BloomFilterILj8EEC2Ejj(ptr noundef nonnull align 8 dereferenceable(2104), i32 noundef, i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3alg11BloomFilterILj8EE3setEPKc(ptr noundef nonnull align 8 dereferenceable(2104), ptr noundef) local_unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3alg11BloomFilterILj8EE4testEPKc(ptr noundef nonnull align 8 dereferenceable(2104), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3alg11BloomFilterILj8EED2Ev(ptr noundef nonnull align 8 dereferenceable(2104)) 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopSimplifyPass,SROAPass,SimplifyCFGPass