; LLVM IR from VAR-solutions/Algorithms :: Hashing/Linear Probing (linear_probing)

; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6inserti(i32 noundef) #0

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z6searchi(i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10delete_keyi(i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #5 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 27, ptr %2, align 4, !tbaa !5
  br label %5

5:                                                ; preds = %32, %0
  %6 = load i32, ptr %2, align 4, !tbaa !5
  %7 = icmp slt i32 %6, 120
  br i1 %7, label %9, label %8

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

9:                                                ; preds = %5
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = icmp slt i32 %10, 30
  br i1 %11, label %12, label %15

12:                                               ; preds = %9
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = add nsw i32 %13, 2
  store i32 %14, ptr %2, align 4, !tbaa !5
  br label %32

15:                                               ; preds = %9
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = icmp slt i32 %16, 40
  br i1 %17, label %18, label %21

18:                                               ; preds = %15
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = add nsw i32 %19, 3
  store i32 %20, ptr %2, align 4, !tbaa !5
  br label %31

21:                                               ; preds = %15
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = icmp slt i32 %22, 60
  br i1 %23, label %24, label %27

24:                                               ; preds = %21
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = add nsw i32 %25, 7
  store i32 %26, ptr %2, align 4, !tbaa !5
  br label %30

27:                                               ; preds = %21
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = add nsw i32 %28, 10
  store i32 %29, ptr %2, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %27, %24
  br label %31

31:                                               ; preds = %30, %18
  br label %32

32:                                               ; preds = %31, %12
  %33 = load i32, ptr %2, align 4, !tbaa !5
  call void @_Z6inserti(i32 noundef %33)
  br label %5, !llvm.loop !9

34:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 27, ptr %3, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %62, %34
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = icmp slt i32 %36, 120
  br i1 %37, label %39, label %38

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

39:                                               ; preds = %35
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = icmp slt i32 %40, 30
  br i1 %41, label %42, label %45

42:                                               ; preds = %39
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = add nsw i32 %43, 2
  store i32 %44, ptr %3, align 4, !tbaa !5
  br label %62

45:                                               ; preds = %39
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = icmp slt i32 %46, 40
  br i1 %47, label %48, label %51

48:                                               ; preds = %45
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = add nsw i32 %49, 3
  store i32 %50, ptr %3, align 4, !tbaa !5
  br label %61

51:                                               ; preds = %45
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = icmp slt i32 %52, 60
  br i1 %53, label %54, label %57

54:                                               ; preds = %51
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = add nsw i32 %55, 7
  store i32 %56, ptr %3, align 4, !tbaa !5
  br label %60

57:                                               ; preds = %51
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = add nsw i32 %58, 10
  store i32 %59, ptr %3, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %57, %54
  br label %61

61:                                               ; preds = %60, %48
  br label %62

62:                                               ; preds = %61, %42
  %63 = load i32, ptr %3, align 4, !tbaa !5
  %64 = call noundef i32 @_Z6searchi(i32 noundef %63)
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %64)
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %65, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %35, !llvm.loop !11

67:                                               ; preds = %38
  call void @_Z10delete_keyi(i32 noundef 27)
  call void @_Z10delete_keyi(i32 noundef 30)
  call void @_Z10delete_keyi(i32 noundef 40)
  call void @_Z10delete_keyi(i32 noundef 43)
  call void @_Z10delete_keyi(i32 noundef 47)
  call void @_Z10delete_keyi(i32 noundef 53)
  call void @_Z10delete_keyi(i32 noundef 65)
  call void @_Z10delete_keyi(i32 noundef 74)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 27, ptr %4, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %95, %67
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = icmp slt i32 %69, 120
  br i1 %70, label %72, label %71

71:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %100

72:                                               ; preds = %68
  %73 = load i32, ptr %4, align 4, !tbaa !5
  %74 = icmp slt i32 %73, 30
  br i1 %74, label %75, label %78

75:                                               ; preds = %72
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = add nsw i32 %76, 2
  store i32 %77, ptr %4, align 4, !tbaa !5
  br label %95

78:                                               ; preds = %72
  %79 = load i32, ptr %4, align 4, !tbaa !5
  %80 = icmp slt i32 %79, 40
  br i1 %80, label %81, label %84

81:                                               ; preds = %78
  %82 = load i32, ptr %4, align 4, !tbaa !5
  %83 = add nsw i32 %82, 3
  store i32 %83, ptr %4, align 4, !tbaa !5
  br label %94

84:                                               ; preds = %78
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = icmp slt i32 %85, 60
  br i1 %86, label %87, label %90

87:                                               ; preds = %84
  %88 = load i32, ptr %4, align 4, !tbaa !5
  %89 = add nsw i32 %88, 7
  store i32 %89, ptr %4, align 4, !tbaa !5
  br label %93

90:                                               ; preds = %84
  %91 = load i32, ptr %4, align 4, !tbaa !5
  %92 = add nsw i32 %91, 10
  store i32 %92, ptr %4, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %90, %87
  br label %94

94:                                               ; preds = %93, %81
  br label %95

95:                                               ; preds = %94, %75
  %96 = load i32, ptr %4, align 4, !tbaa !5
  %97 = call noundef i32 @_Z6searchi(i32 noundef %96)
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %97)
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %98, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %68, !llvm.loop !12

100:                                              ; preds = %71
  %101 = load i32, ptr %1, align 4
  ret i32 %101
}

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 = { "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 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 = { 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 #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !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"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6inserti(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z6searchi(i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10delete_keyi(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  br label %1

1:                                                ; preds = %0, %7
  %.03032 = phi i32 [ 27, %0 ], [ %8, %7 ]
  %2 = icmp ult i32 %.03032, 30
  br i1 %2, label %7, label %3

3:                                                ; preds = %1
  %4 = icmp ult i32 %.03032, 40
  br i1 %4, label %7, label %5

5:                                                ; preds = %3
  %6 = icmp ult i32 %.03032, 60
  %. = select i1 %6, i32 7, i32 10
  br label %7

7:                                                ; preds = %5, %3, %1
  %.sink = phi i32 [ 2, %1 ], [ 3, %3 ], [ %., %5 ]
  %8 = add nuw nsw i32 %.03032, %.sink
  tail call void @_Z6inserti(i32 noundef %8)
  %9 = icmp ult i32 %8, 120
  br i1 %9, label %1, label %.preheader, !llvm.loop !5

10:                                               ; preds = %16
  tail call void @_Z10delete_keyi(i32 noundef 27)
  tail call void @_Z10delete_keyi(i32 noundef 30)
  tail call void @_Z10delete_keyi(i32 noundef 40)
  tail call void @_Z10delete_keyi(i32 noundef 43)
  tail call void @_Z10delete_keyi(i32 noundef 47)
  tail call void @_Z10delete_keyi(i32 noundef 53)
  tail call void @_Z10delete_keyi(i32 noundef 65)
  tail call void @_Z10delete_keyi(i32 noundef 74)
  br label %23

.preheader:                                       ; preds = %7, %16
  %.02833 = phi i32 [ %17, %16 ], [ 27, %7 ]
  %11 = icmp ult i32 %.02833, 30
  br i1 %11, label %16, label %12

12:                                               ; preds = %.preheader
  %13 = icmp ult i32 %.02833, 40
  br i1 %13, label %16, label %14

14:                                               ; preds = %12
  %15 = icmp ult i32 %.02833, 60
  %.37 = select i1 %15, i32 7, i32 10
  br label %16

16:                                               ; preds = %14, %12, %.preheader
  %.sink35 = phi i32 [ 2, %.preheader ], [ 3, %12 ], [ %.37, %14 ]
  %17 = add nuw nsw i32 %.02833, %.sink35
  %18 = tail call noundef i32 @_Z6searchi(i32 noundef %17)
  %19 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %18)
  %20 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %21 = icmp ult i32 %17, 120
  br i1 %21, label %.preheader, label %10, !llvm.loop !7

22:                                               ; preds = %29
  ret i32 0

23:                                               ; preds = %10, %29
  %.034 = phi i32 [ 27, %10 ], [ %30, %29 ]
  %24 = icmp ult i32 %.034, 30
  br i1 %24, label %29, label %25

25:                                               ; preds = %23
  %26 = icmp ult i32 %.034, 40
  br i1 %26, label %29, label %27

27:                                               ; preds = %25
  %28 = icmp ult i32 %.034, 60
  %.38 = select i1 %28, i32 7, i32 10
  br label %29

29:                                               ; preds = %27, %25, %23
  %.sink36 = phi i32 [ 2, %23 ], [ 3, %25 ], [ %.38, %27 ]
  %30 = add nuw nsw i32 %.034, %.sink36
  %31 = tail call noundef i32 @_Z6searchi(i32 noundef %30)
  %32 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %31)
  %33 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %34 = icmp ult i32 %30, 120
  br i1 %34, label %23, label %22, !llvm.loop !8
}

attributes #0 = { 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 #1 = { inlinehint 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 #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 = { 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" }

!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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6}


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass