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

; 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.R2Grid = type { %class.R2Affine, %class.R2Affine, double, ptr, [2 x i32], i32, i32 }
%class.R2Affine = type <{ %class.R2Transformation, %class.R3Matrix, i32, [4 x i8] }>
%class.R2Transformation = type { ptr }
%class.R3Matrix = type { [3 x [3 x double]] }
%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.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Point = type { [3 x double] }

@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [10 x i8], align 1

; 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

; Function Attrs: nounwind
declare void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208)) unnamed_addr #1

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

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

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9RGBDImage16ReadDepthChannelEv(ptr noundef nonnull align 8 dereferenceable(488) %0) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca %class.R2Grid, align 8
  %5 = alloca [4096 x i8], align 16
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %12 = load ptr, ptr %3, align 8
  %13 = getelementptr inbounds %class.RGBDImage, ptr %12, i32 0, i32 14
  %14 = load i32, ptr %13, align 4, !tbaa !9
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %16, label %20

16:                                               ; preds = %1
  %17 = getelementptr inbounds %class.RGBDImage, ptr %12, i32 0, i32 14
  %18 = load i32, ptr %17, align 4, !tbaa !9
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr %17, align 4, !tbaa !9
  store i32 1, ptr %2, align 4
  br label %170

20:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 208, ptr %4) #6
  %21 = getelementptr inbounds %class.RGBDImage, ptr %12, i32 0, i32 4
  %22 = load i32, ptr %21, align 8, !tbaa !24
  %23 = getelementptr inbounds %class.RGBDImage, ptr %12, i32 0, i32 5
  %24 = load i32, ptr %23, align 4, !tbaa !25
  call void @_ZN6R2GridC1Eii(ptr noundef nonnull align 8 dereferenceable(208) %4, i32 noundef %22, i32 noundef %24)
  %25 = getelementptr inbounds %class.RGBDImage, ptr %12, i32 0, i32 12
  %26 = load ptr, ptr %25, align 8, !tbaa !26
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %158

28:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4096, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %29 = getelementptr inbounds %class.RGBDImage, ptr %12, i32 0, i32 1
  %30 = load ptr, ptr %29, align 8, !tbaa !27
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %37

32:                                               ; preds = %28
  %33 = getelementptr inbounds %class.RGBDImage, ptr %12, i32 0, i32 1
  %34 = load ptr, ptr %33, align 8, !tbaa !27
  %35 = invoke noundef ptr @_ZNK17RGBDConfiguration14DepthDirectoryEv(ptr noundef nonnull align 8 dereferenceable(128) %34)
          to label %36 unwind label %48

36:                                               ; preds = %32
  br label %38

37:                                               ; preds = %28
  br label %38

38:                                               ; preds = %37, %36
  %39 = phi ptr [ %35, %36 ], [ null, %37 ]
  store ptr %39, ptr %6, align 8, !tbaa !5
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = icmp ne ptr %40, null
  br i1 %41, label %42, label %52

42:                                               ; preds = %38
  %43 = getelementptr inbounds [4096 x i8], ptr %5, i64 0, i64 0
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds %class.RGBDImage, ptr %12, i32 0, i32 12
  %46 = load ptr, ptr %45, align 8, !tbaa !26
  %47 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %43, ptr noundef @.str.4, ptr noundef %44, ptr noundef %46) #6
  br label %57

48:                                               ; preds = %132, %125, %118, %111, %105, %97, %90, %88, %81, %75, %69, %63, %57, %32
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %7, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %8, align 4
  br label %157

52:                                               ; preds = %38
  %53 = getelementptr inbounds [4096 x i8], ptr %5, i64 0, i64 0
  %54 = getelementptr inbounds %class.RGBDImage, ptr %12, i32 0, i32 12
  %55 = load ptr, ptr %54, align 8, !tbaa !26
  %56 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %53, ptr noundef @.str.5, ptr noundef %55) #6
  br label %57

57:                                               ; preds = %52, %42
  %58 = getelementptr inbounds [4096 x i8], ptr %5, i64 0, i64 0
  %59 = invoke noundef i32 @_ZN6R2Grid8ReadFileEPKc(ptr noundef nonnull align 8 dereferenceable(208) %4, ptr noundef %58)
          to label %60 unwind label %48

60:                                               ; preds = %57
  %61 = icmp ne i32 %59, 0
  br i1 %61, label %63, label %62

62:                                               ; preds = %60
  store i32 0, ptr %2, align 4
  store i32 1, ptr %9, align 4
  br label %154

63:                                               ; preds = %60
  invoke void @_ZN6R2Grid10SubstituteEdd(ptr noundef nonnull align 8 dereferenceable(208) %4, double noundef 0.000000e+00, double noundef -3.210000e+02)
          to label %64 unwind label %48

64:                                               ; preds = %63
  %65 = getelementptr inbounds %class.RGBDImage, ptr %12, i32 0, i32 12
  %66 = load ptr, ptr %65, align 8, !tbaa !26
  %67 = call noundef ptr @strstr(ptr noundef %66, ptr noundef @.str.6) #7
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %71

69:                                               ; preds = %64
  invoke void @_ZN6R2Grid8MultiplyEd(ptr noundef nonnull align 8 dereferenceable(208) %4, double noundef 1.000000e-03)
          to label %70 unwind label %48

70:                                               ; preds = %69
  br label %71

71:                                               ; preds = %70, %64
  %72 = getelementptr inbounds %class.RGBDImage, ptr %12, i32 0, i32 1
  %73 = load ptr, ptr %72, align 8, !tbaa !27
  %74 = icmp ne ptr %73, null
  br i1 %74, label %75, label %101

75:                                               ; preds = %71
  %76 = getelementptr inbounds %class.RGBDImage, ptr %12, i32 0, i32 1
  %77 = load ptr, ptr %76, align 8, !tbaa !27
  %78 = invoke noundef ptr @_ZNK17RGBDConfiguration13DatasetFormatEv(ptr noundef nonnull align 8 dereferenceable(128) %77)
          to label %79 unwind label %48

79:                                               ; preds = %75
  %80 = icmp ne ptr %78, null
  br i1 %80, label %81, label %101

81:                                               ; preds = %79
  %82 = getelementptr inbounds %class.RGBDImage, ptr %12, i32 0, i32 1
  %83 = load ptr, ptr %82, align 8, !tbaa !27
  %84 = invoke noundef ptr @_ZNK17RGBDConfiguration13DatasetFormatEv(ptr noundef nonnull align 8 dereferenceable(128) %83)
          to label %85 unwind label %48

85:                                               ; preds = %81
  %86 = call i32 @strcmp(ptr noundef %84, ptr noundef @.str.7) #7
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %90, label %88

88:                                               ; preds = %85
  invoke void @_ZN6R2Grid8MultiplyEd(ptr noundef nonnull align 8 dereferenceable(208) %4, double noundef 2.500000e-01)
          to label %89 unwind label %48

89:                                               ; preds = %88
  br label %100

90:                                               ; preds = %85
  %91 = getelementptr inbounds %class.RGBDImage, ptr %12, i32 0, i32 1
  %92 = load ptr, ptr %91, align 8, !tbaa !27
  %93 = invoke noundef ptr @_ZNK17RGBDConfiguration13DatasetFormatEv(ptr noundef nonnull align 8 dereferenceable(128) %92)
          to label %94 unwind label %48

94:                                               ; preds = %90
  %95 = call i32 @strcmp(ptr noundef %93, ptr noundef @.str.8) #7
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %99, label %97

97:                                               ; preds = %94
  invoke void @_ZN6R2Grid8MultiplyEd(ptr noundef nonnull align 8 dereferenceable(208) %4, double noundef 2.000000e-01)
          to label %98 unwind label %48

98:                                               ; preds = %97
  br label %99

99:                                               ; preds = %98, %94
  br label %100

100:                                              ; preds = %99, %89
  br label %101

101:                                              ; preds = %100, %79, %71
  %102 = getelementptr inbounds %class.RGBDImage, ptr %12, i32 0, i32 1
  %103 = load ptr, ptr %102, align 8, !tbaa !27
  %104 = icmp ne ptr %103, null
  br i1 %104, label %105, label %153

105:                                              ; preds = %101
  %106 = getelementptr inbounds %class.RGBDImage, ptr %12, i32 0, i32 1
  %107 = load ptr, ptr %106, align 8, !tbaa !27
  %108 = invoke noundef ptr @_ZNK17RGBDConfiguration13DatasetFormatEv(ptr noundef nonnull align 8 dereferenceable(128) %107)
          to label %109 unwind label %48

109:                                              ; preds = %105
  %110 = icmp ne ptr %108, null
  br i1 %110, label %111, label %153

111:                                              ; preds = %109
  %112 = getelementptr inbounds %class.RGBDImage, ptr %12, i32 0, i32 1
  %113 = load ptr, ptr %112, align 8, !tbaa !27
  %114 = invoke noundef ptr @_ZNK17RGBDConfiguration13DatasetFormatEv(ptr noundef nonnull align 8 dereferenceable(128) %113)
          to label %115 unwind label %48

115:                                              ; preds = %111
  %116 = call i32 @strcmp(ptr noundef %114, ptr noundef @.str.9) #7
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %118, label %139

118:                                              ; preds = %115
  %119 = getelementptr inbounds %class.RGBDImage, ptr %12, i32 0, i32 1
  %120 = load ptr, ptr %119, align 8, !tbaa !27
  %121 = invoke noundef ptr @_ZNK17RGBDConfiguration13DatasetFormatEv(ptr noundef nonnull align 8 dereferenceable(128) %120)
          to label %122 unwind label %48

122:                                              ; preds = %118
  %123 = call i32 @strcmp(ptr noundef %121, ptr noundef @.str.10) #7
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %139

125:                                              ; preds = %122
  %126 = getelementptr inbounds %class.RGBDImage, ptr %12, i32 0, i32 1
  %127 = load ptr, ptr %126, align 8, !tbaa !27
  %128 = invoke noundef ptr @_ZNK17RGBDConfiguration13DatasetFormatEv(ptr noundef nonnull align 8 dereferenceable(128) %127)
          to label %129 unwind label %48

129:                                              ; preds = %125
  %130 = call i32 @strcmp(ptr noundef %128, ptr noundef @.str.11) #7
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %139

132:                                              ; preds = %129
  %133 = getelementptr inbounds %class.RGBDImage, ptr %12, i32 0, i32 1
  %134 = load ptr, ptr %133, align 8, !tbaa !27
  %135 = invoke noundef ptr @_ZNK17RGBDConfiguration13DatasetFormatEv(ptr noundef nonnull align 8 dereferenceable(128) %134)
          to label %136 unwind label %48

136:                                              ; preds = %132
  %137 = call i32 @strcmp(ptr noundef %135, ptr noundef @.str.12) #7
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %152, label %139

139:                                              ; preds = %136, %129, %122, %115
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store double 5.000000e-02, ptr %10, align 8, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %140 = invoke noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %4)
          to label %141 unwind label %148

141:                                              ; preds = %139
  %142 = mul nsw i32 3, %140
  %143 = sitofp i32 %142 to double
  %144 = fdiv double %143, 6.400000e+02
  store double %144, ptr %11, align 8, !tbaa !28
  %145 = load double, ptr %11, align 8, !tbaa !28
  %146 = load double, ptr %10, align 8, !tbaa !28
  invoke void @_ZN6R2Grid15BilateralFilterEdd(ptr noundef nonnull align 8 dereferenceable(208) %4, double noundef %145, double noundef %146)
          to label %147 unwind label %148

147:                                              ; preds = %141
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %152

148:                                              ; preds = %141, %139
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %7, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %157

152:                                              ; preds = %147, %136
  br label %153

153:                                              ; preds = %152, %109, %101
  store i32 0, ptr %9, align 4
  br label %154

154:                                              ; preds = %153, %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4096, ptr %5) #6
  %155 = load i32, ptr %9, align 4
  switch i32 %155, label %168 [
    i32 0, label %156
  ]

156:                                              ; preds = %154
  br label %158

157:                                              ; preds = %148, %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4096, ptr %5) #6
  br label %169

158:                                              ; preds = %156, %20
  %159 = load ptr, ptr %12, align 8, !tbaa !30
  %160 = getelementptr inbounds ptr, ptr %159, i64 34
  %161 = load ptr, ptr %160, align 8
  %162 = invoke noundef i32 %161(ptr noundef nonnull align 8 dereferenceable(488) %12, ptr noundef nonnull align 8 dereferenceable(208) %4)
          to label %163 unwind label %164

163:                                              ; preds = %158
  store i32 %162, ptr %2, align 4
  store i32 1, ptr %9, align 4
  br label %168

164:                                              ; preds = %158
  %165 = landingpad { ptr, i32 }
          cleanup
  %166 = extractvalue { ptr, i32 } %165, 0
  store ptr %166, ptr %7, align 8
  %167 = extractvalue { ptr, i32 } %165, 1
  store i32 %167, ptr %8, align 4
  br label %169

168:                                              ; preds = %163, %154
  call void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208) %4) #6
  call void @llvm.lifetime.end.p0(i64 208, ptr %4) #6
  br label %170

169:                                              ; preds = %164, %157
  call void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208) %4) #6
  call void @llvm.lifetime.end.p0(i64 208, ptr %4) #6
  br label %172

170:                                              ; preds = %168, %16
  %171 = load i32, ptr %2, align 4
  ret i32 %171

172:                                              ; preds = %169
  %173 = load ptr, ptr %7, align 8
  %174 = load i32, ptr %8, align 4
  %175 = insertvalue { ptr, i32 } poison, ptr %173, 0
  %176 = insertvalue { ptr, i32 } %175, i32 %174, 1
  resume { ptr, i32 } %176
}

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

declare noundef i32 @_ZN6R2Grid8ReadFileEPKc(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef) #3

declare void @_ZN6R2Grid10SubstituteEdd(ptr noundef nonnull align 8 dereferenceable(208), double noundef, double noundef) #3

; Function Attrs: nounwind willreturn memory(read)
declare noundef ptr @strstr(ptr noundef, ptr noundef) #5

declare void @_ZN6R2Grid8MultiplyEd(ptr noundef nonnull align 8 dereferenceable(208), double noundef) #3

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #5

declare void @_ZN6R2Grid15BilateralFilterEdd(ptr noundef nonnull align 8 dereferenceable(208), double noundef, double noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { "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 = { 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 willreturn memory(read) "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 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }

!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 484}
!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 = !{!10, !11, i64 40}
!25 = !{!10, !11, i64 44}
!26 = !{!10, !6, i64 472}
!27 = !{!10, !6, i64 8}
!28 = !{!29, !29, i64 0}
!29 = !{!"double", !7, i64 0}
!30 = !{!31, !31, i64 0}
!31 = !{!"vtable pointer", !8, i64 0}


; 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.R2Grid = type { %class.R2Affine, %class.R2Affine, double, ptr, [2 x i32], i32, i32 }
%class.R2Affine = type <{ %class.R2Transformation, %class.R3Matrix, i32, [4 x i8] }>
%class.R2Transformation = type { ptr }
%class.R3Matrix = type { [3 x [3 x double]] }

@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [10 x i8], align 1

; 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

; Function Attrs: nounwind
declare void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208)) unnamed_addr #1

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9RGBDImage16ReadDepthChannelEv(ptr noundef nonnull align 8 dereferenceable(488) %0) unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %class.R2Grid, align 8
  %3 = alloca [4096 x i8], align 16
  %4 = getelementptr inbounds i8, ptr %0, i64 484
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %7, label %9

7:                                                ; preds = %1
  %8 = add nuw nsw i32 %5, 1
  store i32 %8, ptr %4, align 4, !tbaa !5
  br label %84

9:                                                ; preds = %1
  call void @llvm.lifetime.start.p0(i64 208, ptr nonnull %2) #7
  %10 = getelementptr inbounds i8, ptr %0, i64 40
  %11 = load i32, ptr %10, align 8, !tbaa !23
  %12 = getelementptr inbounds i8, ptr %0, i64 44
  %13 = load i32, ptr %12, align 4, !tbaa !24
  call void @_ZN6R2GridC1Eii(ptr noundef nonnull align 8 dereferenceable(208) %2, i32 noundef %11, i32 noundef %13)
  %14 = getelementptr inbounds i8, ptr %0, i64 472
  %15 = load ptr, ptr %14, align 8, !tbaa !25
  %.not = icmp eq ptr %15, null
  br i1 %.not, label %75, label %16

16:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %3) #7
  %17 = getelementptr inbounds i8, ptr %0, i64 8
  %18 = load ptr, ptr %17, align 8, !tbaa !26
  %.not17 = icmp eq ptr %18, null
  br i1 %.not17, label %.thread, label %19

19:                                               ; preds = %16
  %20 = call noundef ptr @_ZNK17RGBDConfiguration14DepthDirectoryEv(ptr noundef nonnull align 8 dereferenceable(128) %18)
  %.not18 = icmp eq ptr %20, null
  %.pre = load ptr, ptr %14, align 8, !tbaa !25
  br i1 %.not18, label %.thread, label %21

21:                                               ; preds = %19
  %22 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %20, ptr noundef %.pre) #7
  br label %27

23:                                               ; preds = %.invoke, %34, %30, %27
  %24 = landingpad { ptr, i32 }
          cleanup
  br label %74

.thread:                                          ; preds = %16, %19
  %25 = phi ptr [ %15, %16 ], [ %.pre, %19 ]
  %26 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.5, ptr noundef %25) #7
  br label %27

27:                                               ; preds = %.thread, %21
  %28 = invoke noundef i32 @_ZN6R2Grid8ReadFileEPKc(ptr noundef nonnull align 8 dereferenceable(208) %2, ptr noundef nonnull %3)
          to label %29 unwind label %23

29:                                               ; preds = %27
  %.not19.not = icmp eq i32 %28, 0
  br i1 %.not19.not, label %.critedge, label %30

30:                                               ; preds = %29
  invoke void @_ZN6R2Grid10SubstituteEdd(ptr noundef nonnull align 8 dereferenceable(208) %2, double noundef 0.000000e+00, double noundef -3.210000e+02)
          to label %31 unwind label %23

31:                                               ; preds = %30
  %32 = load ptr, ptr %14, align 8, !tbaa !25
  %33 = call noundef ptr @strstr(ptr noundef nonnull dereferenceable(1) %32, ptr noundef nonnull dereferenceable(1) @.str.6) #8
  %.not20 = icmp eq ptr %33, null
  br i1 %.not20, label %35, label %34

34:                                               ; preds = %31
  invoke void @_ZN6R2Grid8MultiplyEd(ptr noundef nonnull align 8 dereferenceable(208) %2, double noundef 1.000000e-03)
          to label %35 unwind label %23

35:                                               ; preds = %34, %31
  %36 = load ptr, ptr %17, align 8, !tbaa !26
  %.not21 = icmp eq ptr %36, null
  br i1 %.not21, label %.thread35, label %37

37:                                               ; preds = %35
  %38 = call noundef ptr @_ZNK17RGBDConfiguration13DatasetFormatEv(ptr noundef nonnull align 8 dereferenceable(128) %36)
  %.not22 = icmp eq ptr %38, null
  br i1 %.not22, label %48, label %39

39:                                               ; preds = %37
  %40 = load ptr, ptr %17, align 8, !tbaa !26
  %41 = call noundef ptr @_ZNK17RGBDConfiguration13DatasetFormatEv(ptr noundef nonnull align 8 dereferenceable(128) %40)
  %42 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %41, ptr noundef nonnull dereferenceable(1) @.str.7) #8
  %.not23 = icmp eq i32 %42, 0
  br i1 %.not23, label %.invoke, label %43

43:                                               ; preds = %39
  %44 = load ptr, ptr %17, align 8, !tbaa !26
  %45 = call noundef ptr @_ZNK17RGBDConfiguration13DatasetFormatEv(ptr noundef nonnull align 8 dereferenceable(128) %44)
  %46 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %45, ptr noundef nonnull dereferenceable(1) @.str.8) #8
  %.not24 = icmp eq i32 %46, 0
  br i1 %.not24, label %.invoke, label %48

.invoke:                                          ; preds = %43, %39
  %47 = phi double [ 2.500000e-01, %39 ], [ 2.000000e-01, %43 ]
  invoke void @_ZN6R2Grid8MultiplyEd(ptr noundef nonnull align 8 dereferenceable(208) %2, double noundef %47)
          to label %48 unwind label %23

48:                                               ; preds = %.invoke, %43, %37
  %.pr = load ptr, ptr %17, align 8, !tbaa !26
  %.not25 = icmp eq ptr %.pr, null
  br i1 %.not25, label %.thread35, label %49

49:                                               ; preds = %48
  %50 = call noundef ptr @_ZNK17RGBDConfiguration13DatasetFormatEv(ptr noundef nonnull align 8 dereferenceable(128) %.pr)
  %.not26 = icmp eq ptr %50, null
  br i1 %.not26, label %.thread35, label %51

51:                                               ; preds = %49
  %52 = load ptr, ptr %17, align 8, !tbaa !26
  %53 = call noundef ptr @_ZNK17RGBDConfiguration13DatasetFormatEv(ptr noundef nonnull align 8 dereferenceable(128) %52)
  %54 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %53, ptr noundef nonnull dereferenceable(1) @.str.9) #8
  %.not27 = icmp eq i32 %54, 0
  br i1 %.not27, label %67, label %55

55:                                               ; preds = %51
  %56 = load ptr, ptr %17, align 8, !tbaa !26
  %57 = call noundef ptr @_ZNK17RGBDConfiguration13DatasetFormatEv(ptr noundef nonnull align 8 dereferenceable(128) %56)
  %58 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %57, ptr noundef nonnull dereferenceable(1) @.str.10) #8
  %.not28 = icmp eq i32 %58, 0
  br i1 %.not28, label %67, label %59

59:                                               ; preds = %55
  %60 = load ptr, ptr %17, align 8, !tbaa !26
  %61 = call noundef ptr @_ZNK17RGBDConfiguration13DatasetFormatEv(ptr noundef nonnull align 8 dereferenceable(128) %60)
  %62 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %61, ptr noundef nonnull dereferenceable(1) @.str.11) #8
  %.not29 = icmp eq i32 %62, 0
  br i1 %.not29, label %67, label %63

63:                                               ; preds = %59
  %64 = load ptr, ptr %17, align 8, !tbaa !26
  %65 = call noundef ptr @_ZNK17RGBDConfiguration13DatasetFormatEv(ptr noundef nonnull align 8 dereferenceable(128) %64)
  %66 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %65, ptr noundef nonnull dereferenceable(1) @.str.12) #8
  %.not30 = icmp eq i32 %66, 0
  br i1 %.not30, label %67, label %.thread35

67:                                               ; preds = %63, %59, %55, %51
  %68 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %2)
  %69 = mul nsw i32 %68, 3
  %70 = sitofp i32 %69 to double
  %71 = fdiv double %70, 6.400000e+02
  invoke void @_ZN6R2Grid15BilateralFilterEdd(ptr noundef nonnull align 8 dereferenceable(208) %2, double noundef %71, double noundef 5.000000e-02)
          to label %.thread35 unwind label %72

72:                                               ; preds = %67
  %73 = landingpad { ptr, i32 }
          cleanup
  br label %74

.thread35:                                        ; preds = %35, %48, %49, %63, %67
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %3) #7
  br label %75

74:                                               ; preds = %72, %23
  %.pn = phi { ptr, i32 } [ %73, %72 ], [ %24, %23 ]
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %3) #7
  br label %83

75:                                               ; preds = %.thread35, %9
  %76 = load ptr, ptr %0, align 8, !tbaa !27
  %77 = getelementptr inbounds i8, ptr %76, i64 272
  %78 = load ptr, ptr %77, align 8
  %79 = invoke noundef i32 %78(ptr noundef nonnull align 8 dereferenceable(488) %0, ptr noundef nonnull align 8 dereferenceable(208) %2)
          to label %82 unwind label %80

80:                                               ; preds = %75
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %83

.critedge:                                        ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %3) #7
  br label %82

82:                                               ; preds = %75, %.critedge
  %.1 = phi i32 [ 0, %.critedge ], [ %79, %75 ]
  call void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208) %2) #7
  call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %2) #7
  br label %84

83:                                               ; preds = %80, %74
  %.pn32 = phi { ptr, i32 } [ %81, %80 ], [ %.pn, %74 ]
  call void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208) %2) #7
  call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %2) #7
  resume { ptr, i32 } %.pn32

84:                                               ; preds = %82, %7
  %.2 = phi i32 [ 1, %7 ], [ %.1, %82 ]
  ret i32 %.2
}

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

declare noundef i32 @_ZN6R2Grid8ReadFileEPKc(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare noundef ptr @strstr(ptr noundef, ptr nocapture noundef) local_unnamed_addr #6

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #6

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { "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 = { nofree 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 = { 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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { nounwind willreturn memory(read) }

!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 484}
!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 = !{!6, !10, i64 40}
!24 = !{!6, !10, i64 44}
!25 = !{!6, !7, i64 472}
!26 = !{!6, !7, i64 8}
!27 = !{!28, !28, i64 0}
!28 = !{!"vtable pointer", !9, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass