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

; 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.R3Vector = type { [3 x double] }
%class.R3Point = type { [3 x double] }
%class.R2Point = type { [2 x double] }
%class.R3Triad = type { [3 x %class.R3Vector] }
%class.RGBDImage = type { ptr, ptr, i32, %class.RNArray, i32, i32, %class.R3Affine, %class.R3Matrix, %class.R3Box, i32, ptr, ptr, ptr, i32, i32 }
%class.RNArray = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }
%class.R3Affine = type { %class.R3Transformation, %class.R4Matrix, %class.R4Matrix, %class.RNFlags }
%class.R3Transformation = type { ptr }
%class.R4Matrix = type { [4 x [4 x double]] }
%class.RNFlags = type { i64 }
%class.R3Matrix = type { [3 x [3 x double]] }
%class.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }

@R3null_vector = external global %class.R3Vector, align 8

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK9RGBDImage16PixelWorldNormalEii(ptr dead_on_unwind noalias writable sret(%class.R3Vector) align 8 %0, ptr noundef nonnull align 8 dereferenceable(488) %1, i32 noundef %2, i32 noundef %3) #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %class.R3Point, align 8
  %20 = alloca %class.R2Point, align 8
  %21 = alloca %class.R3Point, align 8
  %22 = alloca %class.R3Triad, align 8
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  %23 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 64, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %24 = call noalias noundef nonnull ptr @_Znam(i64 noundef 399384) #8
  %25 = getelementptr inbounds %class.R3Point, ptr %24, i64 16641
  br label %26

26:                                               ; preds = %28, %4
  %27 = phi ptr [ %24, %4 ], [ %29, %28 ]
  invoke void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %27)
          to label %28 unwind label %36

28:                                               ; preds = %26
  %29 = getelementptr inbounds %class.R3Point, ptr %27, i64 1
  %30 = icmp eq ptr %29, %25
  br i1 %30, label %31, label %26

31:                                               ; preds = %28
  store ptr %24, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 -64, ptr %14, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %96, %31
  %33 = load i32, ptr %14, align 4, !tbaa !9
  %34 = icmp sle i32 %33, 64
  br i1 %34, label %40, label %35

35:                                               ; preds = %32
  store i32 2, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %99

36:                                               ; preds = %26
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %11, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %12, align 4
  call void @_ZdaPvm(ptr noundef %24, i64 noundef 399384) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %122

40:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %41 = load i32, ptr %7, align 4, !tbaa !9
  %42 = load i32, ptr %14, align 4, !tbaa !9
  %43 = add nsw i32 %41, %42
  store i32 %43, ptr %16, align 4, !tbaa !9
  %44 = load i32, ptr %16, align 4, !tbaa !9
  %45 = icmp slt i32 %44, 0
  br i1 %45, label %51, label %46

46:                                               ; preds = %40
  %47 = load i32, ptr %16, align 4, !tbaa !9
  %48 = getelementptr inbounds %class.RGBDImage, ptr %23, i32 0, i32 4
  %49 = load i32, ptr %48, align 8, !tbaa !11
  %50 = icmp sge i32 %47, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %46, %40
  store i32 4, ptr %15, align 4
  br label %93

52:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 -64, ptr %17, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %89, %52
  %54 = load i32, ptr %17, align 4, !tbaa !9
  %55 = icmp sle i32 %54, 64
  br i1 %55, label %57, label %56

56:                                               ; preds = %53
  store i32 5, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %92

57:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %58 = load i32, ptr %8, align 4, !tbaa !9
  %59 = load i32, ptr %17, align 4, !tbaa !9
  %60 = add nsw i32 %58, %59
  store i32 %60, ptr %18, align 4, !tbaa !9
  %61 = load i32, ptr %18, align 4, !tbaa !9
  %62 = icmp slt i32 %61, 0
  br i1 %62, label %68, label %63

63:                                               ; preds = %57
  %64 = load i32, ptr %18, align 4, !tbaa !9
  %65 = getelementptr inbounds %class.RGBDImage, ptr %23, i32 0, i32 5
  %66 = load i32, ptr %65, align 4, !tbaa !25
  %67 = icmp sge i32 %64, %66
  br i1 %67, label %68, label %69

68:                                               ; preds = %63, %57
  store i32 7, ptr %15, align 4
  br label %86

69:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #7
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %19)
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #7
  %70 = load i32, ptr %16, align 4, !tbaa !9
  %71 = sitofp i32 %70 to double
  %72 = fadd double %71, 5.000000e-01
  %73 = load i32, ptr %18, align 4, !tbaa !9
  %74 = sitofp i32 %73 to double
  %75 = fadd double %74, 5.000000e-01
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %20, double noundef %72, double noundef %75)
  %76 = call noundef i32 @_Z26RGBDTransformImageToCameraRK7R2PointR7R3PointPK9RGBDImage(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef %23)
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %85

78:                                               ; preds = %69
  %79 = load ptr, ptr %10, align 8, !tbaa !5
  %80 = load i32, ptr %13, align 4, !tbaa !9
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %13, align 4, !tbaa !9
  %82 = sext i32 %80 to i64
  %83 = getelementptr inbounds %class.R3Point, ptr %79, i64 %82
  %84 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %83, ptr noundef nonnull align 8 dereferenceable(24) %19)
  br label %85

85:                                               ; preds = %78, %69
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #7
  store i32 0, ptr %15, align 4
  br label %86

86:                                               ; preds = %85, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  %87 = load i32, ptr %15, align 4
  switch i32 %87, label %127 [
    i32 0, label %88
    i32 7, label %89
  ]

88:                                               ; preds = %86
  br label %89

89:                                               ; preds = %88, %86
  %90 = load i32, ptr %17, align 4, !tbaa !9
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %17, align 4, !tbaa !9
  br label %53, !llvm.loop !26

92:                                               ; preds = %56
  store i32 0, ptr %15, align 4
  br label %93

93:                                               ; preds = %92, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  %94 = load i32, ptr %15, align 4
  switch i32 %94, label %127 [
    i32 0, label %95
    i32 4, label %96
  ]

95:                                               ; preds = %93
  br label %96

96:                                               ; preds = %95, %93
  %97 = load i32, ptr %14, align 4, !tbaa !9
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %14, align 4, !tbaa !9
  br label %32, !llvm.loop !28

99:                                               ; preds = %35
  %100 = load i32, ptr %13, align 4, !tbaa !9
  %101 = icmp slt i32 %100, 3
  br i1 %101, label %102, label %103

102:                                              ; preds = %99
  call void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) @R3null_vector)
  store i32 1, ptr %15, align 4
  br label %121

103:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #7
  %104 = load i32, ptr %13, align 4, !tbaa !9
  %105 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_Z10R3CentroidiP7R3PointPKd(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %21, i32 noundef %104, ptr noundef %105, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 72, ptr %22) #7
  %106 = load i32, ptr %13, align 4, !tbaa !9
  %107 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_Z15R3PrincipleAxesRK7R3PointiPS_PKdPd(ptr dead_on_unwind writable sret(%class.R3Triad) align 8 %22, ptr noundef nonnull align 8 dereferenceable(24) %21, i32 noundef %106, ptr noundef %107, ptr noundef null, ptr noundef null)
  %108 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72) %22, i32 noundef 2)
  %109 = call noundef double @_ZNK8R3Vector1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %108)
  %110 = fcmp ogt double %109, 0.000000e+00
  br i1 %110, label %111, label %113

111:                                              ; preds = %103
  %112 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72) %22, i32 noundef 2)
  call void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %112)
  br label %115

113:                                              ; preds = %103
  %114 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72) %22, i32 noundef 2)
  call void @_ZngRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %114)
  br label %115

115:                                              ; preds = %113, %111
  %116 = getelementptr inbounds %class.RGBDImage, ptr %23, i32 0, i32 6
  call void @_ZN8R3Vector9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %116)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %117 = load ptr, ptr %10, align 8, !tbaa !5
  %118 = icmp eq ptr %117, null
  br i1 %118, label %120, label %119

119:                                              ; preds = %115
  call void @_ZdaPv(ptr noundef %117) #9
  br label %120

120:                                              ; preds = %119, %115
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 72, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #7
  br label %121

121:                                              ; preds = %120, %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  ret void

122:                                              ; preds = %36
  %123 = load ptr, ptr %11, align 8
  %124 = load i32, ptr %12, align 4
  %125 = insertvalue { ptr, i32 } poison, ptr %123, 0
  %126 = insertvalue { ptr, i32 } %125, i32 %124, 1
  resume { ptr, i32 } %126

127:                                              ; preds = %93, %86
  unreachable
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #3

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPvm(ptr noundef, i64 noundef) #4

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

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

declare void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1

declare void @_Z10R3CentroidiP7R3PointPKd(ptr dead_on_unwind writable sret(%class.R3Point) align 8, i32 noundef, ptr noundef, ptr noundef) #1

declare void @_Z15R3PrincipleAxesRK7R3PointiPS_PKdPd(ptr dead_on_unwind writable sret(%class.R3Triad) align 8, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef, ptr noundef, ptr noundef) #1

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

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

declare void @_ZngRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24)) #1

declare void @_ZN8R3Vector9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #1

declare void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 = { nobuiltin allocsize(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 = { nobuiltin nounwind "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 = { 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin 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, !10, i64 40}
!12 = !{!"_ZTS9RGBDImage", !6, i64 8, !10, i64 16, !13, i64 24, !10, i64 40, !10, i64 44, !15, i64 48, !20, i64 320, !21, i64 392, !10, i64 448, !6, i64 456, !6, i64 464, !6, i64 472, !10, i64 480, !10, i64 484}
!13 = !{!"_ZTS7RNArrayIP6R2GridE", !14, i64 0}
!14 = !{!"_ZTS8RNVArray", !6, i64 0, !10, i64 8, !10, i64 12}
!15 = !{!"_ZTS8R3Affine", !16, i64 0, !17, i64 8, !17, i64 136, !18, i64 264}
!16 = !{!"_ZTS16R3Transformation"}
!17 = !{!"_ZTS8R4Matrix", !7, i64 0}
!18 = !{!"_ZTS7RNFlags", !19, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!"_ZTS8R3Matrix", !7, i64 0}
!21 = !{!"_ZTS5R3Box", !22, i64 0, !24, i64 8, !24, i64 32}
!22 = !{!"_ZTS7R3Solid", !23, i64 0}
!23 = !{!"_ZTS7R3Shape"}
!24 = !{!"_ZTS7R3Point", !7, i64 0}
!25 = !{!12, !10, i64 44}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}


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

@R3null_vector = external global %class.R3Vector, align 8

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK9RGBDImage16PixelWorldNormalEii(ptr dead_on_unwind noalias writable sret(%class.R3Vector) align 8 %0, ptr noundef nonnull align 8 dereferenceable(488) %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %class.R3Point, align 8
  %6 = alloca %class.R2Point, align 8
  %7 = alloca %class.R3Point, align 8
  %8 = alloca %class.R3Triad, align 8
  %9 = tail call noalias noundef nonnull dereferenceable(399384) ptr @_Znam(i64 noundef 399384) #7
  br label %10

10:                                               ; preds = %11, %4
  %.idx = phi i64 [ 0, %4 ], [ %.add, %11 ]
  %.ptr = getelementptr inbounds i8, ptr %9, i64 %.idx
  invoke void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr)
          to label %11 unwind label %17

11:                                               ; preds = %10
  %.add = add nuw nsw i64 %.idx, 24
  %12 = icmp eq i64 %.add, 399384
  br i1 %12, label %.preheader35, label %10

.preheader35:                                     ; preds = %11
  %13 = getelementptr inbounds i8, ptr %1, i64 40
  %14 = getelementptr inbounds i8, ptr %1, i64 44
  br label %19

15:                                               ; preds = %.loopexit
  %16 = icmp slt i32 %.4, 3
  br i1 %16, label %42, label %43

17:                                               ; preds = %10
  %18 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdaPvm(ptr noundef nonnull %9, i64 noundef 399384) #8
  resume { ptr, i32 } %18

19:                                               ; preds = %.preheader35, %.loopexit
  %.039 = phi i32 [ 0, %.preheader35 ], [ %.4, %.loopexit ]
  %.02538 = phi i32 [ -64, %.preheader35 ], [ %41, %.loopexit ]
  %20 = add nsw i32 %.02538, %2
  %21 = icmp sgt i32 %20, -1
  %22 = load i32, ptr %13, align 8
  %.not = icmp slt i32 %20, %22
  %or.cond = select i1 %21, i1 %.not, i1 false
  br i1 %or.cond, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %19
  %23 = uitofp nneg i32 %20 to double
  %24 = fadd double %23, 5.000000e-01
  br label %25

25:                                               ; preds = %.preheader, %39
  %.137 = phi i32 [ %.039, %.preheader ], [ %.3, %39 ]
  %.02436 = phi i32 [ -64, %.preheader ], [ %40, %39 ]
  %26 = add nsw i32 %.02436, %3
  %27 = icmp sgt i32 %26, -1
  %28 = load i32, ptr %14, align 4
  %.not30 = icmp slt i32 %26, %28
  %or.cond34 = select i1 %27, i1 %.not30, i1 false
  br i1 %or.cond34, label %29, label %39

29:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #9
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %5)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #9
  %30 = uitofp nneg i32 %26 to double
  %31 = fadd double %30, 5.000000e-01
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %6, double noundef %24, double noundef %31)
  %32 = call noundef i32 @_Z26RGBDTransformImageToCameraRK7R2PointR7R3PointPK9RGBDImage(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull %1)
  %.not31 = icmp eq i32 %32, 0
  br i1 %.not31, label %38, label %33

33:                                               ; preds = %29
  %34 = add nsw i32 %.137, 1
  %35 = sext i32 %.137 to i64
  %36 = getelementptr inbounds %class.R3Point, ptr %9, i64 %35
  %37 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 8 dereferenceable(24) %5)
  br label %38

38:                                               ; preds = %33, %29
  %.2 = phi i32 [ %34, %33 ], [ %.137, %29 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #9
  br label %39

39:                                               ; preds = %25, %38
  %.3 = phi i32 [ %.2, %38 ], [ %.137, %25 ]
  %40 = add nsw i32 %.02436, 1
  %exitcond.not = icmp eq i32 %40, 65
  br i1 %exitcond.not, label %.loopexit, label %25, !llvm.loop !5

.loopexit:                                        ; preds = %39, %19
  %.4 = phi i32 [ %.039, %19 ], [ %.3, %39 ]
  %41 = add nsw i32 %.02538, 1
  %exitcond40.not = icmp eq i32 %41, 65
  br i1 %exitcond40.not, label %15, label %19, !llvm.loop !7

42:                                               ; preds = %15
  call void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) @R3null_vector)
  br label %52

43:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #9
  call void @_Z10R3CentroidiP7R3PointPKd(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %7, i32 noundef %.4, ptr noundef nonnull %9, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %8) #9
  call void @_Z15R3PrincipleAxesRK7R3PointiPS_PKdPd(ptr dead_on_unwind nonnull writable sret(%class.R3Triad) align 8 %8, ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef %.4, ptr noundef nonnull %9, ptr noundef null, ptr noundef null)
  %44 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72) %8, i32 noundef 2)
  %45 = call noundef double @_ZNK8R3Vector1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %44)
  %46 = fcmp ogt double %45, 0.000000e+00
  %47 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72) %8, i32 noundef 2)
  br i1 %46, label %48, label %49

48:                                               ; preds = %43
  call void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %47)
  br label %50

49:                                               ; preds = %43
  call void @_ZngRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %47)
  br label %50

50:                                               ; preds = %49, %48
  %51 = getelementptr inbounds i8, ptr %1, i64 48
  call void @_ZN8R3Vector9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %51)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  call void @_ZdaPv(ptr noundef nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #9
  br label %52

52:                                               ; preds = %50, %42
  ret void
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #3

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPvm(ptr noundef, i64 noundef) local_unnamed_addr #4

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

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 #1

declare void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1

declare void @_Z10R3CentroidiP7R3PointPKd(ptr dead_on_unwind writable sret(%class.R3Point) align 8, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @_Z15R3PrincipleAxesRK7R3PointiPS_PKdPd(ptr dead_on_unwind writable sret(%class.R3Triad) align 8, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

declare void @_ZngRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

declare void @_ZN8R3Vector9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

declare void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 = { nobuiltin allocsize(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 = { nobuiltin nounwind "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 = { 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 #6 = { 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 #7 = { builtin allocsize(0) }
attributes #8 = { builtin nounwind }
attributes #9 = { 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 = distinct !{!7, !6}


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