; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Shapes/R3Grid.ll (ZN6R3Grid8ReadGridEP8_IO_FILE)

; 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.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.R3Grid = type { %class.R3Affine, %class.R3Affine, double, double, ptr, [3 x i32], i32, i32, i32 }

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [12 x i8], align 1
@stdin = external global ptr, align 8
@.str.48 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [45 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #0

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

declare void @_Z7RNAbortPKcz(ptr noundef, ...) #2

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

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

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

; Function Attrs: nounwind
declare void @_ZN8R3AffineD1Ev(ptr noundef nonnull align 8 dereferenceable(272)) unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK8R3Affine7InverseEv(ptr dead_on_unwind noalias writable sret(%class.R3Affine) align 8, ptr noundef nonnull align 8 dereferenceable(272)) #4 align 2

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

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

declare void @_Z6RNFailPKcz(ptr noundef, ...) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6R3Grid8ReadGridEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(592) %0, ptr noundef %1) #8 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [3 x i32], align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca float, align 4
  %15 = alloca %class.R3Affine, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %18 = load ptr, ptr %4, align 8
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %23, label %21

21:                                               ; preds = %2
  %22 = load ptr, ptr @stdin, align 8, !tbaa !5
  store ptr %22, ptr %5, align 8, !tbaa !5
  br label %23

23:                                               ; preds = %21, %2
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #9
  %24 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 0
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = call i64 @fread(ptr noundef %24, i64 noundef 4, i64 noundef 3, ptr noundef %25)
  %27 = icmp ne i64 %26, 3
  br i1 %27, label %28, label %29

28:                                               ; preds = %23
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.48)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %194

29:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  %30 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 0
  %31 = load i32, ptr %30, align 4, !tbaa !9
  %32 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 1
  %33 = load i32, ptr %32, align 4, !tbaa !9
  %34 = mul nsw i32 %31, %33
  %35 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 2
  %36 = load i32, ptr %35, align 4, !tbaa !9
  %37 = mul nsw i32 %34, %36
  store i32 %37, ptr %8, align 4, !tbaa !9
  %38 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 4
  %39 = load ptr, ptr %38, align 8, !tbaa !11
  %40 = icmp ne ptr %39, null
  br i1 %40, label %41, label %46

41:                                               ; preds = %29
  %42 = load i32, ptr %8, align 4, !tbaa !9
  %43 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 8
  %44 = load i32, ptr %43, align 4, !tbaa !19
  %45 = icmp sgt i32 %42, %44
  br i1 %45, label %46, label %70

46:                                               ; preds = %41, %29
  %47 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 4
  %48 = load ptr, ptr %47, align 8, !tbaa !11
  %49 = icmp ne ptr %48, null
  br i1 %49, label %50, label %56

50:                                               ; preds = %46
  %51 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 4
  %52 = load ptr, ptr %51, align 8, !tbaa !11
  %53 = icmp eq ptr %52, null
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  call void @_ZdaPv(ptr noundef %52) #10
  br label %55

55:                                               ; preds = %54, %50
  br label %56

56:                                               ; preds = %55, %46
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %58, i64 8)
  %60 = extractvalue { i64, i1 } %59, 1
  %61 = extractvalue { i64, i1 } %59, 0
  %62 = select i1 %60, i64 -1, i64 %61
  %63 = call noalias noundef nonnull ptr @_Znam(i64 noundef %62) #11
  %64 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 4
  store ptr %63, ptr %64, align 8, !tbaa !11
  %65 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 4
  %66 = load ptr, ptr %65, align 8, !tbaa !11
  %67 = icmp ne ptr %66, null
  br i1 %67, label %69, label %68

68:                                               ; preds = %56
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.10, i32 noundef 3068, ptr noundef @.str.2)
  br label %69

69:                                               ; preds = %68, %56
  br label %70

70:                                               ; preds = %69, %41
  %71 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 0
  %72 = load i32, ptr %71, align 4, !tbaa !9
  %73 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 5
  %74 = getelementptr inbounds [3 x i32], ptr %73, i64 0, i64 0
  store i32 %72, ptr %74, align 8, !tbaa !9
  %75 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 1
  %76 = load i32, ptr %75, align 4, !tbaa !9
  %77 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 5
  %78 = getelementptr inbounds [3 x i32], ptr %77, i64 0, i64 1
  store i32 %76, ptr %78, align 4, !tbaa !9
  %79 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 2
  %80 = load i32, ptr %79, align 4, !tbaa !9
  %81 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 5
  %82 = getelementptr inbounds [3 x i32], ptr %81, i64 0, i64 2
  store i32 %80, ptr %82, align 8, !tbaa !9
  %83 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 5
  %84 = getelementptr inbounds [3 x i32], ptr %83, i64 0, i64 0
  %85 = load i32, ptr %84, align 8, !tbaa !9
  %86 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 6
  store i32 %85, ptr %86, align 4, !tbaa !20
  %87 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 6
  %88 = load i32, ptr %87, align 4, !tbaa !20
  %89 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 5
  %90 = getelementptr inbounds [3 x i32], ptr %89, i64 0, i64 1
  %91 = load i32, ptr %90, align 4, !tbaa !9
  %92 = mul nsw i32 %88, %91
  %93 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 7
  store i32 %92, ptr %93, align 8, !tbaa !21
  %94 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 7
  %95 = load i32, ptr %94, align 8, !tbaa !21
  %96 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 5
  %97 = getelementptr inbounds [3 x i32], ptr %96, i64 0, i64 2
  %98 = load i32, ptr %97, align 8, !tbaa !9
  %99 = mul nsw i32 %95, %98
  %100 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 8
  store i32 %99, ptr %100, align 4, !tbaa !19
  %101 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 8
  %102 = load i32, ptr %101, align 4, !tbaa !19
  %103 = icmp sle i32 %102, 0
  br i1 %103, label %104, label %107

104:                                              ; preds = %70
  %105 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 8
  %106 = load i32, ptr %105, align 4, !tbaa !19
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.49, i32 noundef %106)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %193

107:                                              ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  %108 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 1
  %109 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNK8R3Affine6MatrixEv(ptr noundef nonnull align 8 dereferenceable(272) %108)
  %110 = call noundef ptr @_ZNK8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %109, i32 noundef 0)
  %111 = getelementptr inbounds double, ptr %110, i64 0
  store ptr %111, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %112

112:                                              ; preds = %130, %107
  %113 = load i32, ptr %10, align 4, !tbaa !9
  %114 = icmp slt i32 %113, 16
  br i1 %114, label %116, label %115

115:                                              ; preds = %112
  store i32 2, ptr %7, align 4
  br label %133

116:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = call i64 @fread(ptr noundef %11, i64 noundef 4, i64 noundef 1, ptr noundef %117)
  %119 = icmp ne i64 %118, 1
  br i1 %119, label %120, label %121

120:                                              ; preds = %116
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.50)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %127

121:                                              ; preds = %116
  %122 = load float, ptr %11, align 4, !tbaa !22
  %123 = fpext float %122 to double
  %124 = load ptr, ptr %9, align 8, !tbaa !5
  %125 = getelementptr inbounds double, ptr %124, i32 1
  store ptr %125, ptr %9, align 8, !tbaa !5
  store double %123, ptr %124, align 8, !tbaa !24
  br label %126

126:                                              ; preds = %121
  store i32 0, ptr %7, align 4
  br label %127

127:                                              ; preds = %126, %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  %128 = load i32, ptr %7, align 4
  switch i32 %128, label %133 [
    i32 0, label %129
  ]

129:                                              ; preds = %127
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %10, align 4, !tbaa !9
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %10, align 4, !tbaa !9
  br label %112, !llvm.loop !25

133:                                              ; preds = %127, %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  %134 = load i32, ptr %7, align 4
  switch i32 %134, label %192 [
    i32 2, label %135
  ]

135:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %136 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 4
  %137 = load ptr, ptr %136, align 8, !tbaa !11
  store ptr %137, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %138

138:                                              ; preds = %161, %135
  %139 = load i32, ptr %13, align 4, !tbaa !9
  %140 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 8
  %141 = load i32, ptr %140, align 4, !tbaa !19
  %142 = icmp slt i32 %139, %141
  br i1 %142, label %144, label %143

143:                                              ; preds = %138
  store i32 5, ptr %7, align 4
  br label %164

144:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  %145 = load ptr, ptr %5, align 8, !tbaa !5
  %146 = call i64 @fread(ptr noundef %14, i64 noundef 4, i64 noundef 1, ptr noundef %145)
  %147 = icmp ne i64 %146, 1
  br i1 %147, label %148, label %152

148:                                              ; preds = %144
  %149 = load i32, ptr %13, align 4, !tbaa !9
  %150 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 8
  %151 = load i32, ptr %150, align 4, !tbaa !19
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.51, i32 noundef %149, i32 noundef %151)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %158

152:                                              ; preds = %144
  %153 = load float, ptr %14, align 4, !tbaa !22
  %154 = fpext float %153 to double
  %155 = load ptr, ptr %12, align 8, !tbaa !5
  %156 = getelementptr inbounds double, ptr %155, i32 1
  store ptr %156, ptr %12, align 8, !tbaa !5
  store double %154, ptr %155, align 8, !tbaa !24
  br label %157

157:                                              ; preds = %152
  store i32 0, ptr %7, align 4
  br label %158

158:                                              ; preds = %157, %148
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  %159 = load i32, ptr %7, align 4
  switch i32 %159, label %164 [
    i32 0, label %160
  ]

160:                                              ; preds = %158
  br label %161

161:                                              ; preds = %160
  %162 = load i32, ptr %13, align 4, !tbaa !9
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %13, align 4, !tbaa !9
  br label %138, !llvm.loop !27

164:                                              ; preds = %158, %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  %165 = load i32, ptr %7, align 4
  switch i32 %165, label %191 [
    i32 5, label %166
  ]

166:                                              ; preds = %164
  %167 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 1
  %168 = call noundef double @_ZNK8R3Affine11ScaleFactorEv(ptr noundef nonnull align 8 dereferenceable(272) %167)
  %169 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 2
  store double %168, ptr %169, align 8, !tbaa !28
  %170 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 2
  %171 = load double, ptr %170, align 8, !tbaa !28
  %172 = fcmp une double %171, 0.000000e+00
  br i1 %172, label %173, label %177

173:                                              ; preds = %166
  %174 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 2
  %175 = load double, ptr %174, align 8, !tbaa !28
  %176 = fdiv double 1.000000e+00, %175
  br label %178

177:                                              ; preds = %166
  br label %178

178:                                              ; preds = %177, %173
  %179 = phi double [ %176, %173 ], [ 1.000000e+00, %177 ]
  %180 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 3
  store double %179, ptr %180, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 272, ptr %15) #9
  %181 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 1
  call void @_ZNK8R3Affine7InverseEv(ptr dead_on_unwind writable sret(%class.R3Affine) align 8 %15, ptr noundef nonnull align 8 dereferenceable(272) %181)
  %182 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 0
  %183 = invoke noundef nonnull align 8 dereferenceable(272) ptr @_ZN8R3AffineaSERKS_(ptr noundef nonnull align 8 dereferenceable(272) %182, ptr noundef nonnull align 8 dereferenceable(272) %15)
          to label %184 unwind label %187

184:                                              ; preds = %178
  call void @_ZN8R3AffineD1Ev(ptr noundef nonnull align 8 dereferenceable(272) %15) #9
  call void @llvm.lifetime.end.p0(i64 272, ptr %15) #9
  %185 = getelementptr inbounds %class.R3Grid, ptr %18, i32 0, i32 8
  %186 = load i32, ptr %185, align 4, !tbaa !19
  store i32 %186, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %191

187:                                              ; preds = %178
  %188 = landingpad { ptr, i32 }
          cleanup
  %189 = extractvalue { ptr, i32 } %188, 0
  store ptr %189, ptr %16, align 8
  %190 = extractvalue { ptr, i32 } %188, 1
  store i32 %190, ptr %17, align 4
  call void @_ZN8R3AffineD1Ev(ptr noundef nonnull align 8 dereferenceable(272) %15) #9
  call void @llvm.lifetime.end.p0(i64 272, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #9
  br label %196

191:                                              ; preds = %184, %164
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  br label %192

192:                                              ; preds = %191, %133
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  br label %193

193:                                              ; preds = %192, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  br label %194

194:                                              ; preds = %193, %28
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #9
  %195 = load i32, ptr %3, align 4
  ret i32 %195

196:                                              ; preds = %187
  %197 = load ptr, ptr %16, align 8
  %198 = load i32, ptr %17, align 4
  %199 = insertvalue { ptr, i32 } poison, ptr %197, 0
  %200 = insertvalue { ptr, i32 } %199, i32 %198, 1
  resume { ptr, i32 } %200
}

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

declare noundef double @_ZNK8R3Affine11ScaleFactorEv(ptr noundef nonnull align 8 dereferenceable(272)) unnamed_addr #2

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind "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 = { 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 #7 = { 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 #8 = { 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 #9 = { nounwind }
attributes #10 = { builtin nounwind }
attributes #11 = { builtin allocsize(0) }

!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, !6, i64 560}
!12 = !{!"_ZTS6R3Grid", !13, i64 0, !13, i64 272, !18, i64 544, !18, i64 552, !6, i64 560, !7, i64 568, !10, i64 580, !10, i64 584, !10, i64 588}
!13 = !{!"_ZTS8R3Affine", !14, i64 0, !15, i64 8, !15, i64 136, !16, i64 264}
!14 = !{!"_ZTS16R3Transformation"}
!15 = !{!"_ZTS8R4Matrix", !7, i64 0}
!16 = !{!"_ZTS7RNFlags", !17, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = !{!12, !10, i64 588}
!20 = !{!12, !10, i64 580}
!21 = !{!12, !10, i64 584}
!22 = !{!23, !23, i64 0}
!23 = !{!"float", !7, i64 0}
!24 = !{!18, !18, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}
!28 = !{!12, !18, i64 544}
!29 = !{!12, !18, i64 552}


; 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.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 }

@stdin = external local_unnamed_addr global ptr, align 8
@.str.48 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [45 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(272) ptr @_ZN8R3AffineaSERKS_(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef nonnull align 8 dereferenceable(272)) local_unnamed_addr #2 align 2

; Function Attrs: nounwind
declare void @_ZN8R3AffineD1Ev(ptr noundef nonnull align 8 dereferenceable(272)) unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK8R3Affine7InverseEv(ptr dead_on_unwind noalias writable sret(%class.R3Affine) align 8, ptr noundef nonnull align 8 dereferenceable(272)) local_unnamed_addr #2 align 2

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

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

declare void @_Z6RNFailPKcz(ptr noundef, ...) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6R3Grid8ReadGridEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(592) %0, ptr noundef %1) local_unnamed_addr #7 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca [3 x i32], align 4
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca %class.R3Affine, align 8
  %.not = icmp eq ptr %1, null
  %7 = load ptr, ptr @stdin, align 8
  %spec.select = select i1 %.not, ptr %7, ptr %1
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #9
  %8 = call i64 @fread(ptr noundef nonnull %3, i64 noundef 4, i64 noundef 3, ptr noundef %spec.select)
  %.not38 = icmp eq i64 %8, 3
  br i1 %.not38, label %10, label %9

9:                                                ; preds = %2
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.48)
  br label %145

10:                                               ; preds = %2
  %11 = load i32, ptr %3, align 4, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %3, i64 4
  %13 = load <2 x i32>, ptr %12, align 4, !tbaa !5
  %14 = extractelement <2 x i32> %13, i64 0
  %15 = mul nsw i32 %14, %11
  %16 = extractelement <2 x i32> %13, i64 1
  %17 = mul nsw i32 %15, %16
  %18 = getelementptr inbounds i8, ptr %0, i64 560
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %.not39 = icmp eq ptr %19, null
  %20 = getelementptr inbounds i8, ptr %0, i64 588
  %21 = load i32, ptr %20, align 4
  %22 = icmp sgt i32 %17, %21
  %or.cond = select i1 %.not39, i1 true, i1 %22
  br i1 %or.cond, label %23, label %31

23:                                               ; preds = %10
  br i1 %.not39, label %25, label %24

24:                                               ; preds = %23
  tail call void @_ZdaPv(ptr noundef nonnull %19) #10
  br label %25

25:                                               ; preds = %24, %23
  %26 = sext i32 %17 to i64
  %27 = icmp slt i32 %17, 0
  %28 = shl nsw i64 %26, 3
  %29 = select i1 %27, i64 -1, i64 %28
  %30 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %29) #11
  store ptr %30, ptr %18, align 8, !tbaa !9
  br label %31

31:                                               ; preds = %10, %25
  %32 = getelementptr inbounds i8, ptr %0, i64 568
  %33 = insertelement <4 x i32> poison, i32 %11, i64 0
  %34 = shufflevector <2 x i32> %13, <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
  %35 = shufflevector <4 x i32> %33, <4 x i32> %34, <4 x i32> <i32 0, i32 4, i32 5, i32 poison>
  %36 = shufflevector <4 x i32> %35, <4 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 0>
  store <4 x i32> %36, ptr %32, align 8, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %0, i64 584
  store i32 %15, ptr %37, align 8, !tbaa !18
  store i32 %17, ptr %20, align 4, !tbaa !19
  %38 = icmp slt i32 %17, 1
  br i1 %38, label %39, label %40

39:                                               ; preds = %31
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.49, i32 noundef %17)
  br label %145

40:                                               ; preds = %31
  %41 = getelementptr inbounds i8, ptr %0, i64 272
  %42 = tail call noundef nonnull align 8 dereferenceable(128) ptr @_ZNK8R3Affine6MatrixEv(ptr noundef nonnull align 8 dereferenceable(272) %41)
  %43 = tail call noundef ptr @_ZNK8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %42, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %44 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef %spec.select)
  %.not41 = icmp eq i64 %44, 1
  br i1 %.not41, label %45, label %123

45:                                               ; preds = %40
  %46 = load float, ptr %4, align 4, !tbaa !20
  %47 = fpext float %46 to double
  store double %47, ptr %43, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %48 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef %spec.select)
  %.not41.1 = icmp eq i64 %48, 1
  br i1 %.not41.1, label %49, label %123

49:                                               ; preds = %45
  %50 = getelementptr inbounds i8, ptr %43, i64 8
  %51 = load float, ptr %4, align 4, !tbaa !20
  %52 = fpext float %51 to double
  store double %52, ptr %50, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %53 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef %spec.select)
  %.not41.2 = icmp eq i64 %53, 1
  br i1 %.not41.2, label %54, label %123

54:                                               ; preds = %49
  %55 = getelementptr inbounds i8, ptr %43, i64 16
  %56 = load float, ptr %4, align 4, !tbaa !20
  %57 = fpext float %56 to double
  store double %57, ptr %55, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %58 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef %spec.select)
  %.not41.3 = icmp eq i64 %58, 1
  br i1 %.not41.3, label %59, label %123

59:                                               ; preds = %54
  %60 = getelementptr inbounds i8, ptr %43, i64 24
  %61 = load float, ptr %4, align 4, !tbaa !20
  %62 = fpext float %61 to double
  store double %62, ptr %60, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %63 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef %spec.select)
  %.not41.4 = icmp eq i64 %63, 1
  br i1 %.not41.4, label %64, label %123

64:                                               ; preds = %59
  %65 = getelementptr inbounds i8, ptr %43, i64 32
  %66 = load float, ptr %4, align 4, !tbaa !20
  %67 = fpext float %66 to double
  store double %67, ptr %65, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %68 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef %spec.select)
  %.not41.5 = icmp eq i64 %68, 1
  br i1 %.not41.5, label %69, label %123

69:                                               ; preds = %64
  %70 = getelementptr inbounds i8, ptr %43, i64 40
  %71 = load float, ptr %4, align 4, !tbaa !20
  %72 = fpext float %71 to double
  store double %72, ptr %70, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %73 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef %spec.select)
  %.not41.6 = icmp eq i64 %73, 1
  br i1 %.not41.6, label %74, label %123

74:                                               ; preds = %69
  %75 = getelementptr inbounds i8, ptr %43, i64 48
  %76 = load float, ptr %4, align 4, !tbaa !20
  %77 = fpext float %76 to double
  store double %77, ptr %75, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %78 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef %spec.select)
  %.not41.7 = icmp eq i64 %78, 1
  br i1 %.not41.7, label %79, label %123

79:                                               ; preds = %74
  %80 = getelementptr inbounds i8, ptr %43, i64 56
  %81 = load float, ptr %4, align 4, !tbaa !20
  %82 = fpext float %81 to double
  store double %82, ptr %80, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %83 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef %spec.select)
  %.not41.8 = icmp eq i64 %83, 1
  br i1 %.not41.8, label %84, label %123

84:                                               ; preds = %79
  %85 = getelementptr inbounds i8, ptr %43, i64 64
  %86 = load float, ptr %4, align 4, !tbaa !20
  %87 = fpext float %86 to double
  store double %87, ptr %85, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %88 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef %spec.select)
  %.not41.9 = icmp eq i64 %88, 1
  br i1 %.not41.9, label %89, label %123

89:                                               ; preds = %84
  %90 = getelementptr inbounds i8, ptr %43, i64 72
  %91 = load float, ptr %4, align 4, !tbaa !20
  %92 = fpext float %91 to double
  store double %92, ptr %90, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %93 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef %spec.select)
  %.not41.10 = icmp eq i64 %93, 1
  br i1 %.not41.10, label %94, label %123

94:                                               ; preds = %89
  %95 = getelementptr inbounds i8, ptr %43, i64 80
  %96 = load float, ptr %4, align 4, !tbaa !20
  %97 = fpext float %96 to double
  store double %97, ptr %95, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %98 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef %spec.select)
  %.not41.11 = icmp eq i64 %98, 1
  br i1 %.not41.11, label %99, label %123

99:                                               ; preds = %94
  %100 = getelementptr inbounds i8, ptr %43, i64 88
  %101 = load float, ptr %4, align 4, !tbaa !20
  %102 = fpext float %101 to double
  store double %102, ptr %100, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %103 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef %spec.select)
  %.not41.12 = icmp eq i64 %103, 1
  br i1 %.not41.12, label %104, label %123

104:                                              ; preds = %99
  %105 = getelementptr inbounds i8, ptr %43, i64 96
  %106 = load float, ptr %4, align 4, !tbaa !20
  %107 = fpext float %106 to double
  store double %107, ptr %105, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %108 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef %spec.select)
  %.not41.13 = icmp eq i64 %108, 1
  br i1 %.not41.13, label %109, label %123

109:                                              ; preds = %104
  %110 = getelementptr inbounds i8, ptr %43, i64 104
  %111 = load float, ptr %4, align 4, !tbaa !20
  %112 = fpext float %111 to double
  store double %112, ptr %110, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %113 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef %spec.select)
  %.not41.14 = icmp eq i64 %113, 1
  br i1 %.not41.14, label %114, label %123

114:                                              ; preds = %109
  %115 = getelementptr inbounds i8, ptr %43, i64 112
  %116 = load float, ptr %4, align 4, !tbaa !20
  %117 = fpext float %116 to double
  store double %117, ptr %115, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %118 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef %spec.select)
  %.not41.15 = icmp eq i64 %118, 1
  br i1 %.not41.15, label %.critedge, label %123

.critedge:                                        ; preds = %114
  %119 = getelementptr inbounds i8, ptr %43, i64 120
  %120 = load float, ptr %4, align 4, !tbaa !20
  %121 = fpext float %120 to double
  store double %121, ptr %119, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  %122 = load i32, ptr %20, align 4, !tbaa !19
  %.not4356 = icmp sgt i32 %122, 0
  br i1 %.not4356, label %.lr.ph.preheader, label %.critedge47

123:                                              ; preds = %114, %109, %104, %99, %94, %89, %84, %79, %74, %69, %64, %59, %54, %49, %45, %40
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.50)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  br label %145

.lr.ph.preheader:                                 ; preds = %.critedge
  %124 = load ptr, ptr %18, align 8, !tbaa !9
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %126
  %.02458 = phi i32 [ %130, %126 ], [ 0, %.lr.ph.preheader ]
  %.02557 = phi ptr [ %129, %126 ], [ %124, %.lr.ph.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  %125 = call i64 @fread(ptr noundef nonnull %5, i64 noundef 4, i64 noundef 1, ptr noundef %spec.select)
  %.not42 = icmp eq i64 %125, 1
  br i1 %.not42, label %126, label %132

126:                                              ; preds = %.lr.ph
  %127 = load float, ptr %5, align 4, !tbaa !20
  %128 = fpext float %127 to double
  %129 = getelementptr inbounds i8, ptr %.02557, i64 8
  store double %128, ptr %.02557, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  %130 = add nuw nsw i32 %.02458, 1
  %131 = load i32, ptr %20, align 4, !tbaa !19
  %.not43 = icmp slt i32 %130, %131
  br i1 %.not43, label %.lr.ph, label %.critedge47, !llvm.loop !23

132:                                              ; preds = %.lr.ph
  %133 = load i32, ptr %20, align 4, !tbaa !19
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.51, i32 noundef %.02458, i32 noundef %133)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  br label %145

.critedge47:                                      ; preds = %126, %.critedge
  %134 = tail call noundef double @_ZNK8R3Affine11ScaleFactorEv(ptr noundef nonnull align 8 dereferenceable(272) %41)
  %135 = getelementptr inbounds i8, ptr %0, i64 544
  store double %134, ptr %135, align 8, !tbaa !25
  %136 = fcmp une double %134, 0.000000e+00
  %137 = fdiv double 1.000000e+00, %134
  %138 = select i1 %136, double %137, double 1.000000e+00
  %139 = getelementptr inbounds i8, ptr %0, i64 552
  store double %138, ptr %139, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 272, ptr nonnull %6) #9
  call void @_ZNK8R3Affine7InverseEv(ptr dead_on_unwind nonnull writable sret(%class.R3Affine) align 8 %6, ptr noundef nonnull align 8 dereferenceable(272) %41)
  %140 = invoke noundef nonnull align 8 dereferenceable(272) ptr @_ZN8R3AffineaSERKS_(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull align 8 dereferenceable(272) %6)
          to label %141 unwind label %143

141:                                              ; preds = %.critedge47
  call void @_ZN8R3AffineD1Ev(ptr noundef nonnull align 8 dereferenceable(272) %6) #9
  call void @llvm.lifetime.end.p0(i64 272, ptr nonnull %6) #9
  %142 = load i32, ptr %20, align 4, !tbaa !19
  br label %145

143:                                              ; preds = %.critedge47
  %144 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN8R3AffineD1Ev(ptr noundef nonnull align 8 dereferenceable(272) %6) #9
  call void @llvm.lifetime.end.p0(i64 272, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #9
  resume { ptr, i32 } %144

145:                                              ; preds = %132, %123, %39, %141, %9
  %.9 = phi i32 [ 0, %9 ], [ 0, %39 ], [ 0, %123 ], [ %142, %141 ], [ 0, %132 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #9
  ret i32 %.9
}

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #8

declare noundef double @_ZNK8R3Affine11ScaleFactorEv(ptr noundef nonnull align 8 dereferenceable(272)) unnamed_addr #6

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

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !17, i64 560}
!10 = !{!"_ZTS6R3Grid", !11, i64 0, !11, i64 272, !16, i64 544, !16, i64 552, !17, i64 560, !7, i64 568, !6, i64 580, !6, i64 584, !6, i64 588}
!11 = !{!"_ZTS8R3Affine", !12, i64 0, !13, i64 8, !13, i64 136, !14, i64 264}
!12 = !{!"_ZTS16R3Transformation"}
!13 = !{!"_ZTS8R4Matrix", !7, i64 0}
!14 = !{!"_ZTS7RNFlags", !15, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!10, !6, i64 584}
!19 = !{!10, !6, i64 588}
!20 = !{!21, !21, i64 0}
!21 = !{!"float", !7, i64 0}
!22 = !{!16, !16, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!10, !16, i64 544}
!26 = !{!10, !16, i64 552}


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