; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R2Shapes/R2Grid.ll (ZN6R2Grid11ReadPFMFileEPKc)

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

@R2identity_affine = external global %class.R2Affine, align 8
@RN_EPSILON = external global double, align 8
@stderr = external global ptr, align 8
@.str.40 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [34 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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(84) ptr @_ZN8R2AffineaSERKS_(ptr noundef nonnull align 8 dereferenceable(84), ptr noundef nonnull align 8 dereferenceable(84)) #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z9RNIsEqualddd(double noundef, double noundef, double noundef) #3

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6R2Grid11ReadPFMFileEPKc(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr noundef %1) #6 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 i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca [256 x i8], align 16
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca [256 x i8], align 16
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca [256 x i8], align 16
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca float, align 4
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %26 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #10
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = call noalias ptr @fopen(ptr noundef %27, ptr noundef @.str.40)
  store ptr %28, ptr %6, align 8, !tbaa !5
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = icmp ne ptr %29, null
  br i1 %30, label %35, label %31

31:                                               ; preds = %2
  %32 = load ptr, ptr @stderr, align 8, !tbaa !5
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef @.str.49, ptr noundef %33) #10
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %388

35:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #10
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = call i32 @fgetc(ptr noundef %36)
  store i32 %37, ptr %8, align 4, !tbaa !9
  %38 = load i32, ptr %8, align 4, !tbaa !9
  %39 = icmp ne i32 %38, 80
  br i1 %39, label %40, label %44

40:                                               ; preds = %35
  %41 = load ptr, ptr @stderr, align 8, !tbaa !5
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef @.str.50, ptr noundef %42) #10
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %387

44:                                               ; preds = %35
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = call i32 @fgetc(ptr noundef %45)
  store i32 %46, ptr %8, align 4, !tbaa !9
  %47 = load i32, ptr %8, align 4, !tbaa !9
  %48 = icmp ne i32 %47, 102
  br i1 %48, label %49, label %53

49:                                               ; preds = %44
  %50 = load ptr, ptr @stderr, align 8, !tbaa !5
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef @.str.50, ptr noundef %51) #10
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %387

53:                                               ; preds = %44
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = call i32 @fgetc(ptr noundef %54)
  store i32 %55, ptr %8, align 4, !tbaa !9
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = icmp ne i32 %56, 10
  br i1 %57, label %58, label %62

58:                                               ; preds = %53
  %59 = load ptr, ptr @stderr, align 8, !tbaa !5
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef @.str.50, ptr noundef %60) #10
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %387

62:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #10
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 256, ptr %10) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #10
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %63

63:                                               ; preds = %105, %62
  %64 = load i32, ptr %11, align 4, !tbaa !9
  %65 = icmp slt i32 %64, 256
  br i1 %65, label %67, label %66

66:                                               ; preds = %63
  store i32 2, ptr %7, align 4
  br label %108

67:                                               ; preds = %63
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = call i32 @fgetc(ptr noundef %68)
  store i32 %69, ptr %8, align 4, !tbaa !9
  %70 = load i32, ptr %8, align 4, !tbaa !9
  %71 = icmp eq i32 %70, 32
  br i1 %71, label %72, label %76

72:                                               ; preds = %67
  %73 = load i32, ptr %9, align 4, !tbaa !9
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %75, label %76

75:                                               ; preds = %72
  br label %105

76:                                               ; preds = %72, %67
  %77 = load i32, ptr %8, align 4, !tbaa !9
  %78 = icmp eq i32 %77, 32
  br i1 %78, label %82, label %79

79:                                               ; preds = %76
  %80 = load i32, ptr %8, align 4, !tbaa !9
  %81 = icmp eq i32 %80, 10
  br i1 %81, label %82, label %86

82:                                               ; preds = %79, %76
  %83 = load i32, ptr %9, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [256 x i8], ptr %10, i64 0, i64 %84
  store i8 0, ptr %85, align 1, !tbaa !11
  store i32 2, ptr %7, align 4
  br label %108

86:                                               ; preds = %79
  %87 = load i32, ptr %8, align 4, !tbaa !9
  %88 = call i32 @isdigit(i32 noundef %87) #11
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %95, label %90

90:                                               ; preds = %86
  %91 = load ptr, ptr @stderr, align 8, !tbaa !5
  %92 = load i32, ptr %8, align 4, !tbaa !9
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %91, ptr noundef @.str.51, i32 noundef %92, ptr noundef %93) #10
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %108

95:                                               ; preds = %86
  %96 = load i32, ptr %8, align 4, !tbaa !9
  %97 = trunc i32 %96 to i8
  %98 = load i32, ptr %9, align 4, !tbaa !9
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %9, align 4, !tbaa !9
  %100 = sext i32 %98 to i64
  %101 = getelementptr inbounds [256 x i8], ptr %10, i64 0, i64 %100
  store i8 %97, ptr %101, align 1, !tbaa !11
  br label %102

102:                                              ; preds = %95
  br label %103

103:                                              ; preds = %102
  br label %104

104:                                              ; preds = %103
  br label %105

105:                                              ; preds = %104, %75
  %106 = load i32, ptr %11, align 4, !tbaa !9
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %11, align 4, !tbaa !9
  br label %63, !llvm.loop !12

108:                                              ; preds = %90, %82, %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #10
  %109 = load i32, ptr %7, align 4
  switch i32 %109, label %386 [
    i32 2, label %110
  ]

110:                                              ; preds = %108
  %111 = load i32, ptr %9, align 4, !tbaa !9
  %112 = icmp eq i32 %111, 0
  br i1 %112, label %116, label %113

113:                                              ; preds = %110
  %114 = load i32, ptr %9, align 4, !tbaa !9
  %115 = icmp sgt i32 %114, 128
  br i1 %115, label %116, label %120

116:                                              ; preds = %113, %110
  %117 = load ptr, ptr @stderr, align 8, !tbaa !5
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %117, ptr noundef @.str.52, ptr noundef %118) #10
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %386

120:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #10
  store i32 0, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 256, ptr %13) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #10
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %121

121:                                              ; preds = %163, %120
  %122 = load i32, ptr %14, align 4, !tbaa !9
  %123 = icmp slt i32 %122, 256
  br i1 %123, label %125, label %124

124:                                              ; preds = %121
  store i32 5, ptr %7, align 4
  br label %166

125:                                              ; preds = %121
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = call i32 @fgetc(ptr noundef %126)
  store i32 %127, ptr %8, align 4, !tbaa !9
  %128 = load i32, ptr %8, align 4, !tbaa !9
  %129 = icmp eq i32 %128, 32
  br i1 %129, label %130, label %134

130:                                              ; preds = %125
  %131 = load i32, ptr %12, align 4, !tbaa !9
  %132 = icmp eq i32 %131, 0
  br i1 %132, label %133, label %134

133:                                              ; preds = %130
  br label %163

134:                                              ; preds = %130, %125
  %135 = load i32, ptr %8, align 4, !tbaa !9
  %136 = icmp eq i32 %135, 32
  br i1 %136, label %140, label %137

137:                                              ; preds = %134
  %138 = load i32, ptr %8, align 4, !tbaa !9
  %139 = icmp eq i32 %138, 10
  br i1 %139, label %140, label %144

140:                                              ; preds = %137, %134
  %141 = load i32, ptr %12, align 4, !tbaa !9
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [256 x i8], ptr %13, i64 0, i64 %142
  store i8 0, ptr %143, align 1, !tbaa !11
  store i32 5, ptr %7, align 4
  br label %166

144:                                              ; preds = %137
  %145 = load i32, ptr %8, align 4, !tbaa !9
  %146 = call i32 @isdigit(i32 noundef %145) #11
  %147 = icmp ne i32 %146, 0
  br i1 %147, label %153, label %148

148:                                              ; preds = %144
  %149 = load ptr, ptr @stderr, align 8, !tbaa !5
  %150 = load i32, ptr %8, align 4, !tbaa !9
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %149, ptr noundef @.str.53, i32 noundef %150, ptr noundef %151) #10
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %166

153:                                              ; preds = %144
  %154 = load i32, ptr %8, align 4, !tbaa !9
  %155 = trunc i32 %154 to i8
  %156 = load i32, ptr %12, align 4, !tbaa !9
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %12, align 4, !tbaa !9
  %158 = sext i32 %156 to i64
  %159 = getelementptr inbounds [256 x i8], ptr %13, i64 0, i64 %158
  store i8 %155, ptr %159, align 1, !tbaa !11
  br label %160

160:                                              ; preds = %153
  br label %161

161:                                              ; preds = %160
  br label %162

162:                                              ; preds = %161
  br label %163

163:                                              ; preds = %162, %133
  %164 = load i32, ptr %14, align 4, !tbaa !9
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %14, align 4, !tbaa !9
  br label %121, !llvm.loop !14

166:                                              ; preds = %148, %140, %124
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #10
  %167 = load i32, ptr %7, align 4
  switch i32 %167, label %385 [
    i32 5, label %168
  ]

168:                                              ; preds = %166
  %169 = load i32, ptr %12, align 4, !tbaa !9
  %170 = icmp eq i32 %169, 0
  br i1 %170, label %174, label %171

171:                                              ; preds = %168
  %172 = load i32, ptr %12, align 4, !tbaa !9
  %173 = icmp sgt i32 %172, 128
  br i1 %173, label %174, label %178

174:                                              ; preds = %171, %168
  %175 = load ptr, ptr @stderr, align 8, !tbaa !5
  %176 = load ptr, ptr %5, align 8, !tbaa !5
  %177 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %175, ptr noundef @.str.54, ptr noundef %176) #10
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %385

178:                                              ; preds = %171
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #10
  store i32 0, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 256, ptr %16) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #10
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %179

179:                                              ; preds = %225, %178
  %180 = load i32, ptr %17, align 4, !tbaa !9
  %181 = icmp slt i32 %180, 256
  br i1 %181, label %183, label %182

182:                                              ; preds = %179
  store i32 8, ptr %7, align 4
  br label %228

183:                                              ; preds = %179
  %184 = load ptr, ptr %6, align 8, !tbaa !5
  %185 = call i32 @fgetc(ptr noundef %184)
  store i32 %185, ptr %8, align 4, !tbaa !9
  %186 = load i32, ptr %8, align 4, !tbaa !9
  %187 = icmp eq i32 %186, 32
  br i1 %187, label %188, label %192

188:                                              ; preds = %183
  %189 = load i32, ptr %15, align 4, !tbaa !9
  %190 = icmp eq i32 %189, 0
  br i1 %190, label %191, label %192

191:                                              ; preds = %188
  br label %225

192:                                              ; preds = %188, %183
  %193 = load i32, ptr %8, align 4, !tbaa !9
  %194 = icmp eq i32 %193, 32
  br i1 %194, label %198, label %195

195:                                              ; preds = %192
  %196 = load i32, ptr %8, align 4, !tbaa !9
  %197 = icmp eq i32 %196, 10
  br i1 %197, label %198, label %202

198:                                              ; preds = %195, %192
  %199 = load i32, ptr %15, align 4, !tbaa !9
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [256 x i8], ptr %16, i64 0, i64 %200
  store i8 0, ptr %201, align 1, !tbaa !11
  store i32 8, ptr %7, align 4
  br label %228

202:                                              ; preds = %195
  br label %203

203:                                              ; preds = %202
  %204 = load i32, ptr %8, align 4, !tbaa !9
  %205 = call i32 @isdigit(i32 noundef %204) #11
  %206 = icmp ne i32 %205, 0
  br i1 %206, label %218, label %207

207:                                              ; preds = %203
  %208 = load i32, ptr %8, align 4, !tbaa !9
  %209 = icmp ne i32 %208, 46
  br i1 %209, label %210, label %218

210:                                              ; preds = %207
  %211 = load i32, ptr %8, align 4, !tbaa !9
  %212 = icmp ne i32 %211, 45
  br i1 %212, label %213, label %218

213:                                              ; preds = %210
  %214 = load ptr, ptr @stderr, align 8, !tbaa !5
  %215 = load i32, ptr %8, align 4, !tbaa !9
  %216 = load ptr, ptr %5, align 8, !tbaa !5
  %217 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %214, ptr noundef @.str.60, i32 noundef %215, ptr noundef %216) #10
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %228

218:                                              ; preds = %210, %207, %203
  %219 = load i32, ptr %8, align 4, !tbaa !9
  %220 = trunc i32 %219 to i8
  %221 = load i32, ptr %15, align 4, !tbaa !9
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %15, align 4, !tbaa !9
  %223 = sext i32 %221 to i64
  %224 = getelementptr inbounds [256 x i8], ptr %16, i64 0, i64 %223
  store i8 %220, ptr %224, align 1, !tbaa !11
  br label %225

225:                                              ; preds = %218, %191
  %226 = load i32, ptr %17, align 4, !tbaa !9
  %227 = add nsw i32 %226, 1
  store i32 %227, ptr %17, align 4, !tbaa !9
  br label %179, !llvm.loop !15

228:                                              ; preds = %213, %198, %182
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #10
  %229 = load i32, ptr %7, align 4
  switch i32 %229, label %384 [
    i32 8, label %230
  ]

230:                                              ; preds = %228
  %231 = load i32, ptr %15, align 4, !tbaa !9
  %232 = icmp eq i32 %231, 0
  br i1 %232, label %236, label %233

233:                                              ; preds = %230
  %234 = load i32, ptr %15, align 4, !tbaa !9
  %235 = icmp sgt i32 %234, 128
  br i1 %235, label %236, label %240

236:                                              ; preds = %233, %230
  %237 = load ptr, ptr @stderr, align 8, !tbaa !5
  %238 = load ptr, ptr %5, align 8, !tbaa !5
  %239 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %237, ptr noundef @.str.61, ptr noundef %238) #10
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %384

240:                                              ; preds = %233
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #10
  %241 = getelementptr inbounds [256 x i8], ptr %10, i64 0, i64 0
  %242 = call i32 @atoi(ptr noundef %241) #11
  store i32 %242, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #10
  %243 = getelementptr inbounds [256 x i8], ptr %13, i64 0, i64 0
  %244 = call i32 @atoi(ptr noundef %243) #11
  store i32 %244, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #10
  %245 = getelementptr inbounds [256 x i8], ptr %16, i64 0, i64 0
  %246 = call double @atof(ptr noundef %245) #11
  %247 = fptrunc double %246 to float
  store float %247, ptr %20, align 4, !tbaa !16
  %248 = load float, ptr %20, align 4, !tbaa !16
  %249 = fcmp oeq float %248, -9.990000e+02
  br i1 %249, label %250, label %253

250:                                              ; preds = %240
  %251 = load ptr, ptr @stderr, align 8, !tbaa !5
  %252 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %251, ptr noundef @.str.62) #10
  br label %253

253:                                              ; preds = %250, %240
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #10
  %254 = load i32, ptr %18, align 4, !tbaa !9
  %255 = load i32, ptr %19, align 4, !tbaa !9
  %256 = mul nsw i32 %254, %255
  store i32 %256, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #10
  %257 = load i32, ptr %21, align 4, !tbaa !9
  %258 = sext i32 %257 to i64
  %259 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %258, i64 4)
  %260 = extractvalue { i64, i1 } %259, 1
  %261 = extractvalue { i64, i1 } %259, 0
  %262 = select i1 %260, i64 -1, i64 %261
  %263 = call noalias noundef nonnull ptr @_Znam(i64 noundef %262) #12
  store ptr %263, ptr %22, align 8, !tbaa !5
  %264 = load ptr, ptr %22, align 8, !tbaa !5
  %265 = icmp ne ptr %264, null
  br i1 %265, label %270, label %266

266:                                              ; preds = %253
  %267 = load ptr, ptr @stderr, align 8, !tbaa !5
  %268 = load ptr, ptr %5, align 8, !tbaa !5
  %269 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %267, ptr noundef @.str.63, ptr noundef %268) #10
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %383

270:                                              ; preds = %253
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #10
  %271 = load i32, ptr %21, align 4, !tbaa !9
  store i32 %271, ptr %23, align 4, !tbaa !9
  br label %272

272:                                              ; preds = %299, %270
  %273 = load i32, ptr %23, align 4, !tbaa !9
  %274 = icmp sgt i32 %273, 0
  br i1 %274, label %275, label %300

275:                                              ; preds = %272
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #10
  %276 = load ptr, ptr %22, align 8, !tbaa !5
  %277 = load i32, ptr %21, align 4, !tbaa !9
  %278 = load i32, ptr %23, align 4, !tbaa !9
  %279 = sub nsw i32 %277, %278
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds float, ptr %276, i64 %280
  %282 = load i32, ptr %23, align 4, !tbaa !9
  %283 = sext i32 %282 to i64
  %284 = load ptr, ptr %6, align 8, !tbaa !5
  %285 = call i64 @fread(ptr noundef %281, i64 noundef 4, i64 noundef %283, ptr noundef %284)
  %286 = trunc i64 %285 to i32
  store i32 %286, ptr %24, align 4, !tbaa !9
  %287 = load i32, ptr %24, align 4, !tbaa !9
  %288 = icmp sle i32 %287, 0
  br i1 %288, label %289, label %293

289:                                              ; preds = %275
  %290 = load ptr, ptr @stderr, align 8, !tbaa !5
  %291 = load ptr, ptr %5, align 8, !tbaa !5
  %292 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %290, ptr noundef @.str.46, ptr noundef %291) #10
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %297

293:                                              ; preds = %275
  %294 = load i32, ptr %24, align 4, !tbaa !9
  %295 = load i32, ptr %23, align 4, !tbaa !9
  %296 = sub nsw i32 %295, %294
  store i32 %296, ptr %23, align 4, !tbaa !9
  store i32 0, ptr %7, align 4
  br label %297

297:                                              ; preds = %293, %289
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #10
  %298 = load i32, ptr %7, align 4
  switch i32 %298, label %382 [
    i32 0, label %299
  ]

299:                                              ; preds = %297
  br label %272, !llvm.loop !18

300:                                              ; preds = %272
  %301 = load i32, ptr %18, align 4, !tbaa !9
  %302 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 4
  %303 = getelementptr inbounds [2 x i32], ptr %302, i64 0, i64 0
  store i32 %301, ptr %303, align 8, !tbaa !9
  %304 = load i32, ptr %19, align 4, !tbaa !9
  %305 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 4
  %306 = getelementptr inbounds [2 x i32], ptr %305, i64 0, i64 1
  store i32 %304, ptr %306, align 4, !tbaa !9
  %307 = load i32, ptr %18, align 4, !tbaa !9
  %308 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 5
  store i32 %307, ptr %308, align 8, !tbaa !19
  %309 = load i32, ptr %21, align 4, !tbaa !9
  %310 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 6
  store i32 %309, ptr %310, align 4, !tbaa !25
  %311 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 2
  store double 1.000000e+00, ptr %311, align 8, !tbaa !26
  %312 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 1
  %313 = call noundef nonnull align 8 dereferenceable(84) ptr @_ZN8R2AffineaSERKS_(ptr noundef nonnull align 8 dereferenceable(84) %312, ptr noundef nonnull align 8 dereferenceable(84) @R2identity_affine)
  %314 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 0
  %315 = call noundef nonnull align 8 dereferenceable(84) ptr @_ZN8R2AffineaSERKS_(ptr noundef nonnull align 8 dereferenceable(84) %314, ptr noundef nonnull align 8 dereferenceable(84) @R2identity_affine)
  %316 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 3
  %317 = load ptr, ptr %316, align 8, !tbaa !27
  %318 = icmp ne ptr %317, null
  br i1 %318, label %319, label %325

319:                                              ; preds = %300
  %320 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 3
  %321 = load ptr, ptr %320, align 8, !tbaa !27
  %322 = icmp eq ptr %321, null
  br i1 %322, label %324, label %323

323:                                              ; preds = %319
  call void @_ZdaPv(ptr noundef %321) #13
  br label %324

324:                                              ; preds = %323, %319
  br label %325

325:                                              ; preds = %324, %300
  %326 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 6
  %327 = load i32, ptr %326, align 4, !tbaa !25
  %328 = sext i32 %327 to i64
  %329 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %328, i64 8)
  %330 = extractvalue { i64, i1 } %329, 1
  %331 = extractvalue { i64, i1 } %329, 0
  %332 = select i1 %330, i64 -1, i64 %331
  %333 = call noalias noundef nonnull ptr @_Znam(i64 noundef %332) #12
  %334 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 3
  store ptr %333, ptr %334, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #10
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %335

335:                                              ; preds = %370, %325
  %336 = load i32, ptr %25, align 4, !tbaa !9
  %337 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 6
  %338 = load i32, ptr %337, align 4, !tbaa !25
  %339 = icmp slt i32 %336, %338
  br i1 %339, label %341, label %340

340:                                              ; preds = %335
  store i32 13, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #10
  br label %373

341:                                              ; preds = %335
  %342 = load ptr, ptr %22, align 8, !tbaa !5
  %343 = load i32, ptr %25, align 4, !tbaa !9
  %344 = sext i32 %343 to i64
  %345 = getelementptr inbounds float, ptr %342, i64 %344
  %346 = load float, ptr %345, align 4, !tbaa !16
  %347 = fpext float %346 to double
  %348 = load double, ptr @RN_EPSILON, align 8, !tbaa !28
  %349 = call noundef i32 @_Z9RNIsEqualddd(double noundef %347, double noundef -3.210000e+02, double noundef %348)
  %350 = icmp ne i32 %349, 0
  br i1 %350, label %351, label %357

351:                                              ; preds = %341
  %352 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 3
  %353 = load ptr, ptr %352, align 8, !tbaa !27
  %354 = load i32, ptr %25, align 4, !tbaa !9
  %355 = sext i32 %354 to i64
  %356 = getelementptr inbounds double, ptr %353, i64 %355
  store double -3.210000e+02, ptr %356, align 8, !tbaa !28
  br label %369

357:                                              ; preds = %341
  %358 = load ptr, ptr %22, align 8, !tbaa !5
  %359 = load i32, ptr %25, align 4, !tbaa !9
  %360 = sext i32 %359 to i64
  %361 = getelementptr inbounds float, ptr %358, i64 %360
  %362 = load float, ptr %361, align 4, !tbaa !16
  %363 = fpext float %362 to double
  %364 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 3
  %365 = load ptr, ptr %364, align 8, !tbaa !27
  %366 = load i32, ptr %25, align 4, !tbaa !9
  %367 = sext i32 %366 to i64
  %368 = getelementptr inbounds double, ptr %365, i64 %367
  store double %363, ptr %368, align 8, !tbaa !28
  br label %369

369:                                              ; preds = %357, %351
  br label %370

370:                                              ; preds = %369
  %371 = load i32, ptr %25, align 4, !tbaa !9
  %372 = add nsw i32 %371, 1
  store i32 %372, ptr %25, align 4, !tbaa !9
  br label %335, !llvm.loop !29

373:                                              ; preds = %340
  %374 = load ptr, ptr %22, align 8, !tbaa !5
  %375 = icmp eq ptr %374, null
  br i1 %375, label %377, label %376

376:                                              ; preds = %373
  call void @_ZdaPv(ptr noundef %374) #13
  br label %377

377:                                              ; preds = %376, %373
  %378 = load ptr, ptr %6, align 8, !tbaa !5
  %379 = call i32 @fclose(ptr noundef %378)
  %380 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 6
  %381 = load i32, ptr %380, align 4, !tbaa !25
  store i32 %381, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %382

382:                                              ; preds = %377, %297
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #10
  br label %383

383:                                              ; preds = %382, %266
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #10
  br label %384

384:                                              ; preds = %383, %236, %228
  call void @llvm.lifetime.end.p0(i64 256, ptr %16) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #10
  br label %385

385:                                              ; preds = %384, %174, %166
  call void @llvm.lifetime.end.p0(i64 256, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #10
  br label %386

386:                                              ; preds = %385, %116, %108
  call void @llvm.lifetime.end.p0(i64 256, ptr %10) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #10
  br label %387

387:                                              ; preds = %386, %58, %49, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #10
  br label %388

388:                                              ; preds = %387, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #10
  %389 = load i32, ptr %3, align 4
  ret i32 %389
}

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

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

declare i32 @fclose(ptr noundef) #7

declare i32 @fgetc(ptr noundef) #7

; Function Attrs: nounwind willreturn memory(read)
declare i32 @isdigit(i32 noundef) #8

; Function Attrs: inlinehint mustprogress nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #9

; Function Attrs: inlinehint mustprogress nounwind willreturn memory(read) uwtable
declare double @atof(ptr noundef nonnull) #9

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = !{!17, !17, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = distinct !{!18, !13}
!19 = !{!20, !10, i64 200}
!20 = !{!"_ZTS6R2Grid", !21, i64 0, !21, i64 88, !24, i64 176, !6, i64 184, !7, i64 192, !10, i64 200, !10, i64 204}
!21 = !{!"_ZTS8R2Affine", !22, i64 0, !23, i64 8, !10, i64 80}
!22 = !{!"_ZTS16R2Transformation"}
!23 = !{!"_ZTS8R3Matrix", !7, i64 0}
!24 = !{!"double", !7, i64 0}
!25 = !{!20, !10, i64 204}
!26 = !{!20, !24, i64 176}
!27 = !{!20, !6, i64 184}
!28 = !{!24, !24, i64 0}
!29 = distinct !{!29, !13}


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

@R2identity_affine = external global %class.R2Affine, align 8
@RN_EPSILON = external local_unnamed_addr global double, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str.40 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [59 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: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(84) ptr @_ZN8R2AffineaSERKS_(ptr noundef nonnull align 8 dereferenceable(84), ptr noundef nonnull align 8 dereferenceable(84)) local_unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z9RNIsEqualddd(double noundef, double noundef, double noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6R2Grid11ReadPFMFileEPKc(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr noundef %1) local_unnamed_addr #5 align 2 {
  %3 = alloca [256 x i8], align 16
  %4 = alloca [256 x i8], align 16
  %5 = alloca [256 x i8], align 16
  %6 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str.40)
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %7, label %10

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

10:                                               ; preds = %2
  %11 = tail call i32 @fgetc(ptr noundef nonnull %6)
  %.not144 = icmp eq i32 %11, 80
  br i1 %.not144, label %15, label %12

12:                                               ; preds = %10
  %13 = load ptr, ptr @stderr, align 8, !tbaa !5
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.50, ptr noundef %1) #7
  br label %166

15:                                               ; preds = %10
  %16 = tail call i32 @fgetc(ptr noundef nonnull %6)
  %.not145 = icmp eq i32 %16, 102
  br i1 %.not145, label %20, label %17

17:                                               ; preds = %15
  %18 = load ptr, ptr @stderr, align 8, !tbaa !5
  %19 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef nonnull @.str.50, ptr noundef %1) #7
  br label %166

20:                                               ; preds = %15
  %21 = tail call i32 @fgetc(ptr noundef nonnull %6)
  %.not146 = icmp eq i32 %21, 10
  br i1 %.not146, label %25, label %22

22:                                               ; preds = %20
  %23 = load ptr, ptr @stderr, align 8, !tbaa !5
  %24 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.50, ptr noundef %1) #7
  br label %166

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %3) #8
  br label %26

26:                                               ; preds = %25, %43
  %.0129171 = phi i32 [ 0, %25 ], [ %.1130, %43 ]
  %.0131170 = phi i32 [ 0, %25 ], [ %44, %43 ]
  %27 = tail call i32 @fgetc(ptr noundef nonnull %6)
  %28 = icmp eq i32 %27, 32
  %29 = icmp eq i32 %.0129171, 0
  %or.cond = select i1 %28, i1 %29, i1 false
  br i1 %or.cond, label %43, label %30

30:                                               ; preds = %26
  switch i32 %27, label %34 [
    i32 32, label %31
    i32 10, label %31
  ]

31:                                               ; preds = %30, %30
  %32 = sext i32 %.0129171 to i64
  %33 = getelementptr inbounds [256 x i8], ptr %3, i64 0, i64 %32
  store i8 0, ptr %33, align 1, !tbaa !9
  br label %.critedge

34:                                               ; preds = %30
  %isdigittmp = add i32 %27, -48
  %isdigit = icmp ult i32 %isdigittmp, 10
  br i1 %isdigit, label %38, label %35

35:                                               ; preds = %34
  %36 = load ptr, ptr @stderr, align 8, !tbaa !5
  %37 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef nonnull @.str.51, i32 noundef %27, ptr noundef %1) #7
  br label %165

38:                                               ; preds = %34
  %39 = trunc nuw i32 %27 to i8
  %40 = add nsw i32 %.0129171, 1
  %41 = sext i32 %.0129171 to i64
  %42 = getelementptr inbounds [256 x i8], ptr %3, i64 0, i64 %41
  store i8 %39, ptr %42, align 1, !tbaa !9
  br label %43

43:                                               ; preds = %26, %38
  %.1130 = phi i32 [ 0, %26 ], [ %40, %38 ]
  %44 = add nuw nsw i32 %.0131170, 1
  %exitcond.not = icmp eq i32 %44, 256
  br i1 %exitcond.not, label %.critedge, label %26, !llvm.loop !10

.critedge:                                        ; preds = %43, %31
  %.0129168 = phi i32 [ %.0129171, %31 ], [ %.1130, %43 ]
  %45 = icmp eq i32 %.0129168, 0
  %46 = icmp sgt i32 %.0129168, 128
  %or.cond8 = or i1 %45, %46
  br i1 %or.cond8, label %47, label %50

47:                                               ; preds = %.critedge
  %48 = load ptr, ptr @stderr, align 8, !tbaa !5
  %49 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str.52, ptr noundef %1) #7
  br label %165

50:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %4) #8
  br label %51

51:                                               ; preds = %50, %68
  %.0132173 = phi i32 [ 0, %50 ], [ %.1133, %68 ]
  %.0137172 = phi i32 [ 0, %50 ], [ %69, %68 ]
  %52 = tail call i32 @fgetc(ptr noundef nonnull %6)
  %53 = icmp eq i32 %52, 32
  %54 = icmp eq i32 %.0132173, 0
  %or.cond10 = select i1 %53, i1 %54, i1 false
  br i1 %or.cond10, label %68, label %55

55:                                               ; preds = %51
  switch i32 %52, label %59 [
    i32 32, label %56
    i32 10, label %56
  ]

56:                                               ; preds = %55, %55
  %57 = sext i32 %.0132173 to i64
  %58 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 %57
  store i8 0, ptr %58, align 1, !tbaa !9
  br label %.critedge154

59:                                               ; preds = %55
  %isdigittmp147 = add i32 %52, -48
  %isdigit148 = icmp ult i32 %isdigittmp147, 10
  br i1 %isdigit148, label %63, label %60

60:                                               ; preds = %59
  %61 = load ptr, ptr @stderr, align 8, !tbaa !5
  %62 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef nonnull @.str.53, i32 noundef %52, ptr noundef %1) #7
  br label %164

63:                                               ; preds = %59
  %64 = trunc nuw i32 %52 to i8
  %65 = add nsw i32 %.0132173, 1
  %66 = sext i32 %.0132173 to i64
  %67 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 %66
  store i8 %64, ptr %67, align 1, !tbaa !9
  br label %68

68:                                               ; preds = %51, %63
  %.1133 = phi i32 [ 0, %51 ], [ %65, %63 ]
  %69 = add nuw nsw i32 %.0137172, 1
  %exitcond193.not = icmp eq i32 %69, 256
  br i1 %exitcond193.not, label %.critedge154, label %51, !llvm.loop !12

.critedge154:                                     ; preds = %68, %56
  %.0132164 = phi i32 [ %.0132173, %56 ], [ %.1133, %68 ]
  %70 = icmp eq i32 %.0132164, 0
  %71 = icmp sgt i32 %.0132164, 128
  %or.cond14 = or i1 %70, %71
  br i1 %or.cond14, label %72, label %75

72:                                               ; preds = %.critedge154
  %73 = load ptr, ptr @stderr, align 8, !tbaa !5
  %74 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %73, ptr noundef nonnull @.str.54, ptr noundef %1) #7
  br label %164

75:                                               ; preds = %.critedge154
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %5) #8
  br label %76

76:                                               ; preds = %75, %96
  %.0134175 = phi i32 [ 0, %75 ], [ %97, %96 ]
  %.0135174 = phi i32 [ 0, %75 ], [ %.1136, %96 ]
  %77 = tail call i32 @fgetc(ptr noundef nonnull %6)
  %78 = icmp eq i32 %77, 32
  %79 = icmp eq i32 %.0135174, 0
  %or.cond16 = select i1 %78, i1 %79, i1 false
  br i1 %or.cond16, label %96, label %80

80:                                               ; preds = %76
  switch i32 %77, label %84 [
    i32 32, label %81
    i32 10, label %81
  ]

81:                                               ; preds = %80, %80
  %82 = sext i32 %.0135174 to i64
  %83 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 %82
  store i8 0, ptr %83, align 1, !tbaa !9
  br label %.critedge156

84:                                               ; preds = %80
  %85 = add i32 %77, -58
  %isdigit150 = icmp ult i32 %85, -10
  %86 = add i32 %77, -47
  %87 = icmp ult i32 %86, -2
  %or.cond22 = and i1 %isdigit150, %87
  br i1 %or.cond22, label %88, label %91

88:                                               ; preds = %84
  %89 = load ptr, ptr @stderr, align 8, !tbaa !5
  %90 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef nonnull @.str.60, i32 noundef %77, ptr noundef %1) #7
  br label %163

91:                                               ; preds = %84
  %92 = trunc nuw i32 %77 to i8
  %93 = add nsw i32 %.0135174, 1
  %94 = sext i32 %.0135174 to i64
  %95 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 %94
  store i8 %92, ptr %95, align 1, !tbaa !9
  br label %96

96:                                               ; preds = %76, %91
  %.1136 = phi i32 [ 0, %76 ], [ %93, %91 ]
  %97 = add nuw nsw i32 %.0134175, 1
  %exitcond194.not = icmp eq i32 %97, 256
  br i1 %exitcond194.not, label %.critedge156, label %76, !llvm.loop !13

.critedge156:                                     ; preds = %96, %81
  %.0135160 = phi i32 [ %.0135174, %81 ], [ %.1136, %96 ]
  %98 = icmp eq i32 %.0135160, 0
  %99 = icmp sgt i32 %.0135160, 128
  %or.cond24 = or i1 %98, %99
  br i1 %or.cond24, label %100, label %103

100:                                              ; preds = %.critedge156
  %101 = load ptr, ptr @stderr, align 8, !tbaa !5
  %102 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %101, ptr noundef nonnull @.str.61, ptr noundef %1) #7
  br label %163

103:                                              ; preds = %.critedge156
  %104 = call i32 @atoi(ptr nocapture noundef %3) #9
  %105 = call i32 @atoi(ptr nocapture noundef %4) #9
  %106 = call double @atof(ptr noundef %5) #9
  %107 = fptrunc double %106 to float
  %108 = fcmp oeq float %107, -9.990000e+02
  br i1 %108, label %109, label %112

109:                                              ; preds = %103
  %110 = load ptr, ptr @stderr, align 8, !tbaa !5
  %111 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %110, ptr noundef nonnull @.str.62) #7
  br label %112

112:                                              ; preds = %109, %103
  %113 = mul nsw i32 %105, %104
  %114 = sext i32 %113 to i64
  %115 = icmp slt i32 %113, 0
  %116 = shl nsw i64 %114, 2
  %117 = select i1 %115, i64 -1, i64 %116
  %118 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %117) #10
  %119 = icmp sgt i32 %113, 0
  br i1 %119, label %.lr.ph, label %._crit_edge

120:                                              ; preds = %.lr.ph
  %121 = sub nsw i32 %.0123176, %128
  %122 = icmp sgt i32 %121, 0
  br i1 %122, label %.lr.ph, label %._crit_edge, !llvm.loop !14

.lr.ph:                                           ; preds = %112, %120
  %.0123176 = phi i32 [ %121, %120 ], [ %113, %112 ]
  %123 = sub nsw i32 %113, %.0123176
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds float, ptr %118, i64 %124
  %126 = zext nneg i32 %.0123176 to i64
  %127 = tail call i64 @fread(ptr noundef nonnull %125, i64 noundef 4, i64 noundef %126, ptr noundef nonnull %6)
  %128 = trunc i64 %127 to i32
  %129 = icmp sgt i32 %128, 0
  br i1 %129, label %120, label %.thread

.thread:                                          ; preds = %.lr.ph
  %130 = load ptr, ptr @stderr, align 8, !tbaa !5
  %131 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %130, ptr noundef nonnull @.str.46, ptr noundef %1) #7
  br label %163

._crit_edge:                                      ; preds = %120, %112
  %132 = getelementptr inbounds i8, ptr %0, i64 192
  store i32 %104, ptr %132, align 8, !tbaa !15
  %133 = getelementptr inbounds i8, ptr %0, i64 196
  store i32 %105, ptr %133, align 4, !tbaa !15
  %134 = getelementptr inbounds i8, ptr %0, i64 200
  store i32 %104, ptr %134, align 8, !tbaa !17
  %135 = getelementptr inbounds i8, ptr %0, i64 204
  store i32 %113, ptr %135, align 4, !tbaa !23
  %136 = getelementptr inbounds i8, ptr %0, i64 176
  store double 1.000000e+00, ptr %136, align 8, !tbaa !24
  %137 = getelementptr inbounds i8, ptr %0, i64 88
  %138 = tail call noundef nonnull align 8 dereferenceable(84) ptr @_ZN8R2AffineaSERKS_(ptr noundef nonnull align 8 dereferenceable(84) %137, ptr noundef nonnull align 8 dereferenceable(84) @R2identity_affine)
  %139 = tail call noundef nonnull align 8 dereferenceable(84) ptr @_ZN8R2AffineaSERKS_(ptr noundef nonnull align 8 dereferenceable(84) %0, ptr noundef nonnull align 8 dereferenceable(84) @R2identity_affine)
  %140 = getelementptr inbounds i8, ptr %0, i64 184
  %141 = load ptr, ptr %140, align 8, !tbaa !25
  %.not151 = icmp eq ptr %141, null
  br i1 %.not151, label %143, label %142

142:                                              ; preds = %._crit_edge
  tail call void @_ZdaPv(ptr noundef nonnull %141) #11
  br label %143

143:                                              ; preds = %142, %._crit_edge
  %144 = load i32, ptr %135, align 4, !tbaa !23
  %145 = sext i32 %144 to i64
  %146 = icmp slt i32 %144, 0
  %147 = shl nsw i64 %145, 3
  %148 = select i1 %146, i64 -1, i64 %147
  %149 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %148) #10
  store ptr %149, ptr %140, align 8, !tbaa !25
  %150 = icmp sgt i32 %144, 0
  br i1 %150, label %.lr.ph179, label %._crit_edge180

.lr.ph179:                                        ; preds = %143, %.lr.ph179
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph179 ], [ 0, %143 ]
  %151 = getelementptr inbounds float, ptr %118, i64 %indvars.iv
  %152 = load float, ptr %151, align 4, !tbaa !26
  %153 = fpext float %152 to double
  %154 = load double, ptr @RN_EPSILON, align 8, !tbaa !28
  %155 = tail call noundef i32 @_Z9RNIsEqualddd(double noundef %153, double noundef -3.210000e+02, double noundef %154)
  %.not152 = icmp eq i32 %155, 0
  %156 = load ptr, ptr %140, align 8, !tbaa !25
  %157 = getelementptr inbounds double, ptr %156, i64 %indvars.iv
  %. = select i1 %.not152, double %153, double -3.210000e+02
  store double %., ptr %157, align 8, !tbaa !28
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %158 = load i32, ptr %135, align 4, !tbaa !23
  %159 = sext i32 %158 to i64
  %160 = icmp slt i64 %indvars.iv.next, %159
  br i1 %160, label %.lr.ph179, label %._crit_edge180, !llvm.loop !29

._crit_edge180:                                   ; preds = %.lr.ph179, %143
  tail call void @_ZdaPv(ptr noundef nonnull %118) #11
  %161 = tail call i32 @fclose(ptr noundef nonnull %6)
  %162 = load i32, ptr %135, align 4, !tbaa !23
  br label %163

163:                                              ; preds = %.thread, %._crit_edge180, %88, %100
  %.7 = phi i32 [ 0, %100 ], [ 0, %88 ], [ %162, %._crit_edge180 ], [ 0, %.thread ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %5) #8
  br label %164

164:                                              ; preds = %60, %163, %72
  %.8 = phi i32 [ 0, %72 ], [ %.7, %163 ], [ 0, %60 ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #8
  br label %165

165:                                              ; preds = %35, %164, %47
  %.9 = phi i32 [ 0, %47 ], [ %.8, %164 ], [ 0, %35 ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %3) #8
  br label %166

166:                                              ; preds = %12, %17, %22, %165, %7
  %.11 = phi i32 [ 0, %7 ], [ 0, %12 ], [ 0, %17 ], [ 0, %22 ], [ %.9, %165 ]
  ret i32 %.11
}

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

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

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

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

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare double @atof(ptr nocapture noundef nonnull) local_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 = { 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 #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 = { cold nounwind }
attributes #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!18, !16, i64 200}
!18 = !{!"_ZTS6R2Grid", !19, i64 0, !19, i64 88, !22, i64 176, !6, i64 184, !7, i64 192, !16, i64 200, !16, i64 204}
!19 = !{!"_ZTS8R2Affine", !20, i64 0, !21, i64 8, !16, i64 80}
!20 = !{!"_ZTS16R2Transformation"}
!21 = !{!"_ZTS8R3Matrix", !7, i64 0}
!22 = !{!"double", !7, i64 0}
!23 = !{!18, !16, i64 204}
!24 = !{!18, !22, i64 176}
!25 = !{!18, !6, i64 184}
!26 = !{!27, !27, i64 0}
!27 = !{!"float", !7, i64 0}
!28 = !{!22, !22, i64 0}
!29 = distinct !{!29, !11}


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