; LLVM IR from opset/openset :: src/properties.ll (ZN7openset2db10PropertiesC2Ev)

; 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.robin_hood::hash" = type { i8 }
%"struct.std::equal_to" = type { i8 }
%"class.openset::db::Properties" = type <{ %class.CriticalSection, [7 x i8], [4096 x %"struct.openset::db::Properties::Property_s"], %"class.robin_hood::detail::unordered_map", %"class.robin_hood::detail::unordered_map", i32, [4 x i8] }>
%class.CriticalSection = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i8 }
%"struct.openset::db::Properties::Property_s" = type <{ %"class.std::__cxx11::basic_string", i32, i32, i8, i8, i8, [5 x i8] }>
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.robin_hood::detail::unordered_map" = type { ptr, ptr, i64, i64, i64, i32, i32 }

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7openset2db10PropertiesC2Ev(ptr noundef nonnull align 8 dereferenceable(196716) %0) unnamed_addr #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca %"struct.robin_hood::hash", align 1
  %4 = alloca %"struct.std::equal_to", align 1
  %5 = alloca %"struct.robin_hood::hash", align 1
  %6 = alloca %"struct.std::equal_to", align 1
  %7 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %8 = load ptr, ptr %2, align 8
  %9 = getelementptr inbounds %"class.openset::db::Properties", ptr %8, i32 0, i32 0
  call void @_ZN15CriticalSectionC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9)
  %10 = getelementptr inbounds %"class.openset::db::Properties", ptr %8, i32 0, i32 2
  %11 = getelementptr inbounds [4096 x %"struct.openset::db::Properties::Property_s"], ptr %10, i32 0, i32 0
  %12 = getelementptr inbounds %"struct.openset::db::Properties::Property_s", ptr %11, i64 4096
  br label %13

13:                                               ; preds = %13, %1
  %14 = phi ptr [ %11, %1 ], [ %15, %13 ]
  call void @_ZN7openset2db10Properties10Property_sC2Ev(ptr noundef nonnull align 8 dereferenceable(43) %14) #4
  %15 = getelementptr inbounds %"struct.openset::db::Properties::Property_s", ptr %14, i64 1
  %16 = icmp eq ptr %15, %12
  br i1 %16, label %17, label %13

17:                                               ; preds = %13
  %18 = getelementptr inbounds %"class.openset::db::Properties", ptr %8, i32 0, i32 3
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #4
  call void @_ZN10robin_hood6detail13unordered_mapILb1ELm80ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN7openset2db10Properties10Property_sENS_4hashIS7_EESt8equal_toIS7_EEC2EmRKSE_RKSG_(ptr noundef nonnull align 8 dereferenceable(48) %18, i64 noundef 0, ptr noundef nonnull align 1 dereferenceable(1) %3, ptr noundef nonnull align 1 dereferenceable(1) %4) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #4
  %19 = getelementptr inbounds %"class.openset::db::Properties", ptr %8, i32 0, i32 4
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #4
  call void @_ZN10robin_hood6detail13unordered_mapILb1ELm80ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN7openset2db10Properties10Property_sENS_4hashIS7_EESt8equal_toIS7_EEC2EmRKSE_RKSG_(ptr noundef nonnull align 8 dereferenceable(48) %19, i64 noundef 0, ptr noundef nonnull align 1 dereferenceable(1) %5, ptr noundef nonnull align 1 dereferenceable(1) %6) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #4
  %20 = getelementptr inbounds %"class.openset::db::Properties", ptr %8, i32 0, i32 5
  store i32 0, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !18
  br label %21

21:                                               ; preds = %32, %17
  %22 = load i32, ptr %7, align 4, !tbaa !18
  %23 = icmp slt i32 %22, 4096
  br i1 %23, label %25, label %24

24:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %35

25:                                               ; preds = %21
  %26 = load i32, ptr %7, align 4, !tbaa !18
  %27 = getelementptr inbounds %"class.openset::db::Properties", ptr %8, i32 0, i32 2
  %28 = load i32, ptr %7, align 4, !tbaa !18
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [4096 x %"struct.openset::db::Properties::Property_s"], ptr %27, i64 0, i64 %29
  %31 = getelementptr inbounds %"struct.openset::db::Properties::Property_s", ptr %30, i32 0, i32 1
  store i32 %26, ptr %31, align 8, !tbaa !19
  br label %32

32:                                               ; preds = %25
  %33 = load i32, ptr %7, align 4, !tbaa !18
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %7, align 4, !tbaa !18
  br label %21, !llvm.loop !24

35:                                               ; preds = %24
  ret void
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7openset2db10Properties10Property_sC2Ev(ptr noundef nonnull align 8 dereferenceable(43)) unnamed_addr #3 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 #3 = { 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 #4 = { 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, !17, i64 196712}
!10 = !{!"_ZTSN7openset2db10PropertiesE", !11, i64 0, !7, i64 8, !15, i64 196616, !15, i64 196664, !17, i64 196712}
!11 = !{!"_ZTS15CriticalSection", !12, i64 0}
!12 = !{!"_ZTSSt6atomicIbE", !13, i64 0}
!13 = !{!"_ZTSSt13__atomic_baseIbE", !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"_ZTSN10robin_hood6detail13unordered_mapILb1ELm80ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN7openset2db10Properties10Property_sENS_4hashIS7_EESt8equal_toIS7_EEE", !6, i64 0, !6, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !17, i64 40, !17, i64 44}
!16 = !{!"long", !7, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!17, !17, i64 0}
!19 = !{!20, !17, i64 32}
!20 = !{!"_ZTSN7openset2db10Properties10Property_sE", !21, i64 0, !17, i64 32, !23, i64 36, !14, i64 40, !14, i64 41, !14, i64 42}
!21 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !22, i64 0, !16, i64 8, !7, i64 16}
!22 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!23 = !{!"_ZTSN7openset2db15PropertyTypes_eE", !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


; 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.robin_hood::hash" = type { i8 }
%"struct.std::equal_to" = type { i8 }
%"struct.openset::db::Properties::Property_s" = type <{ %"class.std::__cxx11::basic_string", i32, i32, i8, i8, i8, [5 x i8] }>
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN7openset2db10PropertiesC2Ev(ptr noundef nonnull align 8 dereferenceable(196716) %0) unnamed_addr #1 align 2 {
  %2 = alloca %"struct.robin_hood::hash", align 1
  %3 = alloca %"struct.std::equal_to", align 1
  %4 = alloca %"struct.robin_hood::hash", align 1
  %5 = alloca %"struct.std::equal_to", align 1
  tail call void @_ZN15CriticalSectionC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %0)
  br label %6

6:                                                ; preds = %6, %1
  %.idx = phi i64 [ 8, %1 ], [ %.add, %6 ]
  %.ptr = getelementptr inbounds i8, ptr %0, i64 %.idx
  tail call void @_ZN7openset2db10Properties10Property_sC2Ev(ptr noundef nonnull align 8 dereferenceable(43) %.ptr) #3
  %.add = add nuw nsw i64 %.idx, 48
  %7 = icmp eq i64 %.add, 196616
  br i1 %7, label %8, label %6

8:                                                ; preds = %6
  %.ptr5 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = getelementptr inbounds i8, ptr %0, i64 196616
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #3
  call void @_ZN10robin_hood6detail13unordered_mapILb1ELm80ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN7openset2db10Properties10Property_sENS_4hashIS7_EESt8equal_toIS7_EEC2EmRKSE_RKSG_(ptr noundef nonnull align 8 dereferenceable(48) %9, i64 noundef 0, ptr noundef nonnull align 1 dereferenceable(1) %2, ptr noundef nonnull align 1 dereferenceable(1) %3) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #3
  %10 = getelementptr inbounds i8, ptr %0, i64 196664
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #3
  call void @_ZN10robin_hood6detail13unordered_mapILb1ELm80ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN7openset2db10Properties10Property_sENS_4hashIS7_EESt8equal_toIS7_EEC2EmRKSE_RKSG_(ptr noundef nonnull align 8 dereferenceable(48) %10, i64 noundef 0, ptr noundef nonnull align 1 dereferenceable(1) %4, ptr noundef nonnull align 1 dereferenceable(1) %5) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #3
  %11 = getelementptr inbounds i8, ptr %0, i64 196712
  store i32 0, ptr %11, align 8, !tbaa !5
  br label %13

12:                                               ; preds = %13
  ret void

13:                                               ; preds = %13, %8
  %indvars.iv = phi i64 [ 0, %8 ], [ %indvars.iv.next.3, %13 ]
  %14 = getelementptr inbounds [4096 x %"struct.openset::db::Properties::Property_s"], ptr %.ptr5, i64 0, i64 %indvars.iv, i32 1
  %15 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %15, ptr %14, align 8, !tbaa !17
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %16 = getelementptr inbounds [4096 x %"struct.openset::db::Properties::Property_s"], ptr %.ptr5, i64 0, i64 %indvars.iv.next, i32 1
  %17 = trunc nuw nsw i64 %indvars.iv.next to i32
  store i32 %17, ptr %16, align 8, !tbaa !17
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %18 = getelementptr inbounds [4096 x %"struct.openset::db::Properties::Property_s"], ptr %.ptr5, i64 0, i64 %indvars.iv.next.1, i32 1
  %19 = trunc nuw nsw i64 %indvars.iv.next.1 to i32
  store i32 %19, ptr %18, align 8, !tbaa !17
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %20 = getelementptr inbounds [4096 x %"struct.openset::db::Properties::Property_s"], ptr %.ptr5, i64 0, i64 %indvars.iv.next.2, i32 1
  %21 = trunc nuw nsw i64 %indvars.iv.next.2 to i32
  store i32 %21, ptr %20, align 8, !tbaa !17
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, 4096
  br i1 %exitcond.not.3, label %12, label %13, !llvm.loop !22
}

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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, !16, i64 196712}
!6 = !{!"_ZTSN7openset2db10PropertiesE", !7, i64 0, !11, i64 8, !13, i64 196616, !13, i64 196664, !16, i64 196712}
!7 = !{!"_ZTS15CriticalSection", !8, i64 0}
!8 = !{!"_ZTSSt6atomicIbE", !9, i64 0}
!9 = !{!"_ZTSSt13__atomic_baseIbE", !10, i64 0}
!10 = !{!"bool", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"_ZTSN10robin_hood6detail13unordered_mapILb1ELm80ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN7openset2db10Properties10Property_sENS_4hashIS7_EESt8equal_toIS7_EEE", !14, i64 0, !14, i64 8, !15, i64 16, !15, i64 24, !15, i64 32, !16, i64 40, !16, i64 44}
!14 = !{!"any pointer", !11, i64 0}
!15 = !{!"long", !11, i64 0}
!16 = !{!"int", !11, i64 0}
!17 = !{!18, !16, i64 32}
!18 = !{!"_ZTSN7openset2db10Properties10Property_sE", !19, i64 0, !16, i64 32, !21, i64 36, !10, i64 40, !10, i64 41, !10, i64 42}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !20, i64 0, !15, i64 8, !11, i64 16}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !14, i64 0}
!21 = !{!"_ZTSN7openset2db15PropertyTypes_eE", !11, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass