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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP6R2GridEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7R2Image6HeightEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7R2Image5WidthEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9RGBDImage19CreateColorChannelsERK7R2Image(ptr noundef nonnull align 8 dereferenceable(488) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %8 = load ptr, ptr %4, align 8
  %9 = getelementptr inbounds %class.RGBDImage, ptr %8, i32 0, i32 13
  %10 = load i32, ptr %9, align 8, !tbaa !9
  %11 = add nsw i32 %10, 1
  store i32 %11, ptr %9, align 8, !tbaa !9
  %12 = icmp sgt i32 %10, 0
  br i1 %12, label %13, label %14

13:                                               ; preds = %2
  store i32 1, ptr %3, align 4
  br label %93

14:                                               ; preds = %2
  br label %15

15:                                               ; preds = %19, %14
  %16 = getelementptr inbounds %class.RGBDImage, ptr %8, i32 0, i32 3
  %17 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
  %18 = icmp sle i32 %17, 2
  br i1 %18, label %19, label %22

19:                                               ; preds = %15
  %20 = getelementptr inbounds %class.RGBDImage, ptr %8, i32 0, i32 3
  %21 = call noundef ptr @_ZN7RNArrayIP6R2GridE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef null)
  br label %15, !llvm.loop !24

22:                                               ; preds = %15
  %23 = getelementptr inbounds %class.RGBDImage, ptr %8, i32 0, i32 3
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP6R2GridEixEi(ptr noundef nonnull align 8 dereferenceable(16) %23, i32 noundef 0)
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %42, label %27

27:                                               ; preds = %22
  %28 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 208) #5
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = invoke noundef i32 @_ZNK7R2Image5WidthEv(ptr noundef nonnull align 8 dereferenceable(24) %29)
          to label %31 unwind label %38

31:                                               ; preds = %27
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = invoke noundef i32 @_ZNK7R2Image6HeightEv(ptr noundef nonnull align 8 dereferenceable(24) %32)
          to label %34 unwind label %38

34:                                               ; preds = %31
  invoke void @_ZN6R2GridC1Eii(ptr noundef nonnull align 8 dereferenceable(208) %28, i32 noundef %30, i32 noundef %33)
          to label %35 unwind label %38

35:                                               ; preds = %34
  %36 = getelementptr inbounds %class.RGBDImage, ptr %8, i32 0, i32 3
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP6R2GridEixEi(ptr noundef nonnull align 8 dereferenceable(16) %36, i32 noundef 0)
  store ptr %28, ptr %37, align 8, !tbaa !5
  br label %42

38:                                               ; preds = %34, %31, %27
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %6, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %28, i64 noundef 208) #6
  br label %95

42:                                               ; preds = %35, %22
  %43 = getelementptr inbounds %class.RGBDImage, ptr %8, i32 0, i32 3
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP6R2GridEixEi(ptr noundef nonnull align 8 dereferenceable(16) %43, i32 noundef 1)
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %46 = icmp ne ptr %45, null
  br i1 %46, label %62, label %47

47:                                               ; preds = %42
  %48 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 208) #5
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = invoke noundef i32 @_ZNK7R2Image5WidthEv(ptr noundef nonnull align 8 dereferenceable(24) %49)
          to label %51 unwind label %58

51:                                               ; preds = %47
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = invoke noundef i32 @_ZNK7R2Image6HeightEv(ptr noundef nonnull align 8 dereferenceable(24) %52)
          to label %54 unwind label %58

54:                                               ; preds = %51
  invoke void @_ZN6R2GridC1Eii(ptr noundef nonnull align 8 dereferenceable(208) %48, i32 noundef %50, i32 noundef %53)
          to label %55 unwind label %58

55:                                               ; preds = %54
  %56 = getelementptr inbounds %class.RGBDImage, ptr %8, i32 0, i32 3
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP6R2GridEixEi(ptr noundef nonnull align 8 dereferenceable(16) %56, i32 noundef 1)
  store ptr %48, ptr %57, align 8, !tbaa !5
  br label %62

58:                                               ; preds = %54, %51, %47
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %6, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %48, i64 noundef 208) #6
  br label %95

62:                                               ; preds = %55, %42
  %63 = getelementptr inbounds %class.RGBDImage, ptr %8, i32 0, i32 3
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP6R2GridEixEi(ptr noundef nonnull align 8 dereferenceable(16) %63, i32 noundef 2)
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  %66 = icmp ne ptr %65, null
  br i1 %66, label %82, label %67

67:                                               ; preds = %62
  %68 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 208) #5
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = invoke noundef i32 @_ZNK7R2Image5WidthEv(ptr noundef nonnull align 8 dereferenceable(24) %69)
          to label %71 unwind label %78

71:                                               ; preds = %67
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = invoke noundef i32 @_ZNK7R2Image6HeightEv(ptr noundef nonnull align 8 dereferenceable(24) %72)
          to label %74 unwind label %78

74:                                               ; preds = %71
  invoke void @_ZN6R2GridC1Eii(ptr noundef nonnull align 8 dereferenceable(208) %68, i32 noundef %70, i32 noundef %73)
          to label %75 unwind label %78

75:                                               ; preds = %74
  %76 = getelementptr inbounds %class.RGBDImage, ptr %8, i32 0, i32 3
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP6R2GridEixEi(ptr noundef nonnull align 8 dereferenceable(16) %76, i32 noundef 2)
  store ptr %68, ptr %77, align 8, !tbaa !5
  br label %82

78:                                               ; preds = %74, %71, %67
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %6, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %68, i64 noundef 208) #6
  br label %95

82:                                               ; preds = %75, %62
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = load ptr, ptr %8, align 8, !tbaa !26
  %85 = getelementptr inbounds ptr, ptr %84, i64 8
  %86 = load ptr, ptr %85, align 8
  call void %86(ptr noundef nonnull align 8 dereferenceable(488) %8, ptr noundef nonnull align 8 dereferenceable(24) %83)
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = call noundef i32 @_ZNK7R2Image5WidthEv(ptr noundef nonnull align 8 dereferenceable(24) %87)
  %89 = getelementptr inbounds %class.RGBDImage, ptr %8, i32 0, i32 4
  store i32 %88, ptr %89, align 8, !tbaa !28
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = call noundef i32 @_ZNK7R2Image6HeightEv(ptr noundef nonnull align 8 dereferenceable(24) %90)
  %92 = getelementptr inbounds %class.RGBDImage, ptr %8, i32 0, i32 5
  store i32 %91, ptr %92, align 4, !tbaa !29
  store i32 1, ptr %3, align 4
  br label %93

93:                                               ; preds = %82, %13
  %94 = load i32, ptr %3, align 4
  ret i32 %94

95:                                               ; preds = %78, %58, %38
  %96 = load ptr, ptr %6, align 8
  %97 = load i32, ptr %7, align 4
  %98 = insertvalue { ptr, i32 } poison, ptr %96, 0
  %99 = insertvalue { ptr, i32 } %98, i32 %97, 1
  resume { ptr, i32 } %99
}

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

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

declare void @_ZN6R2GridC1Eii(ptr noundef nonnull align 8 dereferenceable(208), i32 noundef, i32 noundef) unnamed_addr #4

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


; 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"

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7R2Image6HeightEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7R2Image5WidthEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9RGBDImage19CreateColorChannelsERK7R2Image(ptr noundef nonnull align 8 dereferenceable(488) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 480
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = add nsw i32 %4, 1
  store i32 %5, ptr %3, align 8, !tbaa !5
  %6 = icmp sgt i32 %4, 0
  br i1 %6, label %53, label %.preheader

.preheader:                                       ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 24
  %8 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %9 = icmp slt i32 %8, 3
  br i1 %9, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %10 = tail call noundef ptr @_ZN7RNArrayIP6R2GridE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef null)
  %11 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %12 = icmp slt i32 %11, 3
  br i1 %12, label %.lr.ph, label %._crit_edge, !llvm.loop !23

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP6R2GridEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef 0)
  %14 = load ptr, ptr %13, align 8, !tbaa !25
  %.not = icmp eq ptr %14, null
  br i1 %.not, label %15, label %23

15:                                               ; preds = %._crit_edge
  %16 = tail call noalias noundef nonnull dereferenceable(208) ptr @_Znwm(i64 noundef 208) #5
  %17 = tail call noundef i32 @_ZNK7R2Image5WidthEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %18 = tail call noundef i32 @_ZNK7R2Image6HeightEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  invoke void @_ZN6R2GridC1Eii(ptr noundef nonnull align 8 dereferenceable(208) %16, i32 noundef %17, i32 noundef %18)
          to label %19 unwind label %21

19:                                               ; preds = %15
  %20 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP6R2GridEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef 0)
  store ptr %16, ptr %20, align 8, !tbaa !25
  br label %23

21:                                               ; preds = %15
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %54

23:                                               ; preds = %19, %._crit_edge
  %24 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP6R2GridEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef 1)
  %25 = load ptr, ptr %24, align 8, !tbaa !25
  %.not14 = icmp eq ptr %25, null
  br i1 %.not14, label %26, label %34

26:                                               ; preds = %23
  %27 = tail call noalias noundef nonnull dereferenceable(208) ptr @_Znwm(i64 noundef 208) #5
  %28 = tail call noundef i32 @_ZNK7R2Image5WidthEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %29 = tail call noundef i32 @_ZNK7R2Image6HeightEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  invoke void @_ZN6R2GridC1Eii(ptr noundef nonnull align 8 dereferenceable(208) %27, i32 noundef %28, i32 noundef %29)
          to label %30 unwind label %32

30:                                               ; preds = %26
  %31 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP6R2GridEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef 1)
  store ptr %27, ptr %31, align 8, !tbaa !25
  br label %34

32:                                               ; preds = %26
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %54

34:                                               ; preds = %30, %23
  %35 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP6R2GridEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef 2)
  %36 = load ptr, ptr %35, align 8, !tbaa !25
  %.not15 = icmp eq ptr %36, null
  br i1 %.not15, label %37, label %45

37:                                               ; preds = %34
  %38 = tail call noalias noundef nonnull dereferenceable(208) ptr @_Znwm(i64 noundef 208) #5
  %39 = tail call noundef i32 @_ZNK7R2Image5WidthEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %40 = tail call noundef i32 @_ZNK7R2Image6HeightEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  invoke void @_ZN6R2GridC1Eii(ptr noundef nonnull align 8 dereferenceable(208) %38, i32 noundef %39, i32 noundef %40)
          to label %41 unwind label %43

41:                                               ; preds = %37
  %42 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP6R2GridEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef 2)
  store ptr %38, ptr %42, align 8, !tbaa !25
  br label %45

43:                                               ; preds = %37
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %54

45:                                               ; preds = %41, %34
  %46 = load ptr, ptr %0, align 8, !tbaa !26
  %47 = getelementptr inbounds i8, ptr %46, i64 64
  %48 = load ptr, ptr %47, align 8
  tail call void %48(ptr noundef nonnull align 8 dereferenceable(488) %0, ptr noundef nonnull align 8 dereferenceable(24) %1)
  %49 = tail call noundef i32 @_ZNK7R2Image5WidthEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %50 = getelementptr inbounds i8, ptr %0, i64 40
  store i32 %49, ptr %50, align 8, !tbaa !28
  %51 = tail call noundef i32 @_ZNK7R2Image6HeightEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %52 = getelementptr inbounds i8, ptr %0, i64 44
  store i32 %51, ptr %52, align 4, !tbaa !29
  br label %53

53:                                               ; preds = %2, %45
  ret i32 1

54:                                               ; preds = %43, %32, %21
  %.sink = phi ptr [ %38, %43 ], [ %27, %32 ], [ %16, %21 ]
  %.pn = phi { ptr, i32 } [ %44, %43 ], [ %33, %32 ], [ %22, %21 ]
  tail call void @_ZdlPvm(ptr noundef nonnull %.sink, i64 noundef 208) #6
  resume { ptr, i32 } %.pn
}

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

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

declare void @_ZN6R2GridC1Eii(ptr noundef nonnull align 8 dereferenceable(208), i32 noundef, i32 noundef) unnamed_addr #4

attributes #0 = { 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 #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 = { 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 #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 = { "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 = { builtin allocsize(0) }
attributes #6 = { 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, !10, i64 480}
!6 = !{!"_ZTS9RGBDImage", !7, i64 8, !10, i64 16, !11, i64 24, !10, i64 40, !10, i64 44, !13, i64 48, !18, i64 320, !19, i64 392, !10, i64 448, !7, i64 456, !7, i64 464, !7, i64 472, !10, i64 480, !10, i64 484}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTS7RNArrayIP6R2GridE", !12, i64 0}
!12 = !{!"_ZTS8RNVArray", !7, i64 0, !10, i64 8, !10, i64 12}
!13 = !{!"_ZTS8R3Affine", !14, i64 0, !15, i64 8, !15, i64 136, !16, i64 264}
!14 = !{!"_ZTS16R3Transformation"}
!15 = !{!"_ZTS8R4Matrix", !8, i64 0}
!16 = !{!"_ZTS7RNFlags", !17, i64 0}
!17 = !{!"long", !8, i64 0}
!18 = !{!"_ZTS8R3Matrix", !8, i64 0}
!19 = !{!"_ZTS5R3Box", !20, i64 0, !22, i64 8, !22, i64 32}
!20 = !{!"_ZTS7R3Solid", !21, i64 0}
!21 = !{!"_ZTS7R3Shape"}
!22 = !{!"_ZTS7R3Point", !8, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!7, !7, i64 0}
!26 = !{!27, !27, i64 0}
!27 = !{!"vtable pointer", !9, i64 0}
!28 = !{!6, !10, i64 40}
!29 = !{!6, !10, i64 44}


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