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

; 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.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<Particle *, std::allocator<Particle *>>::_Deque_impl" }
%"struct.std::_Deque_base<Particle *, std::allocator<Particle *>>::_Deque_impl" = type { %"struct.std::_Deque_base<Particle *, std::allocator<Particle *>>::_Deque_impl_data" }
%"struct.std::_Deque_base<Particle *, std::allocator<Particle *>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"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.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.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 }

; 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 noundef double @_ZN13Rasterization23findHeightValByNeighborEP8Particle(ptr noundef %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca double, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %"class.std::queue", align 8
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %4) #4
  call void @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #4
  call void @_ZNSt6vectorIP8ParticleSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %class.Particle, ptr %17, i32 0, i32 12
  %19 = call noundef i64 @_ZNKSt6vectorIP8ParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #4
  %20 = trunc i64 %19 to i32
  store i32 %20, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %21

21:                                               ; preds = %35, %1
  %22 = load i32, ptr %7, align 4, !tbaa !9
  %23 = load i32, ptr %6, align 4, !tbaa !9
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %26, label %25

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

26:                                               ; preds = %21
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %class.Particle, ptr %27, i32 0, i32 7
  store i8 1, ptr %28, align 8, !tbaa !11
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %class.Particle, ptr %29, i32 0, i32 12
  %31 = load i32, ptr %7, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8ParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %32) #4
  invoke void @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 8 dereferenceable(8) %33)
          to label %34 unwind label %38

34:                                               ; preds = %26
  br label %35

35:                                               ; preds = %34
  %36 = load i32, ptr %7, align 4, !tbaa !9
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %7, align 4, !tbaa !9
  br label %21, !llvm.loop !25

38:                                               ; preds = %26
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %8, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %141

42:                                               ; preds = %25
  br label %43

43:                                               ; preds = %136, %42
  %44 = invoke noundef zeroext i1 @_ZNKSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %45 unwind label %63

45:                                               ; preds = %43
  %46 = xor i1 %44, true
  br i1 %46, label %47, label %138

47:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %48 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %49 unwind label %67

49:                                               ; preds = %47
  %50 = load ptr, ptr %48, align 8, !tbaa !5
  store ptr %50, ptr %10, align 8, !tbaa !5
  invoke void @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %51 unwind label %67

51:                                               ; preds = %49
  invoke void @_ZNSt6vectorIP8ParticleSaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %52 unwind label %67

52:                                               ; preds = %51
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = getelementptr inbounds %class.Particle, ptr %53, i32 0, i32 15
  %55 = load double, ptr %54, align 8, !tbaa !27
  %56 = fcmp ogt double %55, 0xC202A05F1FF80000
  br i1 %56, label %57, label %99

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store i64 0, ptr %11, align 8, !tbaa !28
  br label %58

58:                                               ; preds = %76, %57
  %59 = load i64, ptr %11, align 8, !tbaa !28
  %60 = call noundef i64 @_ZNKSt6vectorIP8ParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  %61 = icmp ult i64 %59, %60
  br i1 %61, label %71, label %62

62:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %79

63:                                               ; preds = %43
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %8, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %9, align 4
  br label %141

67:                                               ; preds = %80, %51, %49, %47
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %8, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %9, align 4
  br label %137

71:                                               ; preds = %58
  %72 = load i64, ptr %11, align 8, !tbaa !28
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8ParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %72) #4
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  %75 = getelementptr inbounds %class.Particle, ptr %74, i32 0, i32 7
  store i8 0, ptr %75, align 8, !tbaa !11
  br label %76

76:                                               ; preds = %71
  %77 = load i64, ptr %11, align 8, !tbaa !28
  %78 = add i64 %77, 1
  store i64 %78, ptr %11, align 8, !tbaa !28
  br label %58, !llvm.loop !29

79:                                               ; preds = %62
  br label %80

80:                                               ; preds = %90, %79
  %81 = invoke noundef zeroext i1 @_ZNKSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %82 unwind label %67

82:                                               ; preds = %80
  %83 = xor i1 %81, true
  br i1 %83, label %84, label %95

84:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %85 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %86 unwind label %91

86:                                               ; preds = %84
  %87 = load ptr, ptr %85, align 8, !tbaa !5
  store ptr %87, ptr %12, align 8, !tbaa !5
  %88 = load ptr, ptr %12, align 8, !tbaa !5
  %89 = getelementptr inbounds %class.Particle, ptr %88, i32 0, i32 7
  store i8 0, ptr %89, align 8, !tbaa !11
  invoke void @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %90 unwind label %91

90:                                               ; preds = %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %80, !llvm.loop !30

91:                                               ; preds = %86, %84
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %8, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %137

95:                                               ; preds = %82
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = getelementptr inbounds %class.Particle, ptr %96, i32 0, i32 15
  %98 = load double, ptr %97, align 8, !tbaa !27
  store double %98, ptr %2, align 8
  store i32 1, ptr %13, align 4
  br label %134

99:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %100 = load ptr, ptr %10, align 8, !tbaa !5
  %101 = getelementptr inbounds %class.Particle, ptr %100, i32 0, i32 12
  %102 = call noundef i64 @_ZNKSt6vectorIP8ParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %101) #4
  %103 = trunc i64 %102 to i32
  store i32 %103, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %104

104:                                              ; preds = %129, %99
  %105 = load i32, ptr %15, align 4, !tbaa !9
  %106 = load i32, ptr %14, align 4, !tbaa !9
  %107 = icmp slt i32 %105, %106
  br i1 %107, label %109, label %108

108:                                              ; preds = %104
  store i32 12, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %132

109:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %110 = load ptr, ptr %10, align 8, !tbaa !5
  %111 = getelementptr inbounds %class.Particle, ptr %110, i32 0, i32 12
  %112 = load i32, ptr %15, align 4, !tbaa !9
  %113 = sext i32 %112 to i64
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8ParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %111, i64 noundef %113) #4
  %115 = load ptr, ptr %114, align 8, !tbaa !5
  store ptr %115, ptr %16, align 8, !tbaa !5
  %116 = load ptr, ptr %16, align 8, !tbaa !5
  %117 = getelementptr inbounds %class.Particle, ptr %116, i32 0, i32 7
  %118 = load i8, ptr %117, align 8, !tbaa !11, !range !31, !noundef !32
  %119 = trunc i8 %118 to i1
  br i1 %119, label %128, label %120

120:                                              ; preds = %109
  %121 = load ptr, ptr %16, align 8, !tbaa !5
  %122 = getelementptr inbounds %class.Particle, ptr %121, i32 0, i32 7
  store i8 1, ptr %122, align 8, !tbaa !11
  invoke void @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %123 unwind label %124

123:                                              ; preds = %120
  br label %128

124:                                              ; preds = %120
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %8, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %137

128:                                              ; preds = %123, %109
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %15, align 4, !tbaa !9
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %15, align 4, !tbaa !9
  br label %104, !llvm.loop !33

132:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %133

133:                                              ; preds = %132
  store i32 0, ptr %13, align 4
  br label %134

134:                                              ; preds = %133, %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %135 = load i32, ptr %13, align 4
  switch i32 %135, label %139 [
    i32 0, label %136
  ]

136:                                              ; preds = %134
  br label %43, !llvm.loop !34

137:                                              ; preds = %124, %91, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %141

138:                                              ; preds = %45
  store double 0xC202A05F1FF80000, ptr %2, align 8
  store i32 1, ptr %13, align 4
  br label %139

139:                                              ; preds = %138, %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @_ZNSt6vectorIP8ParticleSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #4
  call void @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %4) #4
  %140 = load double, ptr %2, align 8
  ret double %140

141:                                              ; preds = %137, %63, %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @_ZNSt6vectorIP8ParticleSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #4
  call void @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %4) #4
  br label %142

142:                                              ; preds = %141
  %143 = load ptr, ptr %8, align 8
  %144 = load i32, ptr %9, align 4
  %145 = insertvalue { ptr, i32 } poison, ptr %143, 0
  %146 = insertvalue { ptr, i32 } %145, i32 %144, 1
  resume { ptr, i32 } %146
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIP8ParticleSaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 120}
!12 = !{!"_ZTS8Particle", !13, i64 0, !14, i64 8, !15, i64 16, !15, i64 40, !14, i64 64, !15, i64 72, !15, i64 96, !13, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !16, i64 144, !20, i64 168, !24, i64 192, !14, i64 200, !14, i64 208}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!"_ZTS4Vec3", !7, i64 0}
!16 = !{!"_ZTSSt6vectorIP8ParticleSaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIP8ParticleSaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIP8ParticleSaIS1_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIP8ParticleSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!"_ZTSSt6vectorIiSaIiEE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!"long", !7, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!12, !14, i64 200}
!28 = !{!24, !24, i64 0}
!29 = distinct !{!29, !26}
!30 = distinct !{!30, !26}
!31 = !{i8 0, i8 2}
!32 = !{}
!33 = distinct !{!33, !26}
!34 = distinct !{!34, !26}


; 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.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<Particle *, std::allocator<Particle *>>::_Deque_impl" }
%"struct.std::_Deque_base<Particle *, std::allocator<Particle *>>::_Deque_impl" = type { %"struct.std::_Deque_base<Particle *, std::allocator<Particle *>>::_Deque_impl_data" }
%"struct.std::_Deque_base<Particle *, std::allocator<Particle *>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"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 }

; 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 uwtable
define dso_local noundef double @_ZN13Rasterization23findHeightValByNeighborEP8Particle(ptr noundef %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::queue", align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #4
  call void @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #4
  call void @_ZNSt6vectorIP8ParticleSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  %6 = getelementptr inbounds i8, ptr %0, i64 144
  %7 = call noundef i64 @_ZNKSt6vectorIP8ParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %8 = trunc i64 %7 to i32
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %.preheader30.preheader

.preheader30.preheader:                           ; preds = %13, %1
  br label %.preheader30

.lr.ph:                                           ; preds = %1
  %10 = getelementptr inbounds i8, ptr %0, i64 120
  %wide.trip.count = and i64 %7, 2147483647
  br label %11

11:                                               ; preds = %.lr.ph, %13
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %13 ]
  store i8 1, ptr %10, align 8, !tbaa !5
  %12 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8ParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv) #4
  invoke void @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %13 unwind label %14

13:                                               ; preds = %11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader30.preheader, label %11, !llvm.loop !23

14:                                               ; preds = %11
  %15 = landingpad { ptr, i32 }
          cleanup
  br label %60

.preheader30:                                     ; preds = %.preheader30.preheader, %.loopexit
  %.018 = phi double [ %.1, %.loopexit ], [ undef, %.preheader30.preheader ]
  %16 = call noundef zeroext i1 @_ZNKSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br i1 %16, label %59, label %17

17:                                               ; preds = %.preheader30
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %19 = load ptr, ptr %18, align 8, !tbaa !25
  store ptr %19, ptr %4, align 8, !tbaa !25
  call void @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  invoke void @_ZNSt6vectorIP8ParticleSaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %20 unwind label %27

20:                                               ; preds = %17
  %21 = load ptr, ptr %4, align 8, !tbaa !25
  %22 = getelementptr inbounds i8, ptr %21, i64 200
  %23 = load double, ptr %22, align 8, !tbaa !26
  %24 = fcmp ule double %23, 0xC202A05F1FF80000
  br i1 %24, label %42, label %.preheader29

.preheader29:                                     ; preds = %20
  %25 = call noundef i64 @_ZNKSt6vectorIP8ParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  %.not = icmp eq i64 %25, 0
  br i1 %.not, label %.preheader, label %.lr.ph33

.preheader:                                       ; preds = %.lr.ph33, %.preheader29
  %26 = call noundef zeroext i1 @_ZNKSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br i1 %26, label %._crit_edge, label %.lr.ph34

27:                                               ; preds = %17
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %58

.lr.ph33:                                         ; preds = %.preheader29, %.lr.ph33
  %.02132 = phi i64 [ %32, %.lr.ph33 ], [ 0, %.preheader29 ]
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8ParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.02132) #4
  %30 = load ptr, ptr %29, align 8, !tbaa !25
  %31 = getelementptr inbounds i8, ptr %30, i64 120
  store i8 0, ptr %31, align 8, !tbaa !5
  %32 = add nuw i64 %.02132, 1
  %33 = call noundef i64 @_ZNKSt6vectorIP8ParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  %34 = icmp ult i64 %32, %33
  br i1 %34, label %.lr.ph33, label %.preheader, !llvm.loop !27

.lr.ph34:                                         ; preds = %.preheader, %.lr.ph34
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %36 = load ptr, ptr %35, align 8, !tbaa !25
  %37 = getelementptr inbounds i8, ptr %36, i64 120
  store i8 0, ptr %37, align 8, !tbaa !5
  call void @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %38 = call noundef zeroext i1 @_ZNKSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br i1 %38, label %._crit_edge, label %.lr.ph34, !llvm.loop !28

._crit_edge:                                      ; preds = %.lr.ph34, %.preheader
  %39 = load ptr, ptr %4, align 8, !tbaa !25
  %40 = getelementptr inbounds i8, ptr %39, i64 200
  %41 = load double, ptr %40, align 8, !tbaa !26
  br label %.loopexit

42:                                               ; preds = %20
  %43 = getelementptr inbounds i8, ptr %21, i64 144
  %44 = call noundef i64 @_ZNKSt6vectorIP8ParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %43) #4
  %45 = trunc i64 %44 to i32
  %46 = icmp sgt i32 %45, 0
  br i1 %46, label %.lr.ph37.preheader, label %.loopexit

.lr.ph37.preheader:                               ; preds = %42
  %wide.trip.count42 = and i64 %44, 2147483647
  br label %.lr.ph37

.lr.ph37:                                         ; preds = %.lr.ph37.preheader, %57
  %indvars.iv39 = phi i64 [ 0, %.lr.ph37.preheader ], [ %indvars.iv.next40, %57 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %47 = load ptr, ptr %4, align 8, !tbaa !25
  %48 = getelementptr inbounds i8, ptr %47, i64 144
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8ParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %48, i64 noundef %indvars.iv39) #4
  %50 = load ptr, ptr %49, align 8, !tbaa !25
  store ptr %50, ptr %5, align 8, !tbaa !25
  %51 = getelementptr inbounds i8, ptr %50, i64 120
  %52 = load i8, ptr %51, align 8, !tbaa !5, !range !29, !noundef !30
  %53 = trunc nuw i8 %52 to i1
  br i1 %53, label %57, label %54

54:                                               ; preds = %.lr.ph37
  store i8 1, ptr %51, align 8, !tbaa !5
  invoke void @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %57 unwind label %55

55:                                               ; preds = %54
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  br label %58

57:                                               ; preds = %54, %.lr.ph37
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
  %exitcond43.not = icmp eq i64 %indvars.iv.next40, %wide.trip.count42
  br i1 %exitcond43.not, label %.loopexit, label %.lr.ph37, !llvm.loop !31

.loopexit:                                        ; preds = %57, %42, %._crit_edge
  %.1 = phi double [ %41, %._crit_edge ], [ %.018, %42 ], [ %.018, %57 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  br i1 %24, label %.preheader30, label %59, !llvm.loop !32

58:                                               ; preds = %55, %27
  %.pn = phi { ptr, i32 } [ %56, %55 ], [ %28, %27 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  br label %60

59:                                               ; preds = %.preheader30, %.loopexit
  %.2 = phi double [ %.1, %.loopexit ], [ 0xC202A05F1FF80000, %.preheader30 ]
  call void @_ZNSt6vectorIP8ParticleSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  call void @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #4
  ret double %.2

60:                                               ; preds = %58, %14
  %.pn27 = phi { ptr, i32 } [ %15, %14 ], [ %.pn, %58 ]
  call void @_ZNSt6vectorIP8ParticleSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  call void @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #4
  resume { ptr, i32 } %.pn27
}

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIP8ParticleSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

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

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

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

attributes #0 = { mustprogress 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, !7, i64 120}
!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 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!17, !17, i64 0}
!26 = !{!6, !10, i64 200}
!27 = distinct !{!27, !24}
!28 = distinct !{!28, !24}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = distinct !{!31, !24}
!32 = distinct !{!32, !24}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass