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

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

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

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [88 x i8], align 1
@stderr = external global ptr, align 8
@.str.10 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.100 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.101 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.102 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.103 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.104 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.105 = external hidden unnamed_addr constant [38 x i8], align 1

; 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: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #4

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592), i32 noundef, i32 noundef, i32 noundef, double noundef) #6 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6R3Grid12ReadCCP4FileEPKc(ptr noundef nonnull align 8 dereferenceable(592) %0, ptr noundef %1) #7 align 2 {
  %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
  %8 = alloca %struct.R3GridCCP4Header, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca float, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = call noalias ptr @fopen(ptr noundef %18, ptr noundef @.str.45)
  store ptr %19, ptr %6, align 8, !tbaa !5
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %24, label %22

22:                                               ; preds = %2
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.100, ptr noundef %23)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %327

24:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1024, ptr %8) #8
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = call i64 @fread(ptr noundef %8, i64 noundef 1024, i64 noundef 1, ptr noundef %25)
  %27 = icmp ne i64 %26, 1
  br i1 %27, label %28, label %32

28:                                               ; preds = %24
  %29 = load ptr, ptr @stderr, align 8, !tbaa !5
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef @.str.101, ptr noundef %30) #8
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %326

32:                                               ; preds = %24
  %33 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 0
  %34 = load i32, ptr %33, align 4, !tbaa !9
  %35 = icmp sle i32 %34, 0
  br i1 %35, label %44, label %36

36:                                               ; preds = %32
  %37 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 1
  %38 = load i32, ptr %37, align 4, !tbaa !13
  %39 = icmp sle i32 %38, 0
  br i1 %39, label %44, label %40

40:                                               ; preds = %36
  %41 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 2
  %42 = load i32, ptr %41, align 4, !tbaa !14
  %43 = icmp sle i32 %42, 0
  br i1 %43, label %44, label %54

44:                                               ; preds = %40, %36, %32
  %45 = load ptr, ptr @stderr, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 0
  %47 = load i32, ptr %46, align 4, !tbaa !9
  %48 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 1
  %49 = load i32, ptr %48, align 4, !tbaa !13
  %50 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 2
  %51 = load i32, ptr %50, align 4, !tbaa !14
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef @.str.102, i32 noundef %47, i32 noundef %49, i32 noundef %51, ptr noundef %52) #8
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %326

54:                                               ; preds = %40
  %55 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 3
  %56 = load i32, ptr %55, align 4, !tbaa !15
  %57 = icmp ne i32 %56, 2
  br i1 %57, label %58, label %64

58:                                               ; preds = %54
  %59 = load ptr, ptr @stderr, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 3
  %61 = load i32, ptr %60, align 4, !tbaa !15
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef @.str.103, i32 noundef %61, ptr noundef %62) #8
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %326

64:                                               ; preds = %54
  %65 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 23
  %66 = load i32, ptr %65, align 4, !tbaa !16
  %67 = icmp slt i32 %66, 0
  br i1 %67, label %68, label %74

68:                                               ; preds = %64
  %69 = load ptr, ptr @stderr, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 23
  %71 = load i32, ptr %70, align 4, !tbaa !16
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %69, ptr noundef @.str.104, i32 noundef %71, ptr noundef %72) #8
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %326

74:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  %75 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 0
  %76 = load i32, ptr %75, align 4, !tbaa !9
  %77 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 1
  %78 = load i32, ptr %77, align 4, !tbaa !13
  %79 = mul nsw i32 %76, %78
  %80 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 2
  %81 = load i32, ptr %80, align 4, !tbaa !14
  %82 = mul nsw i32 %79, %81
  store i32 %82, ptr %9, align 4, !tbaa !17
  %83 = getelementptr inbounds %class.R3Grid, ptr %17, i32 0, i32 4
  %84 = load ptr, ptr %83, align 8, !tbaa !18
  %85 = icmp ne ptr %84, null
  br i1 %85, label %86, label %91

86:                                               ; preds = %74
  %87 = load i32, ptr %9, align 4, !tbaa !17
  %88 = getelementptr inbounds %class.R3Grid, ptr %17, i32 0, i32 8
  %89 = load i32, ptr %88, align 4, !tbaa !26
  %90 = icmp sgt i32 %87, %89
  br i1 %90, label %91, label %115

91:                                               ; preds = %86, %74
  %92 = getelementptr inbounds %class.R3Grid, ptr %17, i32 0, i32 4
  %93 = load ptr, ptr %92, align 8, !tbaa !18
  %94 = icmp ne ptr %93, null
  br i1 %94, label %95, label %101

95:                                               ; preds = %91
  %96 = getelementptr inbounds %class.R3Grid, ptr %17, i32 0, i32 4
  %97 = load ptr, ptr %96, align 8, !tbaa !18
  %98 = icmp eq ptr %97, null
  br i1 %98, label %100, label %99

99:                                               ; preds = %95
  call void @_ZdaPv(ptr noundef %97) #9
  br label %100

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

101:                                              ; preds = %100, %91
  %102 = load i32, ptr %9, align 4, !tbaa !17
  %103 = sext i32 %102 to i64
  %104 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %103, i64 8)
  %105 = extractvalue { i64, i1 } %104, 1
  %106 = extractvalue { i64, i1 } %104, 0
  %107 = select i1 %105, i64 -1, i64 %106
  %108 = call noalias noundef nonnull ptr @_Znam(i64 noundef %107) #10
  %109 = getelementptr inbounds %class.R3Grid, ptr %17, i32 0, i32 4
  store ptr %108, ptr %109, align 8, !tbaa !18
  %110 = getelementptr inbounds %class.R3Grid, ptr %17, i32 0, i32 4
  %111 = load ptr, ptr %110, align 8, !tbaa !18
  %112 = icmp ne ptr %111, null
  br i1 %112, label %114, label %113

113:                                              ; preds = %101
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.10, i32 noundef 3869, ptr noundef @.str.2)
  br label %114

114:                                              ; preds = %113, %101
  br label %115

115:                                              ; preds = %114, %86
  %116 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 16
  %117 = load i32, ptr %116, align 4, !tbaa !27
  %118 = icmp eq i32 %117, 1
  br i1 %118, label %119, label %122

119:                                              ; preds = %115
  %120 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 0
  %121 = load i32, ptr %120, align 4, !tbaa !9
  br label %134

122:                                              ; preds = %115
  %123 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 17
  %124 = load i32, ptr %123, align 4, !tbaa !28
  %125 = icmp eq i32 %124, 1
  br i1 %125, label %126, label %129

126:                                              ; preds = %122
  %127 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 1
  %128 = load i32, ptr %127, align 4, !tbaa !13
  br label %132

129:                                              ; preds = %122
  %130 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 2
  %131 = load i32, ptr %130, align 4, !tbaa !14
  br label %132

132:                                              ; preds = %129, %126
  %133 = phi i32 [ %128, %126 ], [ %131, %129 ]
  br label %134

134:                                              ; preds = %132, %119
  %135 = phi i32 [ %121, %119 ], [ %133, %132 ]
  %136 = getelementptr inbounds %class.R3Grid, ptr %17, i32 0, i32 5
  %137 = getelementptr inbounds [3 x i32], ptr %136, i64 0, i64 0
  store i32 %135, ptr %137, align 8, !tbaa !17
  %138 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 16
  %139 = load i32, ptr %138, align 4, !tbaa !27
  %140 = icmp eq i32 %139, 2
  br i1 %140, label %141, label %144

141:                                              ; preds = %134
  %142 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 0
  %143 = load i32, ptr %142, align 4, !tbaa !9
  br label %156

144:                                              ; preds = %134
  %145 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 17
  %146 = load i32, ptr %145, align 4, !tbaa !28
  %147 = icmp eq i32 %146, 2
  br i1 %147, label %148, label %151

148:                                              ; preds = %144
  %149 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 1
  %150 = load i32, ptr %149, align 4, !tbaa !13
  br label %154

151:                                              ; preds = %144
  %152 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 2
  %153 = load i32, ptr %152, align 4, !tbaa !14
  br label %154

154:                                              ; preds = %151, %148
  %155 = phi i32 [ %150, %148 ], [ %153, %151 ]
  br label %156

156:                                              ; preds = %154, %141
  %157 = phi i32 [ %143, %141 ], [ %155, %154 ]
  %158 = getelementptr inbounds %class.R3Grid, ptr %17, i32 0, i32 5
  %159 = getelementptr inbounds [3 x i32], ptr %158, i64 0, i64 1
  store i32 %157, ptr %159, align 4, !tbaa !17
  %160 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 16
  %161 = load i32, ptr %160, align 4, !tbaa !27
  %162 = icmp eq i32 %161, 3
  br i1 %162, label %163, label %166

163:                                              ; preds = %156
  %164 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 0
  %165 = load i32, ptr %164, align 4, !tbaa !9
  br label %178

166:                                              ; preds = %156
  %167 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 17
  %168 = load i32, ptr %167, align 4, !tbaa !28
  %169 = icmp eq i32 %168, 3
  br i1 %169, label %170, label %173

170:                                              ; preds = %166
  %171 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 1
  %172 = load i32, ptr %171, align 4, !tbaa !13
  br label %176

173:                                              ; preds = %166
  %174 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 2
  %175 = load i32, ptr %174, align 4, !tbaa !14
  br label %176

176:                                              ; preds = %173, %170
  %177 = phi i32 [ %172, %170 ], [ %175, %173 ]
  br label %178

178:                                              ; preds = %176, %163
  %179 = phi i32 [ %165, %163 ], [ %177, %176 ]
  %180 = getelementptr inbounds %class.R3Grid, ptr %17, i32 0, i32 5
  %181 = getelementptr inbounds [3 x i32], ptr %180, i64 0, i64 2
  store i32 %179, ptr %181, align 8, !tbaa !17
  %182 = getelementptr inbounds %class.R3Grid, ptr %17, i32 0, i32 5
  %183 = getelementptr inbounds [3 x i32], ptr %182, i64 0, i64 0
  %184 = load i32, ptr %183, align 8, !tbaa !17
  %185 = getelementptr inbounds %class.R3Grid, ptr %17, i32 0, i32 6
  store i32 %184, ptr %185, align 4, !tbaa !29
  %186 = getelementptr inbounds %class.R3Grid, ptr %17, i32 0, i32 6
  %187 = load i32, ptr %186, align 4, !tbaa !29
  %188 = getelementptr inbounds %class.R3Grid, ptr %17, i32 0, i32 5
  %189 = getelementptr inbounds [3 x i32], ptr %188, i64 0, i64 1
  %190 = load i32, ptr %189, align 4, !tbaa !17
  %191 = mul nsw i32 %187, %190
  %192 = getelementptr inbounds %class.R3Grid, ptr %17, i32 0, i32 7
  store i32 %191, ptr %192, align 8, !tbaa !30
  %193 = getelementptr inbounds %class.R3Grid, ptr %17, i32 0, i32 7
  %194 = load i32, ptr %193, align 8, !tbaa !30
  %195 = getelementptr inbounds %class.R3Grid, ptr %17, i32 0, i32 5
  %196 = getelementptr inbounds [3 x i32], ptr %195, i64 0, i64 2
  %197 = load i32, ptr %196, align 8, !tbaa !17
  %198 = mul nsw i32 %194, %197
  %199 = getelementptr inbounds %class.R3Grid, ptr %17, i32 0, i32 8
  store i32 %198, ptr %199, align 4, !tbaa !26
  %200 = getelementptr inbounds %class.R3Grid, ptr %17, i32 0, i32 8
  %201 = load i32, ptr %200, align 4, !tbaa !26
  %202 = icmp sle i32 %201, 0
  br i1 %202, label %203, label %206

203:                                              ; preds = %178
  %204 = getelementptr inbounds %class.R3Grid, ptr %17, i32 0, i32 8
  %205 = load i32, ptr %204, align 4, !tbaa !26
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.49, i32 noundef %205)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %325

206:                                              ; preds = %178
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !17
  br label %207

207:                                              ; preds = %316, %206
  %208 = load i32, ptr %13, align 4, !tbaa !17
  %209 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 2
  %210 = load i32, ptr %209, align 4, !tbaa !14
  %211 = icmp slt i32 %208, %210
  br i1 %211, label %213, label %212

212:                                              ; preds = %207
  store i32 2, ptr %7, align 4
  br label %319

213:                                              ; preds = %207
  %214 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 18
  %215 = load i32, ptr %214, align 4, !tbaa !31
  %216 = icmp eq i32 %215, 1
  br i1 %216, label %217, label %219

217:                                              ; preds = %213
  %218 = load i32, ptr %13, align 4, !tbaa !17
  store i32 %218, ptr %10, align 4, !tbaa !17
  br label %233

219:                                              ; preds = %213
  %220 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 18
  %221 = load i32, ptr %220, align 4, !tbaa !31
  %222 = icmp eq i32 %221, 2
  br i1 %222, label %223, label %225

223:                                              ; preds = %219
  %224 = load i32, ptr %13, align 4, !tbaa !17
  store i32 %224, ptr %11, align 4, !tbaa !17
  br label %232

225:                                              ; preds = %219
  %226 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 18
  %227 = load i32, ptr %226, align 4, !tbaa !31
  %228 = icmp eq i32 %227, 3
  br i1 %228, label %229, label %231

229:                                              ; preds = %225
  %230 = load i32, ptr %13, align 4, !tbaa !17
  store i32 %230, ptr %12, align 4, !tbaa !17
  br label %231

231:                                              ; preds = %229, %225
  br label %232

232:                                              ; preds = %231, %223
  br label %233

233:                                              ; preds = %232, %217
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !17
  br label %234

234:                                              ; preds = %310, %233
  %235 = load i32, ptr %14, align 4, !tbaa !17
  %236 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 1
  %237 = load i32, ptr %236, align 4, !tbaa !13
  %238 = icmp slt i32 %235, %237
  br i1 %238, label %240, label %239

239:                                              ; preds = %234
  store i32 5, ptr %7, align 4
  br label %313

240:                                              ; preds = %234
  %241 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 17
  %242 = load i32, ptr %241, align 4, !tbaa !28
  %243 = icmp eq i32 %242, 1
  br i1 %243, label %244, label %246

244:                                              ; preds = %240
  %245 = load i32, ptr %14, align 4, !tbaa !17
  store i32 %245, ptr %10, align 4, !tbaa !17
  br label %260

246:                                              ; preds = %240
  %247 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 17
  %248 = load i32, ptr %247, align 4, !tbaa !28
  %249 = icmp eq i32 %248, 2
  br i1 %249, label %250, label %252

250:                                              ; preds = %246
  %251 = load i32, ptr %14, align 4, !tbaa !17
  store i32 %251, ptr %11, align 4, !tbaa !17
  br label %259

252:                                              ; preds = %246
  %253 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 17
  %254 = load i32, ptr %253, align 4, !tbaa !28
  %255 = icmp eq i32 %254, 3
  br i1 %255, label %256, label %258

256:                                              ; preds = %252
  %257 = load i32, ptr %14, align 4, !tbaa !17
  store i32 %257, ptr %12, align 4, !tbaa !17
  br label %258

258:                                              ; preds = %256, %252
  br label %259

259:                                              ; preds = %258, %250
  br label %260

260:                                              ; preds = %259, %244
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !17
  br label %261

261:                                              ; preds = %304, %260
  %262 = load i32, ptr %15, align 4, !tbaa !17
  %263 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 0
  %264 = load i32, ptr %263, align 4, !tbaa !9
  %265 = icmp slt i32 %262, %264
  br i1 %265, label %267, label %266

266:                                              ; preds = %261
  store i32 8, ptr %7, align 4
  br label %307

267:                                              ; preds = %261
  %268 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 16
  %269 = load i32, ptr %268, align 4, !tbaa !27
  %270 = icmp eq i32 %269, 1
  br i1 %270, label %271, label %273

271:                                              ; preds = %267
  %272 = load i32, ptr %15, align 4, !tbaa !17
  store i32 %272, ptr %10, align 4, !tbaa !17
  br label %287

273:                                              ; preds = %267
  %274 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 16
  %275 = load i32, ptr %274, align 4, !tbaa !27
  %276 = icmp eq i32 %275, 2
  br i1 %276, label %277, label %279

277:                                              ; preds = %273
  %278 = load i32, ptr %15, align 4, !tbaa !17
  store i32 %278, ptr %11, align 4, !tbaa !17
  br label %286

279:                                              ; preds = %273
  %280 = getelementptr inbounds %struct.R3GridCCP4Header, ptr %8, i32 0, i32 16
  %281 = load i32, ptr %280, align 4, !tbaa !27
  %282 = icmp eq i32 %281, 3
  br i1 %282, label %283, label %285

283:                                              ; preds = %279
  %284 = load i32, ptr %15, align 4, !tbaa !17
  store i32 %284, ptr %12, align 4, !tbaa !17
  br label %285

285:                                              ; preds = %283, %279
  br label %286

286:                                              ; preds = %285, %277
  br label %287

287:                                              ; preds = %286, %271
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %288 = load ptr, ptr %6, align 8, !tbaa !5
  %289 = call i64 @fread(ptr noundef %16, i64 noundef 4, i64 noundef 1, ptr noundef %288)
  %290 = icmp ne i64 %289, 1
  br i1 %290, label %291, label %295

291:                                              ; preds = %287
  %292 = load ptr, ptr @stderr, align 8, !tbaa !5
  %293 = load ptr, ptr %5, align 8, !tbaa !5
  %294 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %292, ptr noundef @.str.105, ptr noundef %293) #8
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %301

295:                                              ; preds = %287
  %296 = load i32, ptr %10, align 4, !tbaa !17
  %297 = load i32, ptr %11, align 4, !tbaa !17
  %298 = load i32, ptr %12, align 4, !tbaa !17
  %299 = load float, ptr %16, align 4, !tbaa !32
  %300 = fpext float %299 to double
  call void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %17, i32 noundef %296, i32 noundef %297, i32 noundef %298, double noundef %300)
  store i32 0, ptr %7, align 4
  br label %301

301:                                              ; preds = %295, %291
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  %302 = load i32, ptr %7, align 4
  switch i32 %302, label %307 [
    i32 0, label %303
  ]

303:                                              ; preds = %301
  br label %304

304:                                              ; preds = %303
  %305 = load i32, ptr %15, align 4, !tbaa !17
  %306 = add nsw i32 %305, 1
  store i32 %306, ptr %15, align 4, !tbaa !17
  br label %261, !llvm.loop !33

307:                                              ; preds = %301, %266
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  %308 = load i32, ptr %7, align 4
  switch i32 %308, label %313 [
    i32 8, label %309
  ]

309:                                              ; preds = %307
  br label %310

310:                                              ; preds = %309
  %311 = load i32, ptr %14, align 4, !tbaa !17
  %312 = add nsw i32 %311, 1
  store i32 %312, ptr %14, align 4, !tbaa !17
  br label %234, !llvm.loop !35

313:                                              ; preds = %307, %239
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  %314 = load i32, ptr %7, align 4
  switch i32 %314, label %319 [
    i32 5, label %315
  ]

315:                                              ; preds = %313
  br label %316

316:                                              ; preds = %315
  %317 = load i32, ptr %13, align 4, !tbaa !17
  %318 = add nsw i32 %317, 1
  store i32 %318, ptr %13, align 4, !tbaa !17
  br label %207, !llvm.loop !36

319:                                              ; preds = %313, %212
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  %320 = load i32, ptr %7, align 4
  switch i32 %320, label %324 [
    i32 2, label %321
  ]

321:                                              ; preds = %319
  %322 = load ptr, ptr %6, align 8, !tbaa !5
  %323 = call i32 @fclose(ptr noundef %322)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %324

324:                                              ; preds = %321, %319
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %325

325:                                              ; preds = %324, %203
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %326

326:                                              ; preds = %325, %68, %58, %44, %28
  call void @llvm.lifetime.end.p0(i64 1024, ptr %8) #8
  br label %327

327:                                              ; preds = %326, %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  %328 = load i32, ptr %3, align 4
  ret i32 %328
}

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

declare i32 @fclose(ptr noundef) #2

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #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 = { 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 = { 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 = { 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 #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 = { nounwind }
attributes #9 = { builtin nounwind }
attributes #10 = { 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, !11, i64 0}
!10 = !{!"_ZTS16R3GridCCP4Header", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !11, i64 88, !11, i64 92, !7, i64 96}
!11 = !{!"int", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!10, !11, i64 4}
!14 = !{!10, !11, i64 8}
!15 = !{!10, !11, i64 12}
!16 = !{!10, !11, i64 92}
!17 = !{!11, !11, i64 0}
!18 = !{!19, !6, i64 560}
!19 = !{!"_ZTS6R3Grid", !20, i64 0, !20, i64 272, !25, i64 544, !25, i64 552, !6, i64 560, !7, i64 568, !11, i64 580, !11, i64 584, !11, i64 588}
!20 = !{!"_ZTS8R3Affine", !21, i64 0, !22, i64 8, !22, i64 136, !23, i64 264}
!21 = !{!"_ZTS16R3Transformation"}
!22 = !{!"_ZTS8R4Matrix", !7, i64 0}
!23 = !{!"_ZTS7RNFlags", !24, i64 0}
!24 = !{!"long", !7, i64 0}
!25 = !{!"double", !7, i64 0}
!26 = !{!19, !11, i64 588}
!27 = !{!10, !11, i64 64}
!28 = !{!10, !11, i64 68}
!29 = !{!19, !11, i64 580}
!30 = !{!19, !11, i64 584}
!31 = !{!10, !11, i64 72}
!32 = !{!12, !12, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = distinct !{!35, !34}
!36 = distinct !{!36, !34}


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

%struct.R3GridCCP4Header = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, float, float, float, float, float, i32, i32, i32, float, float, float, i32, i32, [232 x i32] }

@stderr = external local_unnamed_addr global ptr, align 8
@.str.45 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.100 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.101 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.102 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.103 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.104 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.105 = external hidden unnamed_addr constant [38 x i8], align 1

; 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: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592), i32 noundef, i32 noundef, i32 noundef, double noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6R3Grid12ReadCCP4FileEPKc(ptr noundef nonnull align 8 dereferenceable(592) %0, ptr noundef %1) local_unnamed_addr #5 align 2 {
  %3 = alloca %struct.R3GridCCP4Header, align 4
  %4 = alloca float, align 4
  %5 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str.45)
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %6, label %7

6:                                                ; preds = %2
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.100, ptr noundef %1)
  br label %108

7:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %3) #7
  %8 = call i64 @fread(ptr noundef nonnull %3, i64 noundef 1024, i64 noundef 1, ptr noundef nonnull %5)
  %.not86 = icmp eq i64 %8, 1
  br i1 %.not86, label %12, label %9

9:                                                ; preds = %7
  %10 = load ptr, ptr @stderr, align 8, !tbaa !5
  %11 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.101, ptr noundef %1) #8
  br label %107

12:                                               ; preds = %7
  %13 = load i32, ptr %3, align 4, !tbaa !9
  %14 = icmp slt i32 %13, 1
  %15 = getelementptr inbounds i8, ptr %3, i64 4
  %16 = load i32, ptr %15, align 4
  %17 = icmp slt i32 %16, 1
  %or.cond = select i1 %14, i1 true, i1 %17
  %18 = getelementptr inbounds i8, ptr %3, i64 8
  %19 = load i32, ptr %18, align 4
  %20 = icmp slt i32 %19, 1
  %or.cond8 = select i1 %or.cond, i1 true, i1 %20
  br i1 %or.cond8, label %21, label %24

21:                                               ; preds = %12
  %22 = load ptr, ptr @stderr, align 8, !tbaa !5
  %23 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef nonnull @.str.102, i32 noundef %13, i32 noundef %16, i32 noundef %19, ptr noundef %1) #8
  br label %107

24:                                               ; preds = %12
  %25 = getelementptr inbounds i8, ptr %3, i64 12
  %26 = load i32, ptr %25, align 4, !tbaa !13
  %.not87 = icmp eq i32 %26, 2
  br i1 %.not87, label %30, label %27

27:                                               ; preds = %24
  %28 = load ptr, ptr @stderr, align 8, !tbaa !5
  %29 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef nonnull @.str.103, i32 noundef %26, ptr noundef %1) #8
  br label %107

30:                                               ; preds = %24
  %31 = getelementptr inbounds i8, ptr %3, i64 92
  %32 = load i32, ptr %31, align 4, !tbaa !14
  %33 = icmp slt i32 %32, 0
  br i1 %33, label %34, label %37

34:                                               ; preds = %30
  %35 = load ptr, ptr @stderr, align 8, !tbaa !5
  %36 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef nonnull @.str.104, i32 noundef %32, ptr noundef %1) #8
  br label %107

37:                                               ; preds = %30
  %38 = mul nuw nsw i32 %16, %13
  %39 = mul nuw nsw i32 %38, %19
  %40 = getelementptr inbounds i8, ptr %0, i64 560
  %41 = load ptr, ptr %40, align 8, !tbaa !15
  %.not88 = icmp eq ptr %41, null
  %42 = getelementptr inbounds i8, ptr %0, i64 588
  %43 = load i32, ptr %42, align 4
  %44 = icmp sgt i32 %39, %43
  %or.cond96 = select i1 %.not88, i1 true, i1 %44
  br i1 %or.cond96, label %45, label %51

45:                                               ; preds = %37
  br i1 %.not88, label %47, label %46

46:                                               ; preds = %45
  tail call void @_ZdaPv(ptr noundef nonnull %41) #9
  br label %47

47:                                               ; preds = %46, %45
  %48 = zext nneg i32 %39 to i64
  %49 = shl nuw nsw i64 %48, 3
  %50 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %49) #10
  store ptr %50, ptr %40, align 8, !tbaa !15
  br label %51

51:                                               ; preds = %37, %47
  %52 = getelementptr inbounds i8, ptr %3, i64 64
  %53 = load i32, ptr %52, align 4, !tbaa !23
  %54 = icmp eq i32 %53, 1
  br i1 %54, label %.thread100, label %60

.thread100:                                       ; preds = %51
  %55 = getelementptr inbounds i8, ptr %0, i64 568
  store i32 %13, ptr %55, align 8, !tbaa !24
  %56 = getelementptr inbounds i8, ptr %3, i64 68
  %57 = load i32, ptr %56, align 4
  %58 = icmp eq i32 %57, 2
  %59 = select i1 %58, i32 %16, i32 %19
  br label %.sink.split

60:                                               ; preds = %51
  %61 = getelementptr inbounds i8, ptr %3, i64 68
  %62 = load i32, ptr %61, align 4
  %63 = icmp eq i32 %62, 1
  %64 = select i1 %63, i32 %16, i32 %19
  %65 = getelementptr inbounds i8, ptr %0, i64 568
  store i32 %64, ptr %65, align 8, !tbaa !24
  %66 = icmp eq i32 %53, 2
  br i1 %66, label %.sink.split, label %67

67:                                               ; preds = %60
  %68 = icmp eq i32 %62, 2
  %69 = select i1 %68, i32 %16, i32 %19
  %70 = getelementptr inbounds i8, ptr %0, i64 572
  store i32 %69, ptr %70, align 4, !tbaa !24
  %71 = icmp eq i32 %53, 3
  br i1 %71, label %.lr.ph.split.us.split.us.preheader, label %73

.sink.split:                                      ; preds = %60, %.thread100
  %.sink = phi i32 [ %59, %.thread100 ], [ %13, %60 ]
  %.ph = phi i32 [ %57, %.thread100 ], [ %62, %60 ]
  %.ph276 = phi i32 [ %13, %.thread100 ], [ %64, %60 ]
  %72 = getelementptr inbounds i8, ptr %0, i64 572
  store i32 %.sink, ptr %72, align 4, !tbaa !24
  br label %73

73:                                               ; preds = %.sink.split, %67
  %74 = phi i32 [ %62, %67 ], [ %.ph, %.sink.split ]
  %75 = phi i32 [ %69, %67 ], [ %.sink, %.sink.split ]
  %76 = phi i32 [ %64, %67 ], [ %.ph276, %.sink.split ]
  %77 = icmp eq i32 %74, 3
  %78 = select i1 %77, i32 %16, i32 %19
  br label %.lr.ph.split.us.split.us.preheader

.lr.ph.split.us.split.us.preheader:               ; preds = %73, %67
  %79 = phi i32 [ %74, %73 ], [ %62, %67 ]
  %80 = phi i32 [ %75, %73 ], [ %69, %67 ]
  %81 = phi i32 [ %76, %73 ], [ %64, %67 ]
  %82 = phi i32 [ %78, %73 ], [ %13, %67 ]
  %83 = getelementptr inbounds i8, ptr %0, i64 576
  store i32 %82, ptr %83, align 8, !tbaa !24
  %84 = getelementptr inbounds i8, ptr %0, i64 580
  store i32 %81, ptr %84, align 4, !tbaa !25
  %85 = mul nsw i32 %81, %80
  %86 = getelementptr inbounds i8, ptr %0, i64 584
  store i32 %85, ptr %86, align 8, !tbaa !26
  %87 = mul nsw i32 %85, %82
  store i32 %87, ptr %42, align 4, !tbaa !27
  %88 = getelementptr inbounds i8, ptr %3, i64 72
  %89 = load i32, ptr %88, align 4, !tbaa !28
  br label %.lr.ph.split.us.split.us

.lr.ph.split.us.split.us:                         ; preds = %.lr.ph.split.us.split.us.preheader, %..thread106.loopexit_crit_edge.split.us.us.us
  %.045189.us.us = phi i32 [ %103, %..thread106.loopexit_crit_edge.split.us.us.us ], [ 0, %.lr.ph.split.us.split.us.preheader ]
  %.046188.us.us = phi i32 [ %.5.us.us.us, %..thread106.loopexit_crit_edge.split.us.us.us ], [ 0, %.lr.ph.split.us.split.us.preheader ]
  %.047187.us.us = phi i32 [ %.552.us.us.us, %..thread106.loopexit_crit_edge.split.us.us.us ], [ 0, %.lr.ph.split.us.split.us.preheader ]
  %.055186.us.us = phi i32 [ %.560.us.us.us, %..thread106.loopexit_crit_edge.split.us.us.us ], [ 0, %.lr.ph.split.us.split.us.preheader ]
  switch i32 %89, label %.fold.split.us.us [
    i32 1, label %.lr.ph132.us.us.preheader
    i32 2, label %91
    i32 3, label %90
  ]

90:                                               ; preds = %.lr.ph.split.us.split.us
  br label %.lr.ph132.us.us.preheader

91:                                               ; preds = %.lr.ph.split.us.split.us
  br label %.lr.ph132.us.us.preheader

.fold.split.us.us:                                ; preds = %.lr.ph.split.us.split.us
  br label %.lr.ph132.us.us.preheader

.lr.ph132.us.us.preheader:                        ; preds = %.fold.split.us.us, %91, %90, %.lr.ph.split.us.split.us
  %.2129.us.us.us.ph = phi i32 [ %.046188.us.us, %.lr.ph.split.us.split.us ], [ %.045189.us.us, %90 ], [ %.046188.us.us, %91 ], [ %.046188.us.us, %.fold.split.us.us ]
  %.249128.us.us.us.ph = phi i32 [ %.047187.us.us, %.lr.ph.split.us.split.us ], [ %.047187.us.us, %90 ], [ %.045189.us.us, %91 ], [ %.047187.us.us, %.fold.split.us.us ]
  %.257127.us.us.us.ph = phi i32 [ %.045189.us.us, %.lr.ph.split.us.split.us ], [ %.055186.us.us, %90 ], [ %.055186.us.us, %91 ], [ %.055186.us.us, %.fold.split.us.us ]
  br label %.lr.ph132.us.us

.lr.ph132.us.us:                                  ; preds = %.lr.ph132.us.us.preheader, %._crit_edge.us.us.us
  %.044130.us.us.us = phi i32 [ %102, %._crit_edge.us.us.us ], [ 0, %.lr.ph132.us.us.preheader ]
  %.2129.us.us.us = phi i32 [ %.5.us.us.us, %._crit_edge.us.us.us ], [ %.2129.us.us.us.ph, %.lr.ph132.us.us.preheader ]
  %.249128.us.us.us = phi i32 [ %.552.us.us.us, %._crit_edge.us.us.us ], [ %.249128.us.us.us.ph, %.lr.ph132.us.us.preheader ]
  %.257127.us.us.us = phi i32 [ %.560.us.us.us, %._crit_edge.us.us.us ], [ %.257127.us.us.us.ph, %.lr.ph132.us.us.preheader ]
  switch i32 %79, label %.fold.split97.us.us.us [
    i32 1, label %.lr.ph.us.us.us.preheader
    i32 2, label %93
    i32 3, label %92
  ]

92:                                               ; preds = %.lr.ph132.us.us
  br label %.lr.ph.us.us.us.preheader

93:                                               ; preds = %.lr.ph132.us.us
  br label %.lr.ph.us.us.us.preheader

.fold.split97.us.us.us:                           ; preds = %.lr.ph132.us.us
  br label %.lr.ph.us.us.us.preheader

.lr.ph.us.us.us.preheader:                        ; preds = %.fold.split97.us.us.us, %93, %92, %.lr.ph132.us.us
  %.4122.us.us.us.ph = phi i32 [ %.2129.us.us.us, %.lr.ph132.us.us ], [ %.044130.us.us.us, %92 ], [ %.2129.us.us.us, %93 ], [ %.2129.us.us.us, %.fold.split97.us.us.us ]
  %.451121.us.us.us.ph = phi i32 [ %.249128.us.us.us, %.lr.ph132.us.us ], [ %.249128.us.us.us, %92 ], [ %.044130.us.us.us, %93 ], [ %.249128.us.us.us, %.fold.split97.us.us.us ]
  %.459120.us.us.us.ph = phi i32 [ %.044130.us.us.us, %.lr.ph132.us.us ], [ %.257127.us.us.us, %92 ], [ %.257127.us.us.us, %93 ], [ %.257127.us.us.us, %.fold.split97.us.us.us ]
  br label %.lr.ph.us.us.us

.lr.ph.us.us.us:                                  ; preds = %.lr.ph.us.us.us.preheader, %98
  %.0123.us.us.us = phi i32 [ %101, %98 ], [ 0, %.lr.ph.us.us.us.preheader ]
  %.4122.us.us.us = phi i32 [ %.5.us.us.us, %98 ], [ %.4122.us.us.us.ph, %.lr.ph.us.us.us.preheader ]
  %.451121.us.us.us = phi i32 [ %.552.us.us.us, %98 ], [ %.451121.us.us.us.ph, %.lr.ph.us.us.us.preheader ]
  %.459120.us.us.us = phi i32 [ %.560.us.us.us, %98 ], [ %.459120.us.us.us.ph, %.lr.ph.us.us.us.preheader ]
  switch i32 %53, label %.fold.split98.us.us.us [
    i32 1, label %96
    i32 2, label %95
    i32 3, label %94
  ]

94:                                               ; preds = %.lr.ph.us.us.us
  br label %96

95:                                               ; preds = %.lr.ph.us.us.us
  br label %96

.fold.split98.us.us.us:                           ; preds = %.lr.ph.us.us.us
  br label %96

96:                                               ; preds = %.fold.split98.us.us.us, %95, %94, %.lr.ph.us.us.us
  %.560.us.us.us = phi i32 [ %.459120.us.us.us, %95 ], [ %.459120.us.us.us, %94 ], [ %.0123.us.us.us, %.lr.ph.us.us.us ], [ %.459120.us.us.us, %.fold.split98.us.us.us ]
  %.552.us.us.us = phi i32 [ %.0123.us.us.us, %95 ], [ %.451121.us.us.us, %94 ], [ %.451121.us.us.us, %.lr.ph.us.us.us ], [ %.451121.us.us.us, %.fold.split98.us.us.us ]
  %.5.us.us.us = phi i32 [ %.4122.us.us.us, %95 ], [ %.0123.us.us.us, %94 ], [ %.4122.us.us.us, %.lr.ph.us.us.us ], [ %.4122.us.us.us, %.fold.split98.us.us.us ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %97 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %5)
  %.not90.us.us.us = icmp eq i64 %97, 1
  br i1 %.not90.us.us.us, label %98, label %.split.us.us.us

98:                                               ; preds = %96
  %99 = load float, ptr %4, align 4, !tbaa !29
  %100 = fpext float %99 to double
  tail call void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %.560.us.us.us, i32 noundef %.552.us.us.us, i32 noundef %.5.us.us.us, double noundef %100)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %101 = add nuw nsw i32 %.0123.us.us.us, 1
  %exitcond.not = icmp eq i32 %101, %13
  br i1 %exitcond.not, label %._crit_edge.us.us.us, label %.lr.ph.us.us.us, !llvm.loop !30

._crit_edge.us.us.us:                             ; preds = %98
  %102 = add nuw nsw i32 %.044130.us.us.us, 1
  %exitcond270.not = icmp eq i32 %102, %16
  br i1 %exitcond270.not, label %..thread106.loopexit_crit_edge.split.us.us.us, label %.lr.ph132.us.us, !llvm.loop !32

..thread106.loopexit_crit_edge.split.us.us.us:    ; preds = %._crit_edge.us.us.us
  %103 = add nuw nsw i32 %.045189.us.us, 1
  %exitcond271.not = icmp eq i32 %103, %19
  br i1 %exitcond271.not, label %.critedge, label %.lr.ph.split.us.split.us, !llvm.loop !33

.split.us.us.us:                                  ; preds = %96
  %104 = load ptr, ptr @stderr, align 8, !tbaa !5
  %105 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef nonnull @.str.105, ptr noundef %1) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  br label %107

.critedge:                                        ; preds = %..thread106.loopexit_crit_edge.split.us.us.us
  %106 = tail call i32 @fclose(ptr noundef nonnull %5)
  br label %107

107:                                              ; preds = %.split.us.us.us, %.critedge, %34, %27, %21, %9
  %.9 = phi i32 [ 0, %9 ], [ 0, %21 ], [ 0, %27 ], [ 0, %34 ], [ 1, %.critedge ], [ 0, %.split.us.us.us ]
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %3) #7
  br label %108

108:                                              ; preds = %107, %6
  %.10 = phi i32 [ %.9, %107 ], [ 0, %6 ]
  ret i32 %.10
}

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #3

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

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 = { 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 = { 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 #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 = { 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 = { "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 = { cold nounwind }
attributes #9 = { builtin nounwind }
attributes #10 = { 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, !11, i64 0}
!10 = !{!"_ZTS16R3GridCCP4Header", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !11, i64 88, !11, i64 92, !7, i64 96}
!11 = !{!"int", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!10, !11, i64 12}
!14 = !{!10, !11, i64 92}
!15 = !{!16, !6, i64 560}
!16 = !{!"_ZTS6R3Grid", !17, i64 0, !17, i64 272, !22, i64 544, !22, i64 552, !6, i64 560, !7, i64 568, !11, i64 580, !11, i64 584, !11, i64 588}
!17 = !{!"_ZTS8R3Affine", !18, i64 0, !19, i64 8, !19, i64 136, !20, i64 264}
!18 = !{!"_ZTS16R3Transformation"}
!19 = !{!"_ZTS8R4Matrix", !7, i64 0}
!20 = !{!"_ZTS7RNFlags", !21, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!"double", !7, i64 0}
!23 = !{!10, !11, i64 64}
!24 = !{!11, !11, i64 0}
!25 = !{!16, !11, i64 580}
!26 = !{!16, !11, i64 584}
!27 = !{!16, !11, i64 588}
!28 = !{!10, !11, i64 72}
!29 = !{!12, !12, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31}
!33 = distinct !{!33, !31}


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