; LLVM IR from artvns/SimpleFvm :: simplefvm/src/DataStores/ResultsDataStores (MeshBuildingStore)

; 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.datastores::MeshBuildingStore" = type { i64, i64, i64, i64, %"class.datastores::ArrayAdt", %"class.datastores::ArrayAdt", %"class.datastores::ArrayAdt", %"class.datastores::ArrayAdt", %"class.datastores::ArrayAdt", %"class.datastores::ArrayAdt" }
%"class.datastores::ArrayAdt" = type { %"class.std::vector", i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10datastores17MeshBuildingStoreC2Ev(ptr noundef nonnull align 8 dereferenceable(224) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  %6 = getelementptr inbounds %"class.datastores::MeshBuildingStore", ptr %5, i32 0, i32 0
  store i64 0, ptr %6, align 8, !tbaa !9
  %7 = getelementptr inbounds %"class.datastores::MeshBuildingStore", ptr %5, i32 0, i32 1
  store i64 0, ptr %7, align 8, !tbaa !17
  %8 = getelementptr inbounds %"class.datastores::MeshBuildingStore", ptr %5, i32 0, i32 2
  store i64 0, ptr %8, align 8, !tbaa !18
  %9 = getelementptr inbounds %"class.datastores::MeshBuildingStore", ptr %5, i32 0, i32 3
  store i64 0, ptr %9, align 8, !tbaa !19
  %10 = getelementptr inbounds %"class.datastores::MeshBuildingStore", ptr %5, i32 0, i32 4
  call void @_ZN10datastores8ArrayAdtImEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10)
  %11 = getelementptr inbounds %"class.datastores::MeshBuildingStore", ptr %5, i32 0, i32 5
  invoke void @_ZN10datastores8ArrayAdtImEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %12 unwind label %21

12:                                               ; preds = %1
  %13 = getelementptr inbounds %"class.datastores::MeshBuildingStore", ptr %5, i32 0, i32 6
  invoke void @_ZN10datastores8ArrayAdtImEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %14 unwind label %25

14:                                               ; preds = %12
  %15 = getelementptr inbounds %"class.datastores::MeshBuildingStore", ptr %5, i32 0, i32 7
  invoke void @_ZN10datastores8ArrayAdtImEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15)
          to label %16 unwind label %29

16:                                               ; preds = %14
  %17 = getelementptr inbounds %"class.datastores::MeshBuildingStore", ptr %5, i32 0, i32 8
  invoke void @_ZN10datastores8ArrayAdtImEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17)
          to label %18 unwind label %33

18:                                               ; preds = %16
  %19 = getelementptr inbounds %"class.datastores::MeshBuildingStore", ptr %5, i32 0, i32 9
  invoke void @_ZN10datastores8ArrayAdtImEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19)
          to label %20 unwind label %37

20:                                               ; preds = %18
  ret void

21:                                               ; preds = %1
  %22 = landingpad { ptr, i32 }
          cleanup
  %23 = extractvalue { ptr, i32 } %22, 0
  store ptr %23, ptr %3, align 8
  %24 = extractvalue { ptr, i32 } %22, 1
  store i32 %24, ptr %4, align 4
  br label %44

25:                                               ; preds = %12
  %26 = landingpad { ptr, i32 }
          cleanup
  %27 = extractvalue { ptr, i32 } %26, 0
  store ptr %27, ptr %3, align 8
  %28 = extractvalue { ptr, i32 } %26, 1
  store i32 %28, ptr %4, align 4
  br label %43

29:                                               ; preds = %14
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %3, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %4, align 4
  br label %42

33:                                               ; preds = %16
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %3, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %4, align 4
  br label %41

37:                                               ; preds = %18
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %3, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %4, align 4
  call void @_ZN10datastores8ArrayAdtImED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #2
  br label %41

41:                                               ; preds = %37, %33
  call void @_ZN10datastores8ArrayAdtImED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #2
  br label %42

42:                                               ; preds = %41, %29
  call void @_ZN10datastores8ArrayAdtImED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #2
  br label %43

43:                                               ; preds = %42, %25
  call void @_ZN10datastores8ArrayAdtImED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #2
  br label %44

44:                                               ; preds = %43, %21
  call void @_ZN10datastores8ArrayAdtImED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #2
  br label %45

45:                                               ; preds = %44
  %46 = load ptr, ptr %3, align 8
  %47 = load i32, ptr %4, align 4
  %48 = insertvalue { ptr, i32 } poison, ptr %46, 0
  %49 = insertvalue { ptr, i32 } %48, i32 %47, 1
  resume { ptr, i32 } %49
}

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

declare i32 @__gxx_personality_v0(...)

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

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 = { 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 = { 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, !11, i64 0}
!10 = !{!"_ZTSN10datastores17MeshBuildingStoreE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !12, i64 32, !12, i64 64, !12, i64 96, !12, i64 128, !12, i64 160, !12, i64 192}
!11 = !{!"long", !7, i64 0}
!12 = !{!"_ZTSN10datastores8ArrayAdtImEE", !13, i64 0, !11, i64 24}
!13 = !{!"_ZTSSt6vectorImSaImEE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseImSaImEE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseImSaImEE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseImSaImEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!10, !11, i64 8}
!18 = !{!10, !11, i64 16}
!19 = !{!10, !11, i64 24}


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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN10datastores17MeshBuildingStoreC2Ev(ptr noundef nonnull align 8 dereferenceable(224) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 32
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 0, i64 32, i1 false)
  tail call void @_ZN10datastores8ArrayAdtImEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2)
  %3 = getelementptr inbounds i8, ptr %0, i64 64
  tail call void @_ZN10datastores8ArrayAdtImEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %4 = getelementptr inbounds i8, ptr %0, i64 96
  tail call void @_ZN10datastores8ArrayAdtImEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %5 = getelementptr inbounds i8, ptr %0, i64 128
  tail call void @_ZN10datastores8ArrayAdtImEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5)
  %6 = getelementptr inbounds i8, ptr %0, i64 160
  tail call void @_ZN10datastores8ArrayAdtImEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6)
  %7 = getelementptr inbounds i8, ptr %0, i64 192
  tail call void @_ZN10datastores8ArrayAdtImEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7)
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10datastores8ArrayAdtImEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

attributes #0 = { 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 #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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)"}


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