; LLVM IR from niessner/Matterport :: code/gaps/pkgs/RGBD (RGBDUtil)

; 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.R3Point = type { [3 x double] }

@RN_EPSILON = external global double, align 8

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z26RGBDCreatePositionChannelsRK6R2GridRS_S2_S2_RK8R3MatrixRK8R4Matrix(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr noundef nonnull align 8 dereferenceable(208) %1, ptr noundef nonnull align 8 dereferenceable(208) %2, ptr noundef nonnull align 8 dereferenceable(208) %3, ptr noundef nonnull align 8 dereferenceable(72) %4, ptr noundef nonnull align 8 dereferenceable(128) %5) #1 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca %class.R3Point, align 8
  %21 = alloca %class.R3Point, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = call noundef nonnull align 8 dereferenceable(208) ptr @_ZN6R2GridaSERKS_(ptr noundef nonnull align 8 dereferenceable(208) %23, ptr noundef nonnull align 8 dereferenceable(208) %22)
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN6R2Grid5ClearEd(ptr noundef nonnull align 8 dereferenceable(208) %25, double noundef -3.210000e+02)
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = call noundef nonnull align 8 dereferenceable(208) ptr @_ZN6R2GridaSERKS_(ptr noundef nonnull align 8 dereferenceable(208) %27, ptr noundef nonnull align 8 dereferenceable(208) %26)
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  %31 = call noundef nonnull align 8 dereferenceable(208) ptr @_ZN6R2GridaSERKS_(ptr noundef nonnull align 8 dereferenceable(208) %30, ptr noundef nonnull align 8 dereferenceable(208) %29)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %112, %6
  %33 = load i32, ptr %13, align 4, !tbaa !9
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %34)
  %36 = icmp slt i32 %33, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %32
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %115

38:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %108, %38
  %40 = load i32, ptr %15, align 4, !tbaa !9
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %41)
  %43 = icmp slt i32 %40, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %39
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %111

45:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = load i32, ptr %13, align 4, !tbaa !9
  %48 = load i32, ptr %15, align 4, !tbaa !9
  %49 = call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %46, i32 noundef %47, i32 noundef %48)
  store double %49, ptr %16, align 8, !tbaa !11
  %50 = load double, ptr %16, align 8, !tbaa !11
  %51 = load double, ptr @RN_EPSILON, align 8, !tbaa !11
  %52 = call noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef %50, double noundef %51)
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %45
  store i32 7, ptr %14, align 4
  br label %105

55:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %56 = load i32, ptr %13, align 4, !tbaa !9
  %57 = sitofp i32 %56 to double
  %58 = fadd double %57, 5.000000e-01
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  %60 = call noundef ptr @_ZNK8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %59, i32 noundef 0)
  %61 = getelementptr inbounds double, ptr %60, i64 2
  %62 = load double, ptr %61, align 8, !tbaa !11
  %63 = fsub double %58, %62
  %64 = load double, ptr %16, align 8, !tbaa !11
  %65 = fmul double %63, %64
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  %67 = call noundef ptr @_ZNK8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %66, i32 noundef 0)
  %68 = getelementptr inbounds double, ptr %67, i64 0
  %69 = load double, ptr %68, align 8, !tbaa !11
  %70 = fdiv double %65, %69
  store double %70, ptr %17, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %71 = load i32, ptr %15, align 4, !tbaa !9
  %72 = sitofp i32 %71 to double
  %73 = fadd double %72, 5.000000e-01
  %74 = load ptr, ptr %11, align 8, !tbaa !5
  %75 = call noundef ptr @_ZNK8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %74, i32 noundef 1)
  %76 = getelementptr inbounds double, ptr %75, i64 2
  %77 = load double, ptr %76, align 8, !tbaa !11
  %78 = fsub double %73, %77
  %79 = load double, ptr %16, align 8, !tbaa !11
  %80 = fmul double %78, %79
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  %82 = call noundef ptr @_ZNK8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %81, i32 noundef 1)
  %83 = getelementptr inbounds double, ptr %82, i64 1
  %84 = load double, ptr %83, align 8, !tbaa !11
  %85 = fdiv double %80, %84
  store double %85, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %86 = load double, ptr %16, align 8, !tbaa !11
  %87 = fneg double %86
  store double %87, ptr %19, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #5
  %88 = load double, ptr %17, align 8, !tbaa !11
  %89 = load double, ptr %18, align 8, !tbaa !11
  %90 = load double, ptr %19, align 8, !tbaa !11
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %20, double noundef %88, double noundef %89, double noundef %90)
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #5
  %91 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZmlRK8R4MatrixRK7R3Point(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %21, ptr noundef nonnull align 8 dereferenceable(128) %91, ptr noundef nonnull align 8 dereferenceable(24) %20)
  %92 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 8 dereferenceable(24) %21)
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #5
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = load i32, ptr %13, align 4, !tbaa !9
  %95 = load i32, ptr %15, align 4, !tbaa !9
  %96 = call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
  call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %93, i32 noundef %94, i32 noundef %95, double noundef %96)
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = load i32, ptr %13, align 4, !tbaa !9
  %99 = load i32, ptr %15, align 4, !tbaa !9
  %100 = call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
  call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %97, i32 noundef %98, i32 noundef %99, double noundef %100)
  %101 = load ptr, ptr %10, align 8, !tbaa !5
  %102 = load i32, ptr %13, align 4, !tbaa !9
  %103 = load i32, ptr %15, align 4, !tbaa !9
  %104 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
  call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %101, i32 noundef %102, i32 noundef %103, double noundef %104)
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  store i32 0, ptr %14, align 4
  br label %105

105:                                              ; preds = %55, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  %106 = load i32, ptr %14, align 4
  switch i32 %106, label %116 [
    i32 0, label %107
    i32 7, label %108
  ]

107:                                              ; preds = %105
  br label %108

108:                                              ; preds = %107, %105
  %109 = load i32, ptr %15, align 4, !tbaa !9
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %15, align 4, !tbaa !9
  br label %39, !llvm.loop !13

111:                                              ; preds = %44
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %13, align 4, !tbaa !9
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %13, align 4, !tbaa !9
  br label %32, !llvm.loop !15

115:                                              ; preds = %37
  ret i32 1

116:                                              ; preds = %105
  unreachable
}

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

declare noundef nonnull align 8 dereferenceable(208) ptr @_ZN6R2GridaSERKS_(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef nonnull align 8 dereferenceable(208)) #2

declare void @_ZN6R2Grid5ClearEd(ptr noundef nonnull align 8 dereferenceable(208), double noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208), i32 noundef, i32 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef, double noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) #4 align 2

declare void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #2

declare void @_ZmlRK8R4MatrixRK7R3Point(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(24)) #2

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208), i32 noundef, i32 noundef, double noundef) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24)) #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 = { "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 = { 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 #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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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.R3Point = type { [3 x double] }

@RN_EPSILON = external local_unnamed_addr global double, align 8

; 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 uwtable
define dso_local noundef i32 @_Z26RGBDCreatePositionChannelsRK6R2GridRS_S2_S2_RK8R3MatrixRK8R4Matrix(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr noundef nonnull align 8 dereferenceable(208) %1, ptr noundef nonnull align 8 dereferenceable(208) %2, ptr noundef nonnull align 8 dereferenceable(208) %3, ptr noundef nonnull align 8 dereferenceable(72) %4, ptr noundef nonnull align 8 dereferenceable(128) %5) local_unnamed_addr #1 {
  %7 = alloca %class.R3Point, align 8
  %8 = alloca %class.R3Point, align 8
  %9 = tail call noundef nonnull align 8 dereferenceable(208) ptr @_ZN6R2GridaSERKS_(ptr noundef nonnull align 8 dereferenceable(208) %1, ptr noundef nonnull align 8 dereferenceable(208) %0)
  tail call void @_ZN6R2Grid5ClearEd(ptr noundef nonnull align 8 dereferenceable(208) %1, double noundef -3.210000e+02)
  %10 = tail call noundef nonnull align 8 dereferenceable(208) ptr @_ZN6R2GridaSERKS_(ptr noundef nonnull align 8 dereferenceable(208) %2, ptr noundef nonnull align 8 dereferenceable(208) %1)
  %11 = tail call noundef nonnull align 8 dereferenceable(208) ptr @_ZN6R2GridaSERKS_(ptr noundef nonnull align 8 dereferenceable(208) %3, ptr noundef nonnull align 8 dereferenceable(208) %1)
  %12 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.preheader, label %._crit_edge41

.preheader:                                       ; preds = %6, %._crit_edge
  %.040 = phi i32 [ %18, %._crit_edge ], [ 0, %6 ]
  %14 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %16 = uitofp nneg i32 %.040 to double
  %17 = fadd double %16, 5.000000e-01
  br label %21

._crit_edge41:                                    ; preds = %._crit_edge, %6
  ret i32 1

._crit_edge:                                      ; preds = %50, %.preheader
  %18 = add nuw nsw i32 %.040, 1
  %19 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %.preheader, label %._crit_edge41, !llvm.loop !5

21:                                               ; preds = %.lr.ph, %50
  %.03839 = phi i32 [ 0, %.lr.ph ], [ %51, %50 ]
  %22 = call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %.040, i32 noundef %.03839)
  %23 = load double, ptr @RN_EPSILON, align 8, !tbaa !7
  %24 = call noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef %22, double noundef %23)
  %.not = icmp eq i32 %24, 0
  br i1 %.not, label %25, label %50

25:                                               ; preds = %21
  %26 = call noundef ptr @_ZNK8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %4, i32 noundef 0)
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  %28 = load double, ptr %27, align 8, !tbaa !7
  %29 = fsub double %17, %28
  %30 = fmul double %22, %29
  %31 = call noundef ptr @_ZNK8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %4, i32 noundef 0)
  %32 = load double, ptr %31, align 8, !tbaa !7
  %33 = fdiv double %30, %32
  %34 = uitofp nneg i32 %.03839 to double
  %35 = fadd double %34, 5.000000e-01
  %36 = call noundef ptr @_ZNK8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %4, i32 noundef 1)
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  %38 = load double, ptr %37, align 8, !tbaa !7
  %39 = fsub double %35, %38
  %40 = fmul double %22, %39
  %41 = call noundef ptr @_ZNK8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %4, i32 noundef 1)
  %42 = getelementptr inbounds i8, ptr %41, i64 8
  %43 = load double, ptr %42, align 8, !tbaa !7
  %44 = fdiv double %40, %43
  %45 = fneg double %22
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %7, double noundef %33, double noundef %44, double noundef %45)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  call void @_ZmlRK8R4MatrixRK7R3Point(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %8, ptr noundef nonnull align 8 dereferenceable(128) %5, ptr noundef nonnull align 8 dereferenceable(24) %7)
  %46 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  %47 = call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %1, i32 noundef %.040, i32 noundef %.03839, double noundef %47)
  %48 = call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %2, i32 noundef %.040, i32 noundef %.03839, double noundef %48)
  %49 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %3, i32 noundef %.040, i32 noundef %.03839, double noundef %49)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  br label %50

50:                                               ; preds = %21, %25
  %51 = add nuw nsw i32 %.03839, 1
  %52 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %21, label %._crit_edge, !llvm.loop !11
}

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

declare noundef nonnull align 8 dereferenceable(208) ptr @_ZN6R2GridaSERKS_(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef nonnull align 8 dereferenceable(208)) local_unnamed_addr #2

declare void @_ZN6R2Grid5ClearEd(ptr noundef nonnull align 8 dereferenceable(208), double noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208), i32 noundef, i32 noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef, double noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) local_unnamed_addr #4 align 2

declare void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #2

declare void @_ZmlRK8R4MatrixRK7R3Point(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208), i32 noundef, i32 noundef, double noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24)) local_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 = { "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 = { 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 #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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = distinct !{!11, !6}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass