; LLVM IR from ronan-kerviche/glip-lib :: GLIP-Lib/src/Core (Geometry)

; 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.Glip::CorePipeline::GeometryPrimitives::PointsGrid3D" = type <{ %"class.Glip::CorePipeline::GeometryModel", i32, i32, i32, i8, [3 x i8] }>
%"class.Glip::CorePipeline::GeometryModel" = type { ptr, %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::vector.0", i32, i8, i8, i32, i32, i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_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<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZTVN4Glip12CorePipeline18GeometryPrimitives12PointsGrid3DE = external dso_local unnamed_addr constant { [4 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Glip12CorePipeline13GeometryModelC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Glip12CorePipeline18GeometryPrimitives12PointsGrid3DC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(141) %0, ptr noundef nonnull align 8 dereferenceable(141) %1) unnamed_addr #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %3, align 8
  %6 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN4Glip12CorePipeline13GeometryModelC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(128) %5, ptr noundef nonnull align 8 dereferenceable(128) %6)
  store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTVN4Glip12CorePipeline18GeometryPrimitives12PointsGrid3DE, i32 0, i32 0, i32 2), ptr %5, align 8, !tbaa !9
  %7 = getelementptr inbounds %"class.Glip::CorePipeline::GeometryPrimitives::PointsGrid3D", ptr %5, i32 0, i32 1
  %8 = load ptr, ptr %4, align 8, !tbaa !5
  %9 = getelementptr inbounds %"class.Glip::CorePipeline::GeometryPrimitives::PointsGrid3D", ptr %8, i32 0, i32 1
  %10 = load i32, ptr %9, align 8, !tbaa !11
  store i32 %10, ptr %7, align 8, !tbaa !11
  %11 = getelementptr inbounds %"class.Glip::CorePipeline::GeometryPrimitives::PointsGrid3D", ptr %5, i32 0, i32 2
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %"class.Glip::CorePipeline::GeometryPrimitives::PointsGrid3D", ptr %12, i32 0, i32 2
  %14 = load i32, ptr %13, align 4, !tbaa !25
  store i32 %14, ptr %11, align 4, !tbaa !25
  %15 = getelementptr inbounds %"class.Glip::CorePipeline::GeometryPrimitives::PointsGrid3D", ptr %5, i32 0, i32 3
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = getelementptr inbounds %"class.Glip::CorePipeline::GeometryPrimitives::PointsGrid3D", ptr %16, i32 0, i32 3
  %18 = load i32, ptr %17, align 8, !tbaa !26
  store i32 %18, ptr %15, align 8, !tbaa !26
  %19 = getelementptr inbounds %"class.Glip::CorePipeline::GeometryPrimitives::PointsGrid3D", ptr %5, i32 0, i32 4
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %"class.Glip::CorePipeline::GeometryPrimitives::PointsGrid3D", ptr %20, i32 0, i32 4
  %22 = load i8, ptr %21, align 4, !tbaa !27, !range !28, !noundef !29
  %23 = trunc i8 %22 to i1
  %24 = zext i1 %23 to i8
  store i8 %24, ptr %19, align 4, !tbaa !27
  ret void
}

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

!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, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !24, i64 128}
!12 = !{!"_ZTSN4Glip12CorePipeline18GeometryPrimitives12PointsGrid3DE", !13, i64 0, !24, i64 128, !24, i64 132, !24, i64 136, !23, i64 140}
!13 = !{!"_ZTSN4Glip12CorePipeline13GeometryModelE", !14, i64 8, !14, i64 32, !14, i64 56, !18, i64 80, !22, i64 104, !23, i64 108, !23, i64 109, !24, i64 112, !24, i64 116, !24, i64 120, !24, i64 124}
!14 = !{!"_ZTSSt6vectorIfSaIfEE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!"_ZTSSt6vectorIjSaIjEE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!"_ZTSN4Glip12CorePipeline13GeometryModel12GeometryTypeE", !7, i64 0}
!23 = !{!"bool", !7, i64 0}
!24 = !{!"int", !7, i64 0}
!25 = !{!12, !24, i64 132}
!26 = !{!12, !24, i64 136}
!27 = !{!12, !23, i64 140}
!28 = !{i8 0, i8 2}
!29 = !{}


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

@_ZTVN4Glip12CorePipeline18GeometryPrimitives12PointsGrid3DE = external dso_local unnamed_addr constant { [4 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Glip12CorePipeline13GeometryModelC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Glip12CorePipeline18GeometryPrimitives12PointsGrid3DC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(141) %0, ptr noundef nonnull align 8 dereferenceable(141) %1) unnamed_addr #0 align 2 {
  tail call void @_ZN4Glip12CorePipeline13GeometryModelC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(128) %1)
  store ptr getelementptr inbounds inrange(-16, 16) (i8, ptr @_ZTVN4Glip12CorePipeline18GeometryPrimitives12PointsGrid3DE, i64 16), ptr %0, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 128
  %4 = getelementptr inbounds i8, ptr %1, i64 128
  %5 = load <2 x i32>, ptr %4, align 8, !tbaa !8
  store <2 x i32> %5, ptr %3, align 8, !tbaa !8
  %6 = getelementptr inbounds i8, ptr %0, i64 136
  %7 = getelementptr inbounds i8, ptr %1, i64 136
  %8 = load i32, ptr %7, align 8, !tbaa !11
  store i32 %8, ptr %6, align 8, !tbaa !11
  %9 = getelementptr inbounds i8, ptr %0, i64 140
  %10 = getelementptr inbounds i8, ptr %1, i64 140
  %11 = load i8, ptr %10, align 4, !tbaa !25, !range !26, !noundef !27
  store i8 %11, ptr %9, align 4, !tbaa !25
  ret void
}

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

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !9, i64 136}
!12 = !{!"_ZTSN4Glip12CorePipeline18GeometryPrimitives12PointsGrid3DE", !13, i64 0, !9, i64 128, !9, i64 132, !9, i64 136, !24, i64 140}
!13 = !{!"_ZTSN4Glip12CorePipeline13GeometryModelE", !14, i64 8, !14, i64 32, !14, i64 56, !19, i64 80, !23, i64 104, !24, i64 108, !24, i64 109, !9, i64 112, !9, i64 116, !9, i64 120, !9, i64 124}
!14 = !{!"_ZTSSt6vectorIfSaIfEE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !18, i64 0, !18, i64 8, !18, i64 16}
!18 = !{!"any pointer", !10, i64 0}
!19 = !{!"_ZTSSt6vectorIjSaIjEE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !18, i64 0, !18, i64 8, !18, i64 16}
!23 = !{!"_ZTSN4Glip12CorePipeline13GeometryModel12GeometryTypeE", !10, i64 0}
!24 = !{!"bool", !10, i64 0}
!25 = !{!12, !24, i64 140}
!26 = !{i8 0, i8 2}
!27 = !{}


; Effective O3 passes: IPSCCPPass,InstCombinePass,SLPVectorizerPass,SROAPass,TailCallElimPass