; LLVM IR from niessner/Matterport :: code/gaps/pkgs/RGBD/RGBDImage.ll (ZNK9RGBDImage10DrawPointsEii)

; 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.RNRgb = type { [3 x double] }
%class.R3Point = type { [3 x double] }
%class.R2Point = type { [2 x double] }
%class.R3Plane = type { %class.R3Vector, double }
%class.R3Vector = type { [3 x double] }

; 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: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK9RGBDImage7NPixelsEi(ptr noundef nonnull align 8 dereferenceable(488), i32 noundef) #1 align 2

declare void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK9RGBDImage10PixelColorEii(ptr dead_on_unwind noalias writable sret(%class.RNRgb) align 8, ptr noundef nonnull align 8 dereferenceable(488), i32 noundef, i32 noundef) #3 align 2

declare noundef i32 @_Z26RGBDTransformImageToCameraRK7R2PointR7R3PointPK9RGBDImage(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(272) ptr @_ZNK9RGBDImage13CameraToWorldEv(ptr noundef nonnull align 8 dereferenceable(488)) #4 align 2

declare void @glBegin(i32 noundef) #2

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

declare void @glEnd() #2

declare void @glEnable(i32 noundef) #2

declare void @glDisable(i32 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK9RGBDImage10DrawPointsEii(ptr noundef nonnull align 8 dereferenceable(488) %0, i32 noundef %1, i32 noundef %2) unnamed_addr #3 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %class.R3Point, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %class.R2Point, align 8
  %12 = alloca %class.RNRgb, align 8
  %13 = alloca %class.R3Point, align 8
  %14 = alloca %class.R3Point, align 8
  %15 = alloca %class.R3Point, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %class.R2Point, align 8
  %19 = alloca %class.R2Point, align 8
  %20 = alloca %class.R2Point, align 8
  %21 = alloca %class.R3Plane, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  %22 = load ptr, ptr %4, align 8
  %23 = call noundef nonnull align 8 dereferenceable(272) ptr @_ZNK9RGBDImage13CameraToWorldEv(ptr noundef nonnull align 8 dereferenceable(488) %22)
  %24 = load ptr, ptr %23, align 8, !tbaa !11
  %25 = getelementptr inbounds ptr, ptr %24, i64 22
  %26 = load ptr, ptr %25, align 8
  call void %26(ptr noundef nonnull align 8 dereferenceable(272) %23)
  %27 = load i32, ptr %5, align 4, !tbaa !9
  %28 = icmp eq i32 %27, 2
  br i1 %28, label %29, label %30

29:                                               ; preds = %3
  call void @glEnable(i32 noundef 2903)
  call void @glColorMaterial(i32 noundef 1032, i32 noundef 5634)
  call void @glEnable(i32 noundef 2896)
  br label %30

30:                                               ; preds = %29, %3
  %31 = load i32, ptr %5, align 4, !tbaa !9
  %32 = load ptr, ptr %22, align 8, !tbaa !11
  %33 = getelementptr inbounds ptr, ptr %32, i64 23
  %34 = load ptr, ptr %33, align 8
  call void %34(ptr noundef nonnull align 8 dereferenceable(488) %22, i32 noundef %31)
  call void @glPointSize(float noundef 2.000000e+00)
  %35 = load i32, ptr %5, align 4, !tbaa !9
  %36 = icmp ne i32 %35, 2
  br i1 %36, label %37, label %76

37:                                               ; preds = %30
  call void @glBegin(i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #5
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %71, %37
  %39 = load i32, ptr %8, align 4, !tbaa !9
  %40 = call noundef i32 @_ZNK9RGBDImage7NPixelsEi(ptr noundef nonnull align 8 dereferenceable(488) %22, i32 noundef 0)
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %75

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

44:                                               ; preds = %66, %43
  %45 = load i32, ptr %10, align 4, !tbaa !9
  %46 = call noundef i32 @_ZNK9RGBDImage7NPixelsEi(ptr noundef nonnull align 8 dereferenceable(488) %22, i32 noundef 1)
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %70

49:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  %50 = load i32, ptr %8, align 4, !tbaa !9
  %51 = sitofp i32 %50 to double
  %52 = fadd double %51, 5.000000e-01
  %53 = load i32, ptr %10, align 4, !tbaa !9
  %54 = sitofp i32 %53 to double
  %55 = fadd double %54, 5.000000e-01
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %11, double noundef %52, double noundef %55)
  %56 = call noundef i32 @_Z26RGBDTransformImageToCameraRK7R2PointR7R3PointPK9RGBDImage(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef %22)
  %57 = icmp ne i32 %56, 0
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  br i1 %57, label %58, label %65

58:                                               ; preds = %49
  %59 = load i32, ptr %5, align 4, !tbaa !9
  %60 = icmp eq i32 %59, 1
  br i1 %60, label %61, label %64

61:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #5
  %62 = load i32, ptr %8, align 4, !tbaa !9
  %63 = load i32, ptr %10, align 4, !tbaa !9
  call void @_ZNK9RGBDImage10PixelColorEii(ptr dead_on_unwind writable sret(%class.RNRgb) align 8 %12, ptr noundef nonnull align 8 dereferenceable(488) %22, i32 noundef %62, i32 noundef %63)
  call void @_Z9RNLoadRgbRK5RNRgb(ptr noundef nonnull align 8 dereferenceable(24) %12)
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #5
  br label %64

64:                                               ; preds = %61, %58
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %7)
  br label %65

65:                                               ; preds = %64, %49
  br label %66

66:                                               ; preds = %65
  %67 = load i32, ptr %6, align 4, !tbaa !9
  %68 = load i32, ptr %10, align 4, !tbaa !9
  %69 = add nsw i32 %68, %67
  store i32 %69, ptr %10, align 4, !tbaa !9
  br label %44, !llvm.loop !13

70:                                               ; preds = %48
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %6, align 4, !tbaa !9
  %73 = load i32, ptr %8, align 4, !tbaa !9
  %74 = add nsw i32 %73, %72
  store i32 %74, ptr %8, align 4, !tbaa !9
  br label %38, !llvm.loop !15

75:                                               ; preds = %42
  call void @glEnd()
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  br label %131

76:                                               ; preds = %30
  call void @glBegin(i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #5
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %13)
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #5
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %14)
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #5
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %15)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %77

77:                                               ; preds = %126, %76
  %78 = load i32, ptr %16, align 4, !tbaa !9
  %79 = call noundef i32 @_ZNK9RGBDImage7NPixelsEi(ptr noundef nonnull align 8 dereferenceable(488) %22, i32 noundef 0)
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %130

82:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %83

83:                                               ; preds = %121, %82
  %84 = load i32, ptr %17, align 4, !tbaa !9
  %85 = call noundef i32 @_ZNK9RGBDImage7NPixelsEi(ptr noundef nonnull align 8 dereferenceable(488) %22, i32 noundef 1)
  %86 = icmp slt i32 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %125

88:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #5
  %89 = load i32, ptr %16, align 4, !tbaa !9
  %90 = sitofp i32 %89 to double
  %91 = fadd double %90, 5.000000e-01
  %92 = load i32, ptr %17, align 4, !tbaa !9
  %93 = sitofp i32 %92 to double
  %94 = fadd double %93, 5.000000e-01
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %18, double noundef %91, double noundef %94)
  %95 = call noundef i32 @_Z26RGBDTransformImageToCameraRK7R2PointR7R3PointPK9RGBDImage(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef %22)
  %96 = icmp ne i32 %95, 0
  %97 = xor i1 %96, true
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #5
  br i1 %97, label %98, label %99

98:                                               ; preds = %88
  br label %121

99:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #5
  %100 = load i32, ptr %16, align 4, !tbaa !9
  %101 = add nsw i32 %100, 1
  %102 = sitofp i32 %101 to double
  %103 = load i32, ptr %17, align 4, !tbaa !9
  %104 = sitofp i32 %103 to double
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %19, double noundef %102, double noundef %104)
  %105 = call noundef i32 @_Z26RGBDTransformImageToCameraRK7R2PointR7R3PointPK9RGBDImage(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef %22)
  %106 = icmp ne i32 %105, 0
  %107 = xor i1 %106, true
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #5
  br i1 %107, label %108, label %109

108:                                              ; preds = %99
  br label %121

109:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #5
  %110 = load i32, ptr %16, align 4, !tbaa !9
  %111 = sitofp i32 %110 to double
  %112 = load i32, ptr %17, align 4, !tbaa !9
  %113 = add nsw i32 %112, 1
  %114 = sitofp i32 %113 to double
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %20, double noundef %111, double noundef %114)
  %115 = call noundef i32 @_Z26RGBDTransformImageToCameraRK7R2PointR7R3PointPK9RGBDImage(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef %22)
  %116 = icmp ne i32 %115, 0
  %117 = xor i1 %116, true
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #5
  br i1 %117, label %118, label %119

118:                                              ; preds = %109
  br label %121

119:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #5
  call void @_ZN7R3PlaneC1ERK7R3PointS2_S2_(ptr noundef nonnull align 8 dereferenceable(32) %21, ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(24) %15)
  %120 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Plane6NormalEv(ptr noundef nonnull align 8 dereferenceable(32) %21)
  call void @_Z12R3LoadNormalRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %120)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %13)
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #5
  br label %121

121:                                              ; preds = %119, %118, %108, %98
  %122 = load i32, ptr %6, align 4, !tbaa !9
  %123 = load i32, ptr %17, align 4, !tbaa !9
  %124 = add nsw i32 %123, %122
  store i32 %124, ptr %17, align 4, !tbaa !9
  br label %83, !llvm.loop !16

125:                                              ; preds = %87
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %6, align 4, !tbaa !9
  %128 = load i32, ptr %16, align 4, !tbaa !9
  %129 = add nsw i32 %128, %127
  store i32 %129, ptr %16, align 4, !tbaa !9
  br label %77, !llvm.loop !17

130:                                              ; preds = %81
  call void @glEnd()
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  br label %131

131:                                              ; preds = %130, %75
  call void @glPointSize(float noundef 1.000000e+00)
  %132 = load i32, ptr %5, align 4, !tbaa !9
  %133 = icmp eq i32 %132, 2
  br i1 %133, label %134, label %135

134:                                              ; preds = %131
  call void @glDisable(i32 noundef 2903)
  call void @glDisable(i32 noundef 2896)
  br label %135

135:                                              ; preds = %134, %131
  %136 = call noundef nonnull align 8 dereferenceable(272) ptr @_ZNK9RGBDImage13CameraToWorldEv(ptr noundef nonnull align 8 dereferenceable(488) %22)
  %137 = load ptr, ptr %136, align 8, !tbaa !11
  %138 = getelementptr inbounds ptr, ptr %137, i64 23
  %139 = load ptr, ptr %138, align 8
  call void %139(ptr noundef nonnull align 8 dereferenceable(272) %136)
  ret void
}

declare void @glColorMaterial(i32 noundef, i32 noundef) #2

declare void @glPointSize(float noundef) #2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Plane6NormalEv(ptr noundef nonnull align 8 dereferenceable(32)) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !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.RNRgb = type { [3 x double] }
%class.R3Point = type { [3 x double] }
%class.R2Point = type { [2 x double] }
%class.R3Plane = type { %class.R3Vector, double }
%class.R3Vector = type { [3 x double] }

; 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: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK9RGBDImage7NPixelsEi(ptr noundef nonnull align 8 dereferenceable(488), i32 noundef) local_unnamed_addr #1 align 2

declare void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK9RGBDImage10PixelColorEii(ptr dead_on_unwind noalias writable sret(%class.RNRgb) align 8, ptr noundef nonnull align 8 dereferenceable(488), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

declare noundef i32 @_Z26RGBDTransformImageToCameraRK7R2PointR7R3PointPK9RGBDImage(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(272) ptr @_ZNK9RGBDImage13CameraToWorldEv(ptr noundef nonnull align 8 dereferenceable(488)) local_unnamed_addr #4 align 2

declare void @glBegin(i32 noundef) local_unnamed_addr #2

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

declare void @glEnd() local_unnamed_addr #2

declare void @glEnable(i32 noundef) local_unnamed_addr #2

declare void @glDisable(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK9RGBDImage10DrawPointsEii(ptr noundef nonnull align 8 dereferenceable(488) %0, i32 noundef %1, i32 noundef %2) unnamed_addr #3 align 2 {
  %4 = alloca %class.R3Point, align 8
  %5 = alloca %class.R2Point, align 8
  %6 = alloca %class.RNRgb, align 8
  %7 = alloca %class.R3Point, align 8
  %8 = alloca %class.R3Point, align 8
  %9 = alloca %class.R3Point, align 8
  %10 = alloca %class.R2Point, align 8
  %11 = alloca %class.R2Point, align 8
  %12 = alloca %class.R2Point, align 8
  %13 = alloca %class.R3Plane, align 8
  %14 = tail call noundef nonnull align 8 dereferenceable(272) ptr @_ZNK9RGBDImage13CameraToWorldEv(ptr noundef nonnull align 8 dereferenceable(488) %0)
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i64 176
  %17 = load ptr, ptr %16, align 8
  tail call void %17(ptr noundef nonnull align 8 dereferenceable(272) %14)
  %18 = icmp eq i32 %1, 2
  br i1 %18, label %19, label %.critedge

19:                                               ; preds = %3
  tail call void @glEnable(i32 noundef 2903)
  tail call void @glColorMaterial(i32 noundef 1032, i32 noundef 5634)
  tail call void @glEnable(i32 noundef 2896)
  %20 = load ptr, ptr %0, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %20, i64 184
  %22 = load ptr, ptr %21, align 8
  tail call void %22(ptr noundef nonnull align 8 dereferenceable(488) %0, i32 noundef 2)
  tail call void @glPointSize(float noundef 2.000000e+00)
  tail call void @glBegin(i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %9)
  %23 = call noundef i32 @_ZNK9RGBDImage7NPixelsEi(ptr noundef nonnull align 8 dereferenceable(488) %0, i32 noundef 0)
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.preheader, label %._crit_edge44

.critedge:                                        ; preds = %3
  %25 = load ptr, ptr %0, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %25, i64 184
  %27 = load ptr, ptr %26, align 8
  tail call void %27(ptr noundef nonnull align 8 dereferenceable(488) %0, i32 noundef %1)
  tail call void @glPointSize(float noundef 2.000000e+00)
  tail call void @glBegin(i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %28 = call noundef i32 @_ZNK9RGBDImage7NPixelsEi(ptr noundef nonnull align 8 dereferenceable(488) %0, i32 noundef 0)
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.preheader35.lr.ph, label %._crit_edge40

.preheader35.lr.ph:                               ; preds = %.critedge
  %30 = icmp eq i32 %1, 1
  br i1 %30, label %.preheader35.us, label %.preheader35

.preheader35.us:                                  ; preds = %.preheader35.lr.ph, %._crit_edge.split.us.us
  %.02938.us = phi i32 [ %33, %._crit_edge.split.us.us ], [ 0, %.preheader35.lr.ph ]
  %31 = call noundef i32 @_ZNK9RGBDImage7NPixelsEi(ptr noundef nonnull align 8 dereferenceable(488) %0, i32 noundef 1)
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.lr.ph.us, label %._crit_edge.split.us.us

._crit_edge.split.us.us:                          ; preds = %43, %.preheader35.us
  %33 = add nsw i32 %.02938.us, %2
  %34 = call noundef i32 @_ZNK9RGBDImage7NPixelsEi(ptr noundef nonnull align 8 dereferenceable(488) %0, i32 noundef 0)
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %.preheader35.us, label %._crit_edge40, !llvm.loop !8

.lr.ph.us:                                        ; preds = %.preheader35.us
  %36 = sitofp i32 %.02938.us to double
  %37 = fadd double %36, 5.000000e-01
  br label %38

38:                                               ; preds = %43, %.lr.ph.us
  %.02836.us.us = phi i32 [ 0, %.lr.ph.us ], [ %44, %43 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %39 = sitofp i32 %.02836.us.us to double
  %40 = fadd double %39, 5.000000e-01
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %5, double noundef %37, double noundef %40)
  %41 = call noundef i32 @_Z26RGBDTransformImageToCameraRK7R2PointR7R3PointPK9RGBDImage(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull %0)
  %.not34.us.us = icmp eq i32 %41, 0
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  br i1 %.not34.us.us, label %43, label %42

42:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  call void @_ZNK9RGBDImage10PixelColorEii(ptr dead_on_unwind nonnull writable sret(%class.RNRgb) align 8 %6, ptr noundef nonnull align 8 dereferenceable(488) %0, i32 noundef %.02938.us, i32 noundef %.02836.us.us)
  call void @_Z9RNLoadRgbRK5RNRgb(ptr noundef nonnull align 8 dereferenceable(24) %6)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %4)
  br label %43

43:                                               ; preds = %42, %38
  %44 = add nsw i32 %.02836.us.us, %2
  %45 = call noundef i32 @_ZNK9RGBDImage7NPixelsEi(ptr noundef nonnull align 8 dereferenceable(488) %0, i32 noundef 1)
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %38, label %._crit_edge.split.us.us, !llvm.loop !10

.preheader35:                                     ; preds = %.preheader35.lr.ph, %._crit_edge.split
  %.02938 = phi i32 [ %51, %._crit_edge.split ], [ 0, %.preheader35.lr.ph ]
  %47 = call noundef i32 @_ZNK9RGBDImage7NPixelsEi(ptr noundef nonnull align 8 dereferenceable(488) %0, i32 noundef 1)
  %48 = icmp sgt i32 %47, 0
  br i1 %48, label %.lr.ph, label %._crit_edge.split

.lr.ph:                                           ; preds = %.preheader35
  %49 = sitofp i32 %.02938 to double
  %50 = fadd double %49, 5.000000e-01
  br label %54

._crit_edge40:                                    ; preds = %._crit_edge.split, %._crit_edge.split.us.us, %.critedge
  call void @glEnd()
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  br label %88

._crit_edge.split:                                ; preds = %59, %.preheader35
  %51 = add nsw i32 %.02938, %2
  %52 = call noundef i32 @_ZNK9RGBDImage7NPixelsEi(ptr noundef nonnull align 8 dereferenceable(488) %0, i32 noundef 0)
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %.preheader35, label %._crit_edge40, !llvm.loop !8

54:                                               ; preds = %.lr.ph, %59
  %.02836 = phi i32 [ 0, %.lr.ph ], [ %60, %59 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %55 = sitofp i32 %.02836 to double
  %56 = fadd double %55, 5.000000e-01
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %5, double noundef %50, double noundef %56)
  %57 = call noundef i32 @_Z26RGBDTransformImageToCameraRK7R2PointR7R3PointPK9RGBDImage(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull %0)
  %.not34 = icmp eq i32 %57, 0
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  br i1 %.not34, label %59, label %58

58:                                               ; preds = %54
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %4)
  br label %59

59:                                               ; preds = %54, %58
  %60 = add nsw i32 %.02836, %2
  %61 = call noundef i32 @_ZNK9RGBDImage7NPixelsEi(ptr noundef nonnull align 8 dereferenceable(488) %0, i32 noundef 1)
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %54, label %._crit_edge.split, !llvm.loop !10

.preheader:                                       ; preds = %19, %._crit_edge
  %.02743 = phi i32 [ %69, %._crit_edge ], [ 0, %19 ]
  %63 = call noundef i32 @_ZNK9RGBDImage7NPixelsEi(ptr noundef nonnull align 8 dereferenceable(488) %0, i32 noundef 1)
  %64 = icmp sgt i32 %63, 0
  br i1 %64, label %.lr.ph42, label %._crit_edge

.lr.ph42:                                         ; preds = %.preheader
  %65 = sitofp i32 %.02743 to double
  %66 = fadd double %65, 5.000000e-01
  %67 = add nsw i32 %.02743, 1
  %68 = sitofp i32 %67 to double
  br label %72

._crit_edge44:                                    ; preds = %._crit_edge, %19
  call void @glEnd()
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  br label %88

._crit_edge:                                      ; preds = %84, %.preheader
  %69 = add nsw i32 %.02743, %2
  %70 = call noundef i32 @_ZNK9RGBDImage7NPixelsEi(ptr noundef nonnull align 8 dereferenceable(488) %0, i32 noundef 0)
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %.preheader, label %._crit_edge44, !llvm.loop !11

72:                                               ; preds = %.lr.ph42, %84
  %.041 = phi i32 [ 0, %.lr.ph42 ], [ %85, %84 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #5
  %73 = sitofp i32 %.041 to double
  %74 = fadd double %73, 5.000000e-01
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %10, double noundef %66, double noundef %74)
  %75 = call noundef i32 @_Z26RGBDTransformImageToCameraRK7R2PointR7R3PointPK9RGBDImage(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull %0)
  %.not31 = icmp eq i32 %75, 0
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #5
  br i1 %.not31, label %84, label %76

76:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #5
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %11, double noundef %68, double noundef %73)
  %77 = call noundef i32 @_Z26RGBDTransformImageToCameraRK7R2PointR7R3PointPK9RGBDImage(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull %0)
  %.not32 = icmp eq i32 %77, 0
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #5
  br i1 %.not32, label %84, label %78

78:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #5
  %79 = add nsw i32 %.041, 1
  %80 = sitofp i32 %79 to double
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %12, double noundef %65, double noundef %80)
  %81 = call noundef i32 @_Z26RGBDTransformImageToCameraRK7R2PointR7R3PointPK9RGBDImage(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull %0)
  %.not33 = icmp eq i32 %81, 0
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  br i1 %.not33, label %84, label %82

82:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #5
  call void @_ZN7R3PlaneC1ERK7R3PointS2_S2_(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %9)
  %83 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Plane6NormalEv(ptr noundef nonnull align 8 dereferenceable(32) %13)
  call void @_Z12R3LoadNormalRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %83)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #5
  br label %84

84:                                               ; preds = %78, %76, %72, %82
  %85 = add nsw i32 %.041, %2
  %86 = call noundef i32 @_ZNK9RGBDImage7NPixelsEi(ptr noundef nonnull align 8 dereferenceable(488) %0, i32 noundef 1)
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %72, label %._crit_edge, !llvm.loop !12

88:                                               ; preds = %._crit_edge44, %._crit_edge40
  call void @glPointSize(float noundef 1.000000e+00)
  br i1 %18, label %89, label %90

89:                                               ; preds = %88
  call void @glDisable(i32 noundef 2903)
  call void @glDisable(i32 noundef 2896)
  br label %90

90:                                               ; preds = %89, %88
  %91 = call noundef nonnull align 8 dereferenceable(272) ptr @_ZNK9RGBDImage13CameraToWorldEv(ptr noundef nonnull align 8 dereferenceable(488) %0)
  %92 = load ptr, ptr %91, align 8, !tbaa !5
  %93 = getelementptr inbounds i8, ptr %92, i64 184
  %94 = load ptr, ptr %93, align 8
  call void %94(ptr noundef nonnull align 8 dereferenceable(272) %91)
  ret void
}

declare void @glColorMaterial(i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @glPointSize(float noundef) local_unnamed_addr #2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Plane6NormalEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}
!12 = distinct !{!12, !9}


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