; LLVM IR from jianboqi/CSF :: src/Rasterization.ll (ZN13Rasterization23findHeightValByScanlineEP8ParticleR5Cloth)

; 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.Particle = type { i8, double, %class.Vec3, %class.Vec3, double, %class.Vec3, %class.Vec3, i8, i32, i32, i32, i32, %"class.std::vector", %"class.std::vector.0", i64, double, double }
%class.Vec3 = type { [3 x double] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Particle *, std::allocator<Particle *>>::_Vector_impl" }
%"struct.std::_Vector_base<Particle *, std::allocator<Particle *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Particle *, std::allocator<Particle *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Particle *, std::allocator<Particle *>>::_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<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.Cloth = type { i32, i32, double, %"class.std::vector.5", double, double, %class.Vec3, double, double, %"class.std::vector.10", i32, i32 }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<Particle, std::allocator<Particle>>::_Vector_impl" }
%"struct.std::_Vector_base<Particle, std::allocator<Particle>>::_Vector_impl" = type { %"struct.std::_Vector_base<Particle, std::allocator<Particle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Particle, std::allocator<Particle>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN13Rasterization23findHeightValByScanlineEP8ParticleR5Cloth(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(128) %1) #0 align 2 {
  %3 = alloca double, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca i32, align 4
  %16 = alloca double, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %class.Particle, ptr %17, i32 0, i32 9
  %19 = load i32, ptr %18, align 8, !tbaa !9
  store i32 %19, ptr %6, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %class.Particle, ptr %20, i32 0, i32 10
  %22 = load i32, ptr %21, align 4, !tbaa !25
  store i32 %22, ptr %7, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %23 = load i32, ptr %6, align 4, !tbaa !24
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %8, align 4, !tbaa !24
  br label %25

25:                                               ; preds = %47, %2
  %26 = load i32, ptr %8, align 4, !tbaa !24
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %class.Cloth, ptr %27, i32 0, i32 10
  %29 = load i32, ptr %28, align 8, !tbaa !26
  %30 = icmp slt i32 %26, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %25
  store i32 2, ptr %9, align 4
  br label %50

32:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = load i32, ptr %8, align 4, !tbaa !24
  %35 = load i32, ptr %7, align 4, !tbaa !24
  %36 = call noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128) %33, i32 noundef %34, i32 noundef %35)
  %37 = getelementptr inbounds %class.Particle, ptr %36, i32 0, i32 15
  %38 = load double, ptr %37, align 8, !tbaa !36
  store double %38, ptr %10, align 8, !tbaa !37
  %39 = load double, ptr %10, align 8, !tbaa !37
  %40 = fcmp ogt double %39, 0xC202A05F1FF80000
  br i1 %40, label %41, label %43

41:                                               ; preds = %32
  %42 = load double, ptr %10, align 8, !tbaa !37
  store double %42, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %44

43:                                               ; preds = %32
  store i32 0, ptr %9, align 4
  br label %44

44:                                               ; preds = %43, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  %45 = load i32, ptr %9, align 4
  switch i32 %45, label %50 [
    i32 0, label %46
  ]

46:                                               ; preds = %44
  br label %47

47:                                               ; preds = %46
  %48 = load i32, ptr %8, align 4, !tbaa !24
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %8, align 4, !tbaa !24
  br label %25, !llvm.loop !38

50:                                               ; preds = %44, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  %51 = load i32, ptr %9, align 4
  switch i32 %51, label %139 [
    i32 2, label %52
  ]

52:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %53 = load i32, ptr %6, align 4, !tbaa !24
  %54 = sub nsw i32 %53, 1
  store i32 %54, ptr %11, align 4, !tbaa !24
  br label %55

55:                                               ; preds = %74, %52
  %56 = load i32, ptr %11, align 4, !tbaa !24
  %57 = icmp sge i32 %56, 0
  br i1 %57, label %59, label %58

58:                                               ; preds = %55
  store i32 5, ptr %9, align 4
  br label %77

59:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = load i32, ptr %11, align 4, !tbaa !24
  %62 = load i32, ptr %7, align 4, !tbaa !24
  %63 = call noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128) %60, i32 noundef %61, i32 noundef %62)
  %64 = getelementptr inbounds %class.Particle, ptr %63, i32 0, i32 15
  %65 = load double, ptr %64, align 8, !tbaa !36
  store double %65, ptr %12, align 8, !tbaa !37
  %66 = load double, ptr %12, align 8, !tbaa !37
  %67 = fcmp ogt double %66, 0xC202A05F1FF80000
  br i1 %67, label %68, label %70

68:                                               ; preds = %59
  %69 = load double, ptr %12, align 8, !tbaa !37
  store double %69, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %71

70:                                               ; preds = %59
  store i32 0, ptr %9, align 4
  br label %71

71:                                               ; preds = %70, %68
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  %72 = load i32, ptr %9, align 4
  switch i32 %72, label %77 [
    i32 0, label %73
  ]

73:                                               ; preds = %71
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr %11, align 4, !tbaa !24
  %76 = add nsw i32 %75, -1
  store i32 %76, ptr %11, align 4, !tbaa !24
  br label %55, !llvm.loop !40

77:                                               ; preds = %71, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  %78 = load i32, ptr %9, align 4
  switch i32 %78, label %139 [
    i32 5, label %79
  ]

79:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %80 = load i32, ptr %7, align 4, !tbaa !24
  %81 = sub nsw i32 %80, 1
  store i32 %81, ptr %13, align 4, !tbaa !24
  br label %82

82:                                               ; preds = %101, %79
  %83 = load i32, ptr %13, align 4, !tbaa !24
  %84 = icmp sge i32 %83, 0
  br i1 %84, label %86, label %85

85:                                               ; preds = %82
  store i32 8, ptr %9, align 4
  br label %104

86:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = load i32, ptr %6, align 4, !tbaa !24
  %89 = load i32, ptr %13, align 4, !tbaa !24
  %90 = call noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128) %87, i32 noundef %88, i32 noundef %89)
  %91 = getelementptr inbounds %class.Particle, ptr %90, i32 0, i32 15
  %92 = load double, ptr %91, align 8, !tbaa !36
  store double %92, ptr %14, align 8, !tbaa !37
  %93 = load double, ptr %14, align 8, !tbaa !37
  %94 = fcmp ogt double %93, 0xC202A05F1FF80000
  br i1 %94, label %95, label %97

95:                                               ; preds = %86
  %96 = load double, ptr %14, align 8, !tbaa !37
  store double %96, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %98

97:                                               ; preds = %86
  store i32 0, ptr %9, align 4
  br label %98

98:                                               ; preds = %97, %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  %99 = load i32, ptr %9, align 4
  switch i32 %99, label %104 [
    i32 0, label %100
  ]

100:                                              ; preds = %98
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %13, align 4, !tbaa !24
  %103 = add nsw i32 %102, -1
  store i32 %103, ptr %13, align 4, !tbaa !24
  br label %82, !llvm.loop !41

104:                                              ; preds = %98, %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  %105 = load i32, ptr %9, align 4
  switch i32 %105, label %139 [
    i32 8, label %106
  ]

106:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %107 = load i32, ptr %7, align 4, !tbaa !24
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %15, align 4, !tbaa !24
  br label %109

109:                                              ; preds = %131, %106
  %110 = load i32, ptr %15, align 4, !tbaa !24
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds %class.Cloth, ptr %111, i32 0, i32 11
  %113 = load i32, ptr %112, align 4, !tbaa !42
  %114 = icmp slt i32 %110, %113
  br i1 %114, label %116, label %115

115:                                              ; preds = %109
  store i32 11, ptr %9, align 4
  br label %134

116:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = load i32, ptr %6, align 4, !tbaa !24
  %119 = load i32, ptr %15, align 4, !tbaa !24
  %120 = call noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128) %117, i32 noundef %118, i32 noundef %119)
  %121 = getelementptr inbounds %class.Particle, ptr %120, i32 0, i32 15
  %122 = load double, ptr %121, align 8, !tbaa !36
  store double %122, ptr %16, align 8, !tbaa !37
  %123 = load double, ptr %16, align 8, !tbaa !37
  %124 = fcmp ogt double %123, 0xC202A05F1FF80000
  br i1 %124, label %125, label %127

125:                                              ; preds = %116
  %126 = load double, ptr %16, align 8, !tbaa !37
  store double %126, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %128

127:                                              ; preds = %116
  store i32 0, ptr %9, align 4
  br label %128

128:                                              ; preds = %127, %125
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  %129 = load i32, ptr %9, align 4
  switch i32 %129, label %134 [
    i32 0, label %130
  ]

130:                                              ; preds = %128
  br label %131

131:                                              ; preds = %130
  %132 = load i32, ptr %15, align 4, !tbaa !24
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %15, align 4, !tbaa !24
  br label %109, !llvm.loop !43

134:                                              ; preds = %128, %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  %135 = load i32, ptr %9, align 4
  switch i32 %135, label %139 [
    i32 11, label %136
  ]

136:                                              ; preds = %134
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = call noundef double @_ZN13Rasterization23findHeightValByNeighborEP8Particle(ptr noundef %137)
  store double %138, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %139

139:                                              ; preds = %136, %134, %104, %77, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  %140 = load double, ptr %3, align 8
  ret double %140
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef, i32 noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN13Rasterization23findHeightValByNeighborEP8Particle(ptr noundef) #0 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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, !14, i64 128}
!10 = !{!"_ZTS8Particle", !11, i64 0, !12, i64 8, !13, i64 16, !13, i64 40, !12, i64 64, !13, i64 72, !13, i64 96, !11, i64 120, !14, i64 124, !14, i64 128, !14, i64 132, !14, i64 136, !15, i64 144, !19, i64 168, !23, i64 192, !12, i64 200, !12, i64 208}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!"_ZTS4Vec3", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTSSt6vectorIP8ParticleSaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIP8ParticleSaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIP8ParticleSaIS1_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIP8ParticleSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"_ZTSSt6vectorIiSaIiEE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!"long", !7, i64 0}
!24 = !{!14, !14, i64 0}
!25 = !{!10, !14, i64 132}
!26 = !{!27, !14, i64 120}
!27 = !{!"_ZTS5Cloth", !14, i64 0, !14, i64 4, !12, i64 8, !28, i64 16, !12, i64 40, !12, i64 48, !13, i64 56, !12, i64 80, !12, i64 88, !32, i64 96, !14, i64 120, !14, i64 124}
!28 = !{!"_ZTSSt6vectorI8ParticleSaIS0_EE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseI8ParticleSaIS0_EE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseI8ParticleSaIS0_EE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseI8ParticleSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!32 = !{!"_ZTSSt6vectorIdSaIdEE", !33, i64 0}
!33 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!36 = !{!10, !12, i64 200}
!37 = !{!12, !12, i64 0}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}
!40 = distinct !{!40, !39}
!41 = distinct !{!41, !39}
!42 = !{!27, !14, i64 124}
!43 = distinct !{!43, !39}


; 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 uwtable
define dso_local noundef double @_ZN13Rasterization23findHeightValByScanlineEP8ParticleR5Cloth(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(128) %1) local_unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 128
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 132
  %6 = load i32, ptr %5, align 4, !tbaa !23
  %7 = getelementptr inbounds i8, ptr %1, i64 120
  br label %8

8:                                                ; preds = %10, %2
  %.053.in = phi i32 [ %4, %2 ], [ %.053, %10 ]
  %.053 = add nsw i32 %.053.in, 1
  %9 = load i32, ptr %7, align 8, !tbaa !24
  %.not = icmp slt i32 %.053, %9
  br i1 %.not, label %10, label %.preheader78

10:                                               ; preds = %8
  %11 = tail call noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128) %1, i32 noundef %.053, i32 noundef %6)
  %12 = getelementptr inbounds i8, ptr %11, i64 200
  %13 = load double, ptr %12, align 8, !tbaa !34
  %14 = fcmp ule double %13, 0xC202A05F1FF80000
  br i1 %14, label %8, label %.thread, !llvm.loop !35

.preheader78:                                     ; preds = %8, %16
  %.063.in = phi i32 [ %.063, %16 ], [ %4, %8 ]
  %15 = icmp slt i32 %.063.in, 1
  br i1 %15, label %.preheader76, label %16

16:                                               ; preds = %.preheader78
  %.063 = add nsw i32 %.063.in, -1
  %17 = tail call noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128) %1, i32 noundef %.063, i32 noundef %6)
  %18 = getelementptr inbounds i8, ptr %17, i64 200
  %19 = load double, ptr %18, align 8, !tbaa !34
  %20 = fcmp ule double %19, 0xC202A05F1FF80000
  br i1 %20, label %.preheader78, label %.thread, !llvm.loop !37

.preheader76:                                     ; preds = %.preheader78, %23
  %.054.in = phi i32 [ %.054, %23 ], [ %6, %.preheader78 ]
  %21 = icmp slt i32 %.054.in, 1
  br i1 %21, label %.preheader, label %23

.preheader:                                       ; preds = %.preheader76
  %22 = getelementptr inbounds i8, ptr %1, i64 124
  br label %28

23:                                               ; preds = %.preheader76
  %.054 = add nsw i32 %.054.in, -1
  %24 = tail call noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128) %1, i32 noundef %4, i32 noundef %.054)
  %25 = getelementptr inbounds i8, ptr %24, i64 200
  %26 = load double, ptr %25, align 8, !tbaa !34
  %27 = fcmp ule double %26, 0xC202A05F1FF80000
  br i1 %27, label %.preheader76, label %.thread, !llvm.loop !38

28:                                               ; preds = %.preheader, %30
  %.052.in = phi i32 [ %.052, %30 ], [ %6, %.preheader ]
  %.052 = add nsw i32 %.052.in, 1
  %29 = load i32, ptr %22, align 4, !tbaa !39
  %.not68 = icmp slt i32 %.052, %29
  br i1 %.not68, label %30, label %35

30:                                               ; preds = %28
  %31 = tail call noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128) %1, i32 noundef %4, i32 noundef %.052)
  %32 = getelementptr inbounds i8, ptr %31, i64 200
  %33 = load double, ptr %32, align 8, !tbaa !34
  %34 = fcmp ule double %33, 0xC202A05F1FF80000
  br i1 %34, label %28, label %.thread, !llvm.loop !40

35:                                               ; preds = %28
  %36 = tail call noundef double @_ZN13Rasterization23findHeightValByNeighborEP8Particle(ptr noundef %0)
  br label %.thread

.thread:                                          ; preds = %10, %16, %23, %30, %35
  %.12 = phi double [ %36, %35 ], [ %33, %30 ], [ %26, %23 ], [ %19, %16 ], [ %13, %10 ]
  ret double %.12
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN13Rasterization23findHeightValByNeighborEP8Particle(ptr noundef) local_unnamed_addr #0 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" }

!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, !12, i64 128}
!6 = !{!"_ZTS8Particle", !7, i64 0, !10, i64 8, !11, i64 16, !11, i64 40, !10, i64 64, !11, i64 72, !11, i64 96, !7, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !12, i64 136, !13, i64 144, !18, i64 168, !22, i64 192, !10, i64 200, !10, i64 208}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"_ZTS4Vec3", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!"_ZTSSt6vectorIP8ParticleSaIS1_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIP8ParticleSaIS1_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIP8ParticleSaIS1_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIP8ParticleSaIS1_EE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!17 = !{!"any pointer", !8, i64 0}
!18 = !{!"_ZTSSt6vectorIiSaIiEE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!22 = !{!"long", !8, i64 0}
!23 = !{!6, !12, i64 132}
!24 = !{!25, !12, i64 120}
!25 = !{!"_ZTS5Cloth", !12, i64 0, !12, i64 4, !10, i64 8, !26, i64 16, !10, i64 40, !10, i64 48, !11, i64 56, !10, i64 80, !10, i64 88, !30, i64 96, !12, i64 120, !12, i64 124}
!26 = !{!"_ZTSSt6vectorI8ParticleSaIS0_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseI8ParticleSaIS0_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseI8ParticleSaIS0_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseI8ParticleSaIS0_EE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!30 = !{!"_ZTSSt6vectorIdSaIdEE", !31, i64 0}
!31 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!34 = !{!6, !10, i64 200}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = distinct !{!37, !36}
!38 = distinct !{!38, !36}
!39 = !{!25, !12, i64 124}
!40 = distinct !{!40, !36}


; Effective O3 passes: CorrelatedValuePropagationPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass