; LLVM IR from ImperialCollegeLondon/pnflow :: src/pnm/pnextract/medialSurf.ll (Z12segToVxlMeshRK13medialSurface)

; 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.voxelImageT = type { %class.voxelImageTBase, %class.voxelField, %class.var3.10, %class.var3.10 }
%class.voxelImageTBase = type { ptr }
%class.voxelField = type { ptr, i64, %class.var3, %"class.std::vector.5" }
%class.var3 = type { i32, i32, i32 }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.var3.10 = type { double, double, double }
%class.medialSurface = type <{ ptr, i32, i32, i32, [4 x i8], i64, i64, ptr, %class.segment, %"class.std::vector", %"class.std::vector.0", %class.medialBall, float, [4 x i8], double, double, double, double, double, double, i32, [4 x i8], double, float, [4 x i8] }>
%class.segment = type { i32, i8, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<voxel, std::allocator<voxel>>::_Vector_impl" }
%"struct.std::_Vector_base<voxel, std::allocator<voxel>>::_Vector_impl" = type { %"struct.std::_Vector_base<voxel, std::allocator<voxel>>::_Vector_impl_data" }
%"struct.std::_Vector_base<voxel, std::allocator<voxel>>::_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<medialBall, std::allocator<medialBall>>::_Vector_impl" }
%"struct.std::_Vector_base<medialBall, std::allocator<medialBall>>::_Vector_impl" = type { %"struct.std::_Vector_base<medialBall, std::allocator<medialBall>>::_Vector_impl_data" }
%"struct.std::_Vector_base<medialBall, std::allocator<medialBall>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.medialBall = type { ptr, float, float, float, i16, float, i16, i16, i16, i16, i16, ptr, ptr, ptr }
%class.segments = type <{ ptr, i32, [4 x i8] }>

; 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 @_Z12segToVxlMeshRK13medialSurface(ptr dead_on_unwind noalias writable sret(%class.voxelImageT) align 8 %0, ptr noundef nonnull align 8 dereferenceable(252) %1) #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i1, align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  store i1 false, ptr %5, align 1
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds %class.medialSurface, ptr %13, i32 0, i32 1
  %15 = load i32, ptr %14, align 8, !tbaa !9
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = getelementptr inbounds %class.medialSurface, ptr %16, i32 0, i32 2
  %18 = load i32, ptr %17, align 4, !tbaa !26
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %class.medialSurface, ptr %19, i32 0, i32 3
  %21 = load i32, ptr %20, align 8, !tbaa !27
  call void @_ZN11voxelImageTIhEC2Eiiih(ptr noundef nonnull align 8 dereferenceable(112) %0, i32 noundef %15, i32 noundef %18, i32 noundef %21, i8 noundef zeroext -1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !28
  br label %22

22:                                               ; preds = %104, %2
  %23 = load i32, ptr %6, align 4, !tbaa !28
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %class.medialSurface, ptr %24, i32 0, i32 3
  %26 = load i32, ptr %25, align 8, !tbaa !27
  %27 = icmp slt i32 %23, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %22
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %107

29:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !28
  br label %30

30:                                               ; preds = %100, %29
  %31 = load i32, ptr %8, align 4, !tbaa !28
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %class.medialSurface, ptr %32, i32 0, i32 2
  %34 = load i32, ptr %33, align 4, !tbaa !26
  %35 = icmp slt i32 %31, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %30
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %103

37:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %class.medialSurface, ptr %38, i32 0, i32 7
  %40 = load ptr, ptr %39, align 8, !tbaa !29
  %41 = load i32, ptr %6, align 4, !tbaa !28
  %42 = sext i32 %41 to i64
  %43 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I8segmentsSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %40, i64 noundef %42) #5
  %44 = load i32, ptr %8, align 4, !tbaa !28
  %45 = sext i32 %44 to i64
  %46 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorI8segmentsSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %43, i64 noundef %45) #5
  store ptr %46, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !28
  br label %47

47:                                               ; preds = %92, %37
  %48 = load i32, ptr %10, align 4, !tbaa !28
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = getelementptr inbounds %class.segments, ptr %49, i32 0, i32 1
  %51 = load i32, ptr %50, align 8, !tbaa !30
  %52 = icmp slt i32 %48, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %47
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %99

54:                                               ; preds = %47
  %55 = getelementptr inbounds i8, ptr %0, i64 8
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = getelementptr inbounds %class.segments, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !32
  %59 = load i32, ptr %10, align 4, !tbaa !28
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds %class.segment, ptr %58, i64 %60
  %62 = getelementptr inbounds %class.segment, ptr %61, i32 0, i32 0
  %63 = load i32, ptr %62, align 8, !tbaa !33
  %64 = load i32, ptr %8, align 4, !tbaa !28
  %65 = load i32, ptr %6, align 4, !tbaa !28
  %66 = sext i32 %65 to i64
  %67 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN10voxelFieldIhEclEiim(ptr noundef nonnull align 8 dereferenceable(56) %55, i32 noundef %63, i32 noundef %64, i64 noundef %66)
          to label %68 unwind label %95

68:                                               ; preds = %54
  %69 = getelementptr inbounds i8, ptr %0, i64 8
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = getelementptr inbounds %class.segments, ptr %70, i32 0, i32 0
  %72 = load ptr, ptr %71, align 8, !tbaa !32
  %73 = load i32, ptr %10, align 4, !tbaa !28
  %74 = add nsw i32 %73, 1
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds %class.segment, ptr %72, i64 %75
  %77 = getelementptr inbounds %class.segment, ptr %76, i32 0, i32 0
  %78 = load i32, ptr %77, align 8, !tbaa !33
  %79 = load i32, ptr %8, align 4, !tbaa !28
  %80 = load i32, ptr %6, align 4, !tbaa !28
  %81 = sext i32 %80 to i64
  %82 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN10voxelFieldIhEclEiim(ptr noundef nonnull align 8 dereferenceable(56) %69, i32 noundef %78, i32 noundef %79, i64 noundef %81)
          to label %83 unwind label %95

83:                                               ; preds = %68
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = getelementptr inbounds %class.segments, ptr %84, i32 0, i32 0
  %86 = load ptr, ptr %85, align 8, !tbaa !32
  %87 = load i32, ptr %10, align 4, !tbaa !28
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds %class.segment, ptr %86, i64 %88
  %90 = getelementptr inbounds %class.segment, ptr %89, i32 0, i32 1
  invoke void @_ZSt4fillIPhhEvT_S1_RKT0_(ptr noundef %67, ptr noundef %82, ptr noundef nonnull align 1 dereferenceable(1) %90)
          to label %91 unwind label %95

91:                                               ; preds = %83
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %10, align 4, !tbaa !28
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %10, align 4, !tbaa !28
  br label %47, !llvm.loop !34

95:                                               ; preds = %83, %68, %54
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %11, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @_ZN11voxelImageTIhED2Ev(ptr noundef nonnull align 8 dereferenceable(112) %0) #5
  br label %111

99:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %8, align 4, !tbaa !28
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %8, align 4, !tbaa !28
  br label %30, !llvm.loop !36

103:                                              ; preds = %36
  br label %104

104:                                              ; preds = %103
  %105 = load i32, ptr %6, align 4, !tbaa !28
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %6, align 4, !tbaa !28
  br label %22, !llvm.loop !37

107:                                              ; preds = %28
  store i1 true, ptr %5, align 1
  store i32 1, ptr %7, align 4
  %108 = load i1, ptr %5, align 1
  br i1 %108, label %110, label %109

109:                                              ; preds = %107
  call void @_ZN11voxelImageTIhED2Ev(ptr noundef nonnull align 8 dereferenceable(112) %0) #5
  br label %110

110:                                              ; preds = %109, %107
  ret void

111:                                              ; preds = %95
  %112 = load ptr, ptr %11, align 8
  %113 = load i32, ptr %12, align 4
  %114 = insertvalue { ptr, i32 } poison, ptr %112, 0
  %115 = insertvalue { ptr, i32 } %114, i32 %113, 1
  resume { ptr, i32 } %115
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11voxelImageTIhEC2Eiiih(ptr noundef nonnull align 8 dereferenceable(112), i32 noundef, i32 noundef, i32 noundef, i8 noundef zeroext) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I8segmentsSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorI8segmentsSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPhhEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZN10voxelFieldIhEclEiim(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i32 noundef, i64 noundef) #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN11voxelImageTIhED2Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #4 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 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 = { 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"}
!9 = !{!10, !11, i64 8}
!10 = !{!"_ZTS13medialSurface", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !12, i64 24, !12, i64 32, !6, i64 40, !13, i64 48, !14, i64 64, !18, i64 88, !22, i64 112, !23, i64 176, !25, i64 184, !25, i64 192, !25, i64 200, !25, i64 208, !25, i64 216, !25, i64 224, !11, i64 232, !25, i64 240, !23, i64 248}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"_ZTS7segment", !11, i64 0, !7, i64 4, !6, i64 8}
!14 = !{!"_ZTSSt6vectorI5voxelSaIS0_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseI5voxelSaIS0_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseI5voxelSaIS0_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseI5voxelSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!"_ZTSSt6vectorI10medialBallSaIS0_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseI10medialBallSaIS0_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseI10medialBallSaIS0_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseI10medialBallSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!"_ZTS10medialBall", !6, i64 0, !23, i64 8, !23, i64 12, !23, i64 16, !24, i64 20, !23, i64 24, !24, i64 28, !24, i64 30, !24, i64 32, !24, i64 34, !24, i64 36, !6, i64 40, !6, i64 48, !6, i64 56}
!23 = !{!"float", !7, i64 0}
!24 = !{!"short", !7, i64 0}
!25 = !{!"double", !7, i64 0}
!26 = !{!10, !11, i64 12}
!27 = !{!10, !11, i64 16}
!28 = !{!11, !11, i64 0}
!29 = !{!10, !6, i64 40}
!30 = !{!31, !11, i64 8}
!31 = !{!"_ZTS8segments", !6, i64 0, !11, i64 8}
!32 = !{!31, !6, i64 0}
!33 = !{!13, !11, i64 0}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = distinct !{!36, !35}
!37 = distinct !{!37, !35}


; 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.voxelImageT = type { %class.voxelImageTBase, %class.voxelField, %class.var3.10, %class.var3.10 }
%class.voxelImageTBase = type { ptr }
%class.voxelField = type { ptr, i64, %class.var3, %"class.std::vector.5" }
%class.var3 = type { i32, i32, i32 }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.var3.10 = type { double, double, double }
%class.segment = type { i32, i8, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z12segToVxlMeshRK13medialSurface(ptr dead_on_unwind noalias nonnull writable sret(%class.voxelImageT) align 8 %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(252) %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = getelementptr inbounds i8, ptr %1, i64 8
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %1, i64 12
  %6 = load i32, ptr %5, align 4, !tbaa !25
  %7 = getelementptr inbounds i8, ptr %1, i64 16
  %8 = load i32, ptr %7, align 8, !tbaa !26
  tail call void @_ZN11voxelImageTIhEC2Eiiih(ptr noundef nonnull align 8 dereferenceable(112) %0, i32 noundef %4, i32 noundef %6, i32 noundef %8, i8 noundef zeroext -1)
  %9 = load i32, ptr %7, align 8, !tbaa !26
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.preheader.lr.ph, label %._crit_edge31

.preheader.lr.ph:                                 ; preds = %2
  %11 = getelementptr inbounds i8, ptr %1, i64 40
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = load i32, ptr %5, align 4, !tbaa !25
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.preheader, label %._crit_edge31

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %15 = phi i32 [ %18, %._crit_edge ], [ %9, %.preheader.lr.ph ]
  %16 = phi i32 [ %19, %._crit_edge ], [ %13, %.preheader.lr.ph ]
  %indvars.iv37 = phi i64 [ %indvars.iv.next38, %._crit_edge ], [ 0, %.preheader.lr.ph ]
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

._crit_edge.loopexit:                             ; preds = %31
  %.pre = load i32, ptr %7, align 8, !tbaa !26
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %18 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %15, %.preheader ]
  %19 = phi i32 [ %32, %._crit_edge.loopexit ], [ %16, %.preheader ]
  %indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
  %20 = sext i32 %18 to i64
  %21 = icmp slt i64 %indvars.iv.next38, %20
  br i1 %21, label %.preheader, label %._crit_edge31, !llvm.loop !27

.lr.ph:                                           ; preds = %.preheader, %31
  %indvars.iv34 = phi i64 [ %indvars.iv.next35, %31 ], [ 0, %.preheader ]
  %22 = load ptr, ptr %11, align 8, !tbaa !30
  %23 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I8segmentsSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %indvars.iv37) #4
  %24 = tail call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorI8segmentsSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %indvars.iv34) #4
  %25 = getelementptr inbounds i8, ptr %24, i64 8
  %26 = trunc nuw nsw i64 %indvars.iv34 to i32
  br label %27

27:                                               ; preds = %35, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %35 ], [ 0, %.lr.ph ]
  %28 = load i32, ptr %25, align 8, !tbaa !31
  %29 = sext i32 %28 to i64
  %30 = icmp slt i64 %indvars.iv, %29
  br i1 %30, label %35, label %31

31:                                               ; preds = %27
  %indvars.iv.next35 = add nuw nsw i64 %indvars.iv34, 1
  %32 = load i32, ptr %5, align 4, !tbaa !25
  %33 = sext i32 %32 to i64
  %34 = icmp slt i64 %indvars.iv.next35, %33
  br i1 %34, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !33

35:                                               ; preds = %27
  %36 = load ptr, ptr %24, align 8, !tbaa !34
  %37 = getelementptr inbounds %class.segment, ptr %36, i64 %indvars.iv
  %38 = load i32, ptr %37, align 8, !tbaa !35
  %39 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZN10voxelFieldIhEclEiim(ptr noundef nonnull align 8 dereferenceable(56) %12, i32 noundef %38, i32 noundef %26, i64 noundef %indvars.iv37)
  %40 = load ptr, ptr %24, align 8, !tbaa !34
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %41 = getelementptr inbounds %class.segment, ptr %40, i64 %indvars.iv.next
  %42 = load i32, ptr %41, align 8, !tbaa !35
  %43 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZN10voxelFieldIhEclEiim(ptr noundef nonnull align 8 dereferenceable(56) %12, i32 noundef %42, i32 noundef %26, i64 noundef %indvars.iv37)
  %44 = load ptr, ptr %24, align 8, !tbaa !34
  %45 = getelementptr inbounds %class.segment, ptr %44, i64 %indvars.iv, i32 1
  invoke void @_ZSt4fillIPhhEvT_S1_RKT0_(ptr noundef nonnull %39, ptr noundef nonnull %43, ptr noundef nonnull align 1 dereferenceable(1) %45)
          to label %27 unwind label %46, !llvm.loop !36

46:                                               ; preds = %35
  %47 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN11voxelImageTIhED2Ev(ptr noundef nonnull align 8 dereferenceable(112) %0) #4
  resume { ptr, i32 } %47

._crit_edge31:                                    ; preds = %._crit_edge, %.preheader.lr.ph, %2
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11voxelImageTIhEC2Eiiih(ptr noundef nonnull align 8 dereferenceable(112), i32 noundef, i32 noundef, i32 noundef, i8 noundef zeroext) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I8segmentsSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorI8segmentsSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPhhEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZN10voxelFieldIhEclEiim(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i32 noundef, i64 noundef) local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN11voxelImageTIhED2Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #3 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 = { 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 = { 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, !10, i64 8}
!6 = !{!"_ZTS13medialSurface", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !11, i64 24, !11, i64 32, !7, i64 40, !12, i64 48, !13, i64 64, !17, i64 88, !21, i64 112, !22, i64 176, !24, i64 184, !24, i64 192, !24, i64 200, !24, i64 208, !24, i64 216, !24, i64 224, !10, i64 232, !24, i64 240, !22, i64 248}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!"_ZTS7segment", !10, i64 0, !8, i64 4, !7, i64 8}
!13 = !{!"_ZTSSt6vectorI5voxelSaIS0_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseI5voxelSaIS0_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseI5voxelSaIS0_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseI5voxelSaIS0_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!17 = !{!"_ZTSSt6vectorI10medialBallSaIS0_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseI10medialBallSaIS0_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseI10medialBallSaIS0_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseI10medialBallSaIS0_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!21 = !{!"_ZTS10medialBall", !7, i64 0, !22, i64 8, !22, i64 12, !22, i64 16, !23, i64 20, !22, i64 24, !23, i64 28, !23, i64 30, !23, i64 32, !23, i64 34, !23, i64 36, !7, i64 40, !7, i64 48, !7, i64 56}
!22 = !{!"float", !8, i64 0}
!23 = !{!"short", !8, i64 0}
!24 = !{!"double", !8, i64 0}
!25 = !{!6, !10, i64 12}
!26 = !{!6, !10, i64 16}
!27 = distinct !{!27, !28, !29}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!"llvm.loop.unswitch.partial.disable"}
!30 = !{!6, !7, i64 40}
!31 = !{!32, !10, i64 8}
!32 = !{!"_ZTS8segments", !7, i64 0, !10, i64 8}
!33 = distinct !{!33, !28}
!34 = !{!32, !7, i64 0}
!35 = !{!12, !10, i64 0}
!36 = distinct !{!36, !28}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass