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

; 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.R3Point = type { [3 x double] }
%class.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%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.51 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.99 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.109 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.110 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.111 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.112 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.113 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.114 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.115 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.116 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.117 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.118 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.119 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.120 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.121 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.122 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.123 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.124 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.125 = external hidden unnamed_addr constant [48 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6R3Grid28SetWorldToGridTransformationERK5R3Box(ptr noundef nonnull align 8 dereferenceable(592), ptr noundef nonnull align 8 dereferenceable(56)) #4 align 2

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

declare void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #2

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

; Function Attrs: nounwind
declare void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #6

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6R3Grid15ReadInsightFileEPKc(ptr noundef nonnull align 8 dereferenceable(592) %0, ptr noundef %1) #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [128 x i8], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca [3 x float], align 4
  %15 = alloca [3 x float], align 4
  %16 = alloca [3 x float], align 4
  %17 = alloca [3 x float], align 4
  %18 = alloca i32, align 4
  %19 = alloca [3 x i32], align 4
  %20 = alloca [3 x i32], 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
  %26 = alloca i32, align 4
  %27 = alloca float, align 4
  %28 = alloca i32, align 4
  %29 = alloca i8, align 1
  %30 = alloca %class.R3Point, align 8
  %31 = alloca %class.R3Point, align 8
  %32 = alloca %class.R3Box, align 8
  %33 = alloca ptr, align 8
  %34 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %35 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = call noalias ptr @fopen(ptr noundef %36, ptr noundef @.str.45)
  store ptr %37, ptr %6, align 8, !tbaa !5
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = icmp ne ptr %38, null
  br i1 %39, label %42, label %40

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

42:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = call i64 @fread(ptr noundef %8, i64 noundef 4, i64 noundef 1, ptr noundef %43)
  %45 = icmp ne i64 %44, 1
  br i1 %45, label %46, label %48

46:                                               ; preds = %42
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.110, ptr noundef %47)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %462

48:                                               ; preds = %42
  %49 = load i32, ptr %8, align 4, !tbaa !9
  %50 = icmp ne i32 %49, 60
  br i1 %50, label %51, label %54

51:                                               ; preds = %48
  %52 = load i32, ptr %8, align 4, !tbaa !9
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.111, i32 noundef %52, ptr noundef %53)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %462

54:                                               ; preds = %48
  br label %55

55:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 128, ptr %9) #7
  %56 = getelementptr inbounds [128 x i8], ptr %9, i64 0, i64 0
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = call i64 @fread(ptr noundef %56, i64 noundef 1, i64 noundef 60, ptr noundef %57)
  %59 = icmp ne i64 %58, 60
  br i1 %59, label %60, label %62

60:                                               ; preds = %55
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.112, ptr noundef %61)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %461

62:                                               ; preds = %55
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = call i64 @fread(ptr noundef %8, i64 noundef 4, i64 noundef 1, ptr noundef %63)
  %65 = icmp ne i64 %64, 1
  br i1 %65, label %66, label %68

66:                                               ; preds = %62
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.110, ptr noundef %67)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %461

68:                                               ; preds = %62
  %69 = load i32, ptr %8, align 4, !tbaa !9
  %70 = icmp ne i32 %69, 60
  br i1 %70, label %71, label %74

71:                                               ; preds = %68
  %72 = load i32, ptr %8, align 4, !tbaa !9
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.111, i32 noundef %72, ptr noundef %73)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %461

74:                                               ; preds = %68
  br label %75

75:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = call i64 @fread(ptr noundef %10, i64 noundef 4, i64 noundef 1, ptr noundef %76)
  %78 = icmp ne i64 %77, 1
  br i1 %78, label %79, label %81

79:                                               ; preds = %75
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.113, ptr noundef %80)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %460

81:                                               ; preds = %75
  %82 = load i32, ptr %10, align 4, !tbaa !9
  %83 = icmp ne i32 %82, 72
  br i1 %83, label %84, label %87

84:                                               ; preds = %81
  %85 = load i32, ptr %10, align 4, !tbaa !9
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.114, i32 noundef %85, ptr noundef %86)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %460

87:                                               ; preds = %81
  br label %88

88:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = call i64 @fread(ptr noundef %11, i64 noundef 4, i64 noundef 1, ptr noundef %89)
  %91 = icmp ne i64 %90, 1
  br i1 %91, label %92, label %93

92:                                               ; preds = %88
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.115)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %459

93:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = call i64 @fread(ptr noundef %12, i64 noundef 4, i64 noundef 1, ptr noundef %94)
  %96 = icmp ne i64 %95, 1
  br i1 %96, label %97, label %98

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

98:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = call i64 @fread(ptr noundef %13, i64 noundef 4, i64 noundef 1, ptr noundef %99)
  %101 = icmp ne i64 %100, 1
  br i1 %101, label %102, label %103

102:                                              ; preds = %98
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.117)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %457

103:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #7
  %104 = getelementptr inbounds [3 x float], ptr %14, i64 0, i64 0
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = call i64 @fread(ptr noundef %104, i64 noundef 4, i64 noundef 3, ptr noundef %105)
  %107 = icmp ne i64 %106, 3
  br i1 %107, label %108, label %109

108:                                              ; preds = %103
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.118)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %456

109:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #7
  %110 = getelementptr inbounds [3 x float], ptr %15, i64 0, i64 0
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = call i64 @fread(ptr noundef %110, i64 noundef 4, i64 noundef 3, ptr noundef %111)
  %113 = icmp ne i64 %112, 3
  br i1 %113, label %114, label %115

114:                                              ; preds = %109
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.119)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %455

115:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %116

116:                                              ; preds = %137, %115
  %117 = load i32, ptr %18, align 4, !tbaa !9
  %118 = icmp slt i32 %117, 3
  br i1 %118, label %120, label %119

119:                                              ; preds = %116
  store i32 2, ptr %7, align 4
  br label %140

120:                                              ; preds = %116
  %121 = load i32, ptr %18, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [3 x float], ptr %16, i64 0, i64 %122
  %124 = load ptr, ptr %6, align 8, !tbaa !5
  %125 = call i64 @fread(ptr noundef %123, i64 noundef 4, i64 noundef 1, ptr noundef %124)
  %126 = icmp ne i64 %125, 1
  br i1 %126, label %127, label %128

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

128:                                              ; preds = %120
  %129 = load i32, ptr %18, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [3 x float], ptr %17, i64 0, i64 %130
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = call i64 @fread(ptr noundef %131, i64 noundef 4, i64 noundef 1, ptr noundef %132)
  %134 = icmp ne i64 %133, 1
  br i1 %134, label %135, label %136

135:                                              ; preds = %128
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.121)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %140

136:                                              ; preds = %128
  br label %137

137:                                              ; preds = %136
  %138 = load i32, ptr %18, align 4, !tbaa !9
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %18, align 4, !tbaa !9
  br label %116, !llvm.loop !11

140:                                              ; preds = %135, %127, %119
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  %141 = load i32, ptr %7, align 4
  switch i32 %141, label %454 [
    i32 2, label %142
  ]

142:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #7
  %143 = getelementptr inbounds [3 x i32], ptr %19, i64 0, i64 0
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  %145 = call i64 @fread(ptr noundef %143, i64 noundef 4, i64 noundef 3, ptr noundef %144)
  %146 = icmp ne i64 %145, 3
  br i1 %146, label %147, label %148

147:                                              ; preds = %142
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.122)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %453

148:                                              ; preds = %142
  %149 = load ptr, ptr %6, align 8, !tbaa !5
  %150 = call i64 @fread(ptr noundef %10, i64 noundef 4, i64 noundef 1, ptr noundef %149)
  %151 = icmp ne i64 %150, 1
  br i1 %151, label %152, label %154

152:                                              ; preds = %148
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.113, ptr noundef %153)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %453

154:                                              ; preds = %148
  %155 = load i32, ptr %10, align 4, !tbaa !9
  %156 = icmp ne i32 %155, 72
  br i1 %156, label %157, label %160

157:                                              ; preds = %154
  %158 = load i32, ptr %10, align 4, !tbaa !9
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.114, i32 noundef %158, ptr noundef %159)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %453

160:                                              ; preds = %154
  br label %161

161:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 12, ptr %20) #7
  %162 = getelementptr inbounds [3 x i32], ptr %19, i64 0, i64 0
  %163 = load i32, ptr %162, align 4, !tbaa !9
  %164 = add nsw i32 %163, 1
  %165 = getelementptr inbounds [3 x i32], ptr %20, i64 0, i64 0
  store i32 %164, ptr %165, align 4, !tbaa !9
  %166 = getelementptr inbounds [3 x i32], ptr %19, i64 0, i64 1
  %167 = load i32, ptr %166, align 4, !tbaa !9
  %168 = add nsw i32 %167, 1
  %169 = getelementptr inbounds [3 x i32], ptr %20, i64 0, i64 1
  store i32 %168, ptr %169, align 4, !tbaa !9
  %170 = getelementptr inbounds [3 x i32], ptr %19, i64 0, i64 2
  %171 = load i32, ptr %170, align 4, !tbaa !9
  %172 = add nsw i32 %171, 1
  %173 = getelementptr inbounds [3 x i32], ptr %20, i64 0, i64 2
  store i32 %172, ptr %173, align 4, !tbaa !9
  %174 = load i32, ptr %11, align 4, !tbaa !9
  %175 = icmp ne i32 %174, 0
  br i1 %175, label %194, label %176

176:                                              ; preds = %161
  %177 = load i32, ptr %12, align 4, !tbaa !9
  %178 = icmp ne i32 %177, 4
  br i1 %178, label %194, label %179

179:                                              ; preds = %176
  %180 = load i32, ptr %13, align 4, !tbaa !9
  %181 = icmp ne i32 %180, 0
  br i1 %181, label %194, label %182

182:                                              ; preds = %179
  %183 = getelementptr inbounds [3 x float], ptr %15, i64 0, i64 0
  %184 = load float, ptr %183, align 4, !tbaa !13
  %185 = fcmp une float %184, 9.000000e+01
  br i1 %185, label %194, label %186

186:                                              ; preds = %182
  %187 = getelementptr inbounds [3 x float], ptr %15, i64 0, i64 1
  %188 = load float, ptr %187, align 4, !tbaa !13
  %189 = fcmp une float %188, 9.000000e+01
  br i1 %189, label %194, label %190

190:                                              ; preds = %186
  %191 = getelementptr inbounds [3 x float], ptr %15, i64 0, i64 2
  %192 = load float, ptr %191, align 4, !tbaa !13
  %193 = fcmp une float %192, 9.000000e+01
  br i1 %193, label %194, label %207

194:                                              ; preds = %190, %186, %182, %179, %176, %161
  %195 = load i32, ptr %11, align 4, !tbaa !9
  %196 = load i32, ptr %12, align 4, !tbaa !9
  %197 = load i32, ptr %13, align 4, !tbaa !9
  %198 = getelementptr inbounds [3 x float], ptr %15, i64 0, i64 0
  %199 = load float, ptr %198, align 4, !tbaa !13
  %200 = fpext float %199 to double
  %201 = getelementptr inbounds [3 x float], ptr %15, i64 0, i64 1
  %202 = load float, ptr %201, align 4, !tbaa !13
  %203 = fpext float %202 to double
  %204 = getelementptr inbounds [3 x float], ptr %15, i64 0, i64 2
  %205 = load float, ptr %204, align 4, !tbaa !13
  %206 = fpext float %205 to double
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.123, i32 noundef %195, i32 noundef %196, i32 noundef %197, double noundef %200, double noundef %203, double noundef %206)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %452

207:                                              ; preds = %190
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %208 = getelementptr inbounds [3 x i32], ptr %20, i64 0, i64 0
  %209 = load i32, ptr %208, align 4, !tbaa !9
  %210 = getelementptr inbounds [3 x i32], ptr %20, i64 0, i64 1
  %211 = load i32, ptr %210, align 4, !tbaa !9
  %212 = mul nsw i32 %209, %211
  %213 = getelementptr inbounds [3 x i32], ptr %20, i64 0, i64 2
  %214 = load i32, ptr %213, align 4, !tbaa !9
  %215 = mul nsw i32 %212, %214
  store i32 %215, ptr %21, align 4, !tbaa !9
  %216 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 4
  %217 = load ptr, ptr %216, align 8, !tbaa !15
  %218 = icmp ne ptr %217, null
  br i1 %218, label %219, label %224

219:                                              ; preds = %207
  %220 = load i32, ptr %21, align 4, !tbaa !9
  %221 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 8
  %222 = load i32, ptr %221, align 4, !tbaa !23
  %223 = icmp sgt i32 %220, %222
  br i1 %223, label %224, label %248

224:                                              ; preds = %219, %207
  %225 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 4
  %226 = load ptr, ptr %225, align 8, !tbaa !15
  %227 = icmp ne ptr %226, null
  br i1 %227, label %228, label %234

228:                                              ; preds = %224
  %229 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 4
  %230 = load ptr, ptr %229, align 8, !tbaa !15
  %231 = icmp eq ptr %230, null
  br i1 %231, label %233, label %232

232:                                              ; preds = %228
  call void @_ZdaPv(ptr noundef %230) #8
  br label %233

233:                                              ; preds = %232, %228
  br label %234

234:                                              ; preds = %233, %224
  %235 = load i32, ptr %21, align 4, !tbaa !9
  %236 = sext i32 %235 to i64
  %237 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %236, i64 8)
  %238 = extractvalue { i64, i1 } %237, 1
  %239 = extractvalue { i64, i1 } %237, 0
  %240 = select i1 %238, i64 -1, i64 %239
  %241 = call noalias noundef nonnull ptr @_Znam(i64 noundef %240) #9
  %242 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 4
  store ptr %241, ptr %242, align 8, !tbaa !15
  %243 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 4
  %244 = load ptr, ptr %243, align 8, !tbaa !15
  %245 = icmp ne ptr %244, null
  br i1 %245, label %247, label %246

246:                                              ; preds = %234
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.10, i32 noundef 4140, ptr noundef @.str.2)
  br label %247

247:                                              ; preds = %246, %234
  br label %248

248:                                              ; preds = %247, %219
  %249 = getelementptr inbounds [3 x i32], ptr %20, i64 0, i64 0
  %250 = load i32, ptr %249, align 4, !tbaa !9
  %251 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 5
  %252 = getelementptr inbounds [3 x i32], ptr %251, i64 0, i64 0
  store i32 %250, ptr %252, align 8, !tbaa !9
  %253 = getelementptr inbounds [3 x i32], ptr %20, i64 0, i64 1
  %254 = load i32, ptr %253, align 4, !tbaa !9
  %255 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 5
  %256 = getelementptr inbounds [3 x i32], ptr %255, i64 0, i64 1
  store i32 %254, ptr %256, align 4, !tbaa !9
  %257 = getelementptr inbounds [3 x i32], ptr %20, i64 0, i64 2
  %258 = load i32, ptr %257, align 4, !tbaa !9
  %259 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 5
  %260 = getelementptr inbounds [3 x i32], ptr %259, i64 0, i64 2
  store i32 %258, ptr %260, align 8, !tbaa !9
  %261 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 5
  %262 = getelementptr inbounds [3 x i32], ptr %261, i64 0, i64 0
  %263 = load i32, ptr %262, align 8, !tbaa !9
  %264 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 6
  store i32 %263, ptr %264, align 4, !tbaa !24
  %265 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 6
  %266 = load i32, ptr %265, align 4, !tbaa !24
  %267 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 5
  %268 = getelementptr inbounds [3 x i32], ptr %267, i64 0, i64 1
  %269 = load i32, ptr %268, align 4, !tbaa !9
  %270 = mul nsw i32 %266, %269
  %271 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 7
  store i32 %270, ptr %271, align 8, !tbaa !25
  %272 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 7
  %273 = load i32, ptr %272, align 8, !tbaa !25
  %274 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 5
  %275 = getelementptr inbounds [3 x i32], ptr %274, i64 0, i64 2
  %276 = load i32, ptr %275, align 8, !tbaa !9
  %277 = mul nsw i32 %273, %276
  %278 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 8
  store i32 %277, ptr %278, align 4, !tbaa !23
  %279 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 8
  %280 = load i32, ptr %279, align 4, !tbaa !23
  %281 = icmp sle i32 %280, 0
  br i1 %281, label %282, label %285

282:                                              ; preds = %248
  %283 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 8
  %284 = load i32, ptr %283, align 4, !tbaa !23
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.49, i32 noundef %284)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %451

285:                                              ; preds = %248
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %286 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 4
  %287 = load ptr, ptr %286, align 8, !tbaa !15
  store ptr %287, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %288

288:                                              ; preds = %381, %285
  %289 = load i32, ptr %23, align 4, !tbaa !9
  %290 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 5
  %291 = getelementptr inbounds [3 x i32], ptr %290, i64 0, i64 2
  %292 = load i32, ptr %291, align 8, !tbaa !9
  %293 = icmp slt i32 %289, %292
  br i1 %293, label %295, label %294

294:                                              ; preds = %288
  store i32 5, ptr %7, align 4
  br label %384

295:                                              ; preds = %288
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %296

296:                                              ; preds = %375, %295
  %297 = load i32, ptr %24, align 4, !tbaa !9
  %298 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 5
  %299 = getelementptr inbounds [3 x i32], ptr %298, i64 0, i64 1
  %300 = load i32, ptr %299, align 4, !tbaa !9
  %301 = icmp slt i32 %297, %300
  br i1 %301, label %303, label %302

302:                                              ; preds = %296
  store i32 8, ptr %7, align 4
  br label %378

303:                                              ; preds = %296
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %304 = load ptr, ptr %6, align 8, !tbaa !5
  %305 = call i64 @fread(ptr noundef %25, i64 noundef 4, i64 noundef 1, ptr noundef %304)
  %306 = icmp ne i64 %305, 1
  br i1 %306, label %307, label %309

307:                                              ; preds = %303
  %308 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.124, ptr noundef %308)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %372

309:                                              ; preds = %303
  %310 = load i32, ptr %25, align 4, !tbaa !9
  %311 = zext i32 %310 to i64
  %312 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 5
  %313 = getelementptr inbounds [3 x i32], ptr %312, i64 0, i64 0
  %314 = load i32, ptr %313, align 8, !tbaa !9
  %315 = sext i32 %314 to i64
  %316 = mul i64 %315, 4
  %317 = icmp ne i64 %311, %316
  br i1 %317, label %318, label %321

318:                                              ; preds = %309
  %319 = load i32, ptr %25, align 4, !tbaa !9
  %320 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.125, i32 noundef %319, ptr noundef %320)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %372

321:                                              ; preds = %309
  br label %322

322:                                              ; preds = %321
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 0, ptr %26, align 4, !tbaa !9
  br label %323

323:                                              ; preds = %347, %322
  %324 = load i32, ptr %26, align 4, !tbaa !9
  %325 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 5
  %326 = getelementptr inbounds [3 x i32], ptr %325, i64 0, i64 0
  %327 = load i32, ptr %326, align 8, !tbaa !9
  %328 = icmp slt i32 %324, %327
  br i1 %328, label %330, label %329

329:                                              ; preds = %323
  store i32 11, ptr %7, align 4
  br label %350

330:                                              ; preds = %323
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  %331 = load ptr, ptr %6, align 8, !tbaa !5
  %332 = call i64 @fread(ptr noundef %27, i64 noundef 4, i64 noundef 1, ptr noundef %331)
  %333 = icmp ne i64 %332, 1
  br i1 %333, label %334, label %338

334:                                              ; preds = %330
  %335 = load i32, ptr %26, align 4, !tbaa !9
  %336 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 8
  %337 = load i32, ptr %336, align 4, !tbaa !23
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.51, i32 noundef %335, i32 noundef %337)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %344

338:                                              ; preds = %330
  %339 = load float, ptr %27, align 4, !tbaa !13
  %340 = fpext float %339 to double
  %341 = load ptr, ptr %22, align 8, !tbaa !5
  %342 = getelementptr inbounds double, ptr %341, i32 1
  store ptr %342, ptr %22, align 8, !tbaa !5
  store double %340, ptr %341, align 8, !tbaa !26
  br label %343

343:                                              ; preds = %338
  store i32 0, ptr %7, align 4
  br label %344

344:                                              ; preds = %343, %334
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  %345 = load i32, ptr %7, align 4
  switch i32 %345, label %350 [
    i32 0, label %346
  ]

346:                                              ; preds = %344
  br label %347

347:                                              ; preds = %346
  %348 = load i32, ptr %26, align 4, !tbaa !9
  %349 = add nsw i32 %348, 1
  store i32 %349, ptr %26, align 4, !tbaa !9
  br label %323, !llvm.loop !27

350:                                              ; preds = %344, %329
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  %351 = load i32, ptr %7, align 4
  switch i32 %351, label %372 [
    i32 11, label %352
  ]

352:                                              ; preds = %350
  %353 = load ptr, ptr %6, align 8, !tbaa !5
  %354 = call i64 @fread(ptr noundef %25, i64 noundef 4, i64 noundef 1, ptr noundef %353)
  %355 = icmp ne i64 %354, 1
  br i1 %355, label %356, label %358

356:                                              ; preds = %352
  %357 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.124, ptr noundef %357)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %372

358:                                              ; preds = %352
  %359 = load i32, ptr %25, align 4, !tbaa !9
  %360 = zext i32 %359 to i64
  %361 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 5
  %362 = getelementptr inbounds [3 x i32], ptr %361, i64 0, i64 0
  %363 = load i32, ptr %362, align 8, !tbaa !9
  %364 = sext i32 %363 to i64
  %365 = mul i64 %364, 4
  %366 = icmp ne i64 %360, %365
  br i1 %366, label %367, label %370

367:                                              ; preds = %358
  %368 = load i32, ptr %25, align 4, !tbaa !9
  %369 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.125, i32 noundef %368, ptr noundef %369)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %372

370:                                              ; preds = %358
  br label %371

371:                                              ; preds = %370
  store i32 0, ptr %7, align 4
  br label %372

372:                                              ; preds = %371, %367, %356, %350, %318, %307
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  %373 = load i32, ptr %7, align 4
  switch i32 %373, label %378 [
    i32 0, label %374
  ]

374:                                              ; preds = %372
  br label %375

375:                                              ; preds = %374
  %376 = load i32, ptr %24, align 4, !tbaa !9
  %377 = add nsw i32 %376, 1
  store i32 %377, ptr %24, align 4, !tbaa !9
  br label %296, !llvm.loop !28

378:                                              ; preds = %372, %302
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  %379 = load i32, ptr %7, align 4
  switch i32 %379, label %384 [
    i32 8, label %380
  ]

380:                                              ; preds = %378
  br label %381

381:                                              ; preds = %380
  %382 = load i32, ptr %23, align 4, !tbaa !9
  %383 = add nsw i32 %382, 1
  store i32 %383, ptr %23, align 4, !tbaa !9
  br label %288, !llvm.loop !29

384:                                              ; preds = %378, %294
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  %385 = load i32, ptr %7, align 4
  switch i32 %385, label %450 [
    i32 5, label %386
  ]

386:                                              ; preds = %384
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  store i32 0, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %29) #7
  br label %387

387:                                              ; preds = %391, %386
  %388 = load ptr, ptr %6, align 8, !tbaa !5
  %389 = call i64 @fread(ptr noundef %29, i64 noundef 1, i64 noundef 1, ptr noundef %388)
  %390 = icmp eq i64 %389, 1
  br i1 %390, label %391, label %394

391:                                              ; preds = %387
  %392 = load i32, ptr %28, align 4, !tbaa !9
  %393 = add nsw i32 %392, 1
  store i32 %393, ptr %28, align 4, !tbaa !9
  br label %387, !llvm.loop !30

394:                                              ; preds = %387
  %395 = load i32, ptr %28, align 4, !tbaa !9
  %396 = icmp ne i32 %395, 0
  br i1 %396, label %397, label %402

397:                                              ; preds = %394
  %398 = load ptr, ptr @stderr, align 8, !tbaa !5
  %399 = load i32, ptr %28, align 4, !tbaa !9
  %400 = load ptr, ptr %5, align 8, !tbaa !5
  %401 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %398, ptr noundef @.str.99, i32 noundef %399, ptr noundef %400) #7
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %449

402:                                              ; preds = %394
  call void @llvm.lifetime.start.p0(i64 24, ptr %30) #7
  %403 = getelementptr inbounds [3 x float], ptr %16, i64 0, i64 0
  %404 = load float, ptr %403, align 4, !tbaa !13
  %405 = getelementptr inbounds [3 x float], ptr %14, i64 0, i64 0
  %406 = load float, ptr %405, align 4, !tbaa !13
  %407 = fmul float %404, %406
  %408 = fpext float %407 to double
  %409 = getelementptr inbounds [3 x float], ptr %16, i64 0, i64 1
  %410 = load float, ptr %409, align 4, !tbaa !13
  %411 = getelementptr inbounds [3 x float], ptr %14, i64 0, i64 1
  %412 = load float, ptr %411, align 4, !tbaa !13
  %413 = fmul float %410, %412
  %414 = fpext float %413 to double
  %415 = getelementptr inbounds [3 x float], ptr %16, i64 0, i64 2
  %416 = load float, ptr %415, align 4, !tbaa !13
  %417 = getelementptr inbounds [3 x float], ptr %14, i64 0, i64 2
  %418 = load float, ptr %417, align 4, !tbaa !13
  %419 = fmul float %416, %418
  %420 = fpext float %419 to double
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %30, double noundef %408, double noundef %414, double noundef %420)
  call void @llvm.lifetime.start.p0(i64 24, ptr %31) #7
  %421 = getelementptr inbounds [3 x float], ptr %17, i64 0, i64 0
  %422 = load float, ptr %421, align 4, !tbaa !13
  %423 = getelementptr inbounds [3 x float], ptr %14, i64 0, i64 0
  %424 = load float, ptr %423, align 4, !tbaa !13
  %425 = fmul float %422, %424
  %426 = fpext float %425 to double
  %427 = getelementptr inbounds [3 x float], ptr %17, i64 0, i64 1
  %428 = load float, ptr %427, align 4, !tbaa !13
  %429 = getelementptr inbounds [3 x float], ptr %14, i64 0, i64 1
  %430 = load float, ptr %429, align 4, !tbaa !13
  %431 = fmul float %428, %430
  %432 = fpext float %431 to double
  %433 = getelementptr inbounds [3 x float], ptr %17, i64 0, i64 2
  %434 = load float, ptr %433, align 4, !tbaa !13
  %435 = getelementptr inbounds [3 x float], ptr %14, i64 0, i64 2
  %436 = load float, ptr %435, align 4, !tbaa !13
  %437 = fmul float %434, %436
  %438 = fpext float %437 to double
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %31, double noundef %426, double noundef %432, double noundef %438)
  call void @llvm.lifetime.start.p0(i64 56, ptr %32) #7
  call void @_ZN5R3BoxC1ERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(56) %32, ptr noundef nonnull align 8 dereferenceable(24) %30, ptr noundef nonnull align 8 dereferenceable(24) %31)
  invoke void @_ZN6R3Grid28SetWorldToGridTransformationERK5R3Box(ptr noundef nonnull align 8 dereferenceable(592) %35, ptr noundef nonnull align 8 dereferenceable(56) %32)
          to label %439 unwind label %445

439:                                              ; preds = %402
  %440 = load ptr, ptr %6, align 8, !tbaa !5
  %441 = invoke i32 @fclose(ptr noundef %440)
          to label %442 unwind label %445

442:                                              ; preds = %439
  %443 = getelementptr inbounds %class.R3Grid, ptr %35, i32 0, i32 8
  %444 = load i32, ptr %443, align 4, !tbaa !23
  store i32 %444, ptr %3, align 4
  store i32 1, ptr %7, align 4
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %32) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #7
  br label %449

445:                                              ; preds = %439, %402
  %446 = landingpad { ptr, i32 }
          cleanup
  %447 = extractvalue { ptr, i32 } %446, 0
  store ptr %447, ptr %33, align 8
  %448 = extractvalue { ptr, i32 } %446, 1
  store i32 %448, ptr %34, align 4
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %32) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %465

449:                                              ; preds = %442, %397
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  br label %450

450:                                              ; preds = %449, %384
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %451

451:                                              ; preds = %450, %282
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %452

452:                                              ; preds = %451, %194
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #7
  br label %453

453:                                              ; preds = %452, %157, %152, %147
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #7
  br label %454

454:                                              ; preds = %453, %140
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #7
  br label %455

455:                                              ; preds = %454, %114
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #7
  br label %456

456:                                              ; preds = %455, %108
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #7
  br label %457

457:                                              ; preds = %456, %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %458

458:                                              ; preds = %457, %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %459

459:                                              ; preds = %458, %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %460

460:                                              ; preds = %459, %84, %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %461

461:                                              ; preds = %460, %71, %66, %60
  call void @llvm.lifetime.end.p0(i64 128, ptr %9) #7
  br label %462

462:                                              ; preds = %461, %51, %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %463

463:                                              ; preds = %462, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %464 = load i32, ptr %3, align 4
  ret i32 %464

465:                                              ; preds = %445
  %466 = load ptr, ptr %33, align 8
  %467 = load i32, ptr %34, align 4
  %468 = insertvalue { ptr, i32 } poison, ptr %466, 0
  %469 = insertvalue { ptr, i32 } %468, i32 %467, 1
  resume { ptr, i32 } %469
}

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

declare void @_ZN5R3BoxC1ERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!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, !10, i64 580, !10, i64 584, !10, 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 = !{!16, !10, i64 588}
!24 = !{!16, !10, i64 580}
!25 = !{!16, !10, i64 584}
!26 = !{!22, !22, i64 0}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !12}
!29 = distinct !{!29, !12}
!30 = distinct !{!30, !12}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.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.51 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.99 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.109 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.110 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.111 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.112 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.113 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.114 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.115 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.116 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.117 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.118 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.119 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.120 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.121 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.122 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.123 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.124 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.125 = external hidden unnamed_addr constant [48 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6R3Grid28SetWorldToGridTransformationERK5R3Box(ptr noundef nonnull align 8 dereferenceable(592), ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #2 align 2

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

declare void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #4

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

; Function Attrs: nounwind
declare void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #6

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6R3Grid15ReadInsightFileEPKc(ptr noundef nonnull align 8 dereferenceable(592) %0, ptr noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca [128 x i8], align 16
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [3 x float], align 4
  %10 = alloca [3 x float], align 4
  %11 = alloca [3 x float], align 4
  %12 = alloca [3 x float], align 4
  %13 = alloca [3 x i32], align 4
  %14 = alloca i32, align 4
  %15 = alloca float, align 4
  %16 = alloca i8, align 1
  %17 = alloca %class.R3Point, align 8
  %18 = alloca %class.R3Point, align 8
  %19 = alloca %class.R3Box, align 8
  %20 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str.45)
  %.not = icmp eq ptr %20, null
  br i1 %.not, label %21, label %22

21:                                               ; preds = %2
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.109, ptr noundef %1)
  br label %220

22:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %23 = call i64 @fread(ptr noundef nonnull %3, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %20)
  %.not105 = icmp eq i64 %23, 1
  br i1 %.not105, label %25, label %24

24:                                               ; preds = %22
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.110, ptr noundef %1)
  br label %219

25:                                               ; preds = %22
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %.not106 = icmp eq i32 %26, 60
  br i1 %.not106, label %28, label %27

27:                                               ; preds = %25
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.111, i32 noundef %26, ptr noundef %1)
  br label %219

28:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %4) #7
  %29 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 1, i64 noundef 60, ptr noundef nonnull %20)
  %.not107 = icmp eq i64 %29, 60
  br i1 %.not107, label %31, label %30

30:                                               ; preds = %28
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.112, ptr noundef %1)
  br label %218

31:                                               ; preds = %28
  %32 = call i64 @fread(ptr noundef nonnull %3, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %20)
  %.not108 = icmp eq i64 %32, 1
  br i1 %.not108, label %34, label %33

33:                                               ; preds = %31
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.110, ptr noundef %1)
  br label %218

34:                                               ; preds = %31
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %.not109 = icmp eq i32 %35, 60
  br i1 %.not109, label %37, label %36

36:                                               ; preds = %34
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.111, i32 noundef %35, ptr noundef %1)
  br label %218

37:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %38 = call i64 @fread(ptr noundef nonnull %5, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %20)
  %.not110 = icmp eq i64 %38, 1
  br i1 %.not110, label %40, label %39

39:                                               ; preds = %37
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.113, ptr noundef %1)
  br label %217

40:                                               ; preds = %37
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %.not111 = icmp eq i32 %41, 72
  br i1 %.not111, label %43, label %42

42:                                               ; preds = %40
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.114, i32 noundef %41, ptr noundef %1)
  br label %217

43:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %44 = call i64 @fread(ptr noundef nonnull %6, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %20)
  %.not112 = icmp eq i64 %44, 1
  br i1 %.not112, label %46, label %45

45:                                               ; preds = %43
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.115)
  br label %216

46:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %47 = call i64 @fread(ptr noundef nonnull %7, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %20)
  %.not113 = icmp eq i64 %47, 1
  br i1 %.not113, label %49, label %48

48:                                               ; preds = %46
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.116)
  br label %215

49:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  %50 = call i64 @fread(ptr noundef nonnull %8, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %20)
  %.not114 = icmp eq i64 %50, 1
  br i1 %.not114, label %52, label %51

51:                                               ; preds = %49
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.117)
  br label %214

52:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #7
  %53 = call i64 @fread(ptr noundef nonnull %9, i64 noundef 4, i64 noundef 3, ptr noundef nonnull %20)
  %.not115 = icmp eq i64 %53, 3
  br i1 %.not115, label %55, label %54

54:                                               ; preds = %52
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.118)
  br label %213

55:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #7
  %56 = call i64 @fread(ptr noundef nonnull %10, i64 noundef 4, i64 noundef 3, ptr noundef nonnull %20)
  %.not116 = icmp eq i64 %56, 3
  br i1 %.not116, label %58, label %57

57:                                               ; preds = %55
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.119)
  br label %212

58:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #7
  %59 = call i64 @fread(ptr noundef nonnull %11, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %20)
  %.not117 = icmp eq i64 %59, 1
  br i1 %.not117, label %74, label %73

60:                                               ; preds = %74
  %61 = getelementptr inbounds i8, ptr %11, i64 4
  %62 = call i64 @fread(ptr noundef nonnull %61, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %20)
  %.not117.1 = icmp eq i64 %62, 1
  br i1 %.not117.1, label %63, label %73

63:                                               ; preds = %60
  %64 = getelementptr inbounds i8, ptr %12, i64 4
  %65 = call i64 @fread(ptr noundef nonnull %64, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %20)
  %.not118.1 = icmp eq i64 %65, 1
  br i1 %.not118.1, label %66, label %76

66:                                               ; preds = %63
  %67 = getelementptr inbounds i8, ptr %11, i64 8
  %68 = call i64 @fread(ptr noundef nonnull %67, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %20)
  %.not117.2 = icmp eq i64 %68, 1
  br i1 %.not117.2, label %69, label %73

69:                                               ; preds = %66
  %70 = getelementptr inbounds i8, ptr %12, i64 8
  %71 = call i64 @fread(ptr noundef nonnull %70, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %20)
  %.not118.2 = icmp eq i64 %71, 1
  br i1 %.not118.2, label %.critedge, label %76

.critedge:                                        ; preds = %69
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #7
  %72 = call i64 @fread(ptr noundef nonnull %13, i64 noundef 4, i64 noundef 3, ptr noundef nonnull %20)
  %.not119 = icmp eq i64 %72, 3
  br i1 %.not119, label %78, label %77

73:                                               ; preds = %66, %60, %58
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.120)
  br label %211

74:                                               ; preds = %58
  %75 = call i64 @fread(ptr noundef nonnull %12, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %20)
  %.not118 = icmp eq i64 %75, 1
  br i1 %.not118, label %60, label %76

76:                                               ; preds = %69, %63, %74
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.121)
  br label %211

77:                                               ; preds = %.critedge
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.122)
  br label %210

78:                                               ; preds = %.critedge
  %79 = call i64 @fread(ptr noundef nonnull %5, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %20)
  %.not120 = icmp eq i64 %79, 1
  br i1 %.not120, label %81, label %80

80:                                               ; preds = %78
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.113, ptr noundef %1)
  br label %210

81:                                               ; preds = %78
  %82 = load i32, ptr %5, align 4, !tbaa !5
  %.not121 = icmp eq i32 %82, 72
  br i1 %.not121, label %84, label %83

83:                                               ; preds = %81
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.114, i32 noundef %82, ptr noundef %1)
  br label %210

84:                                               ; preds = %81
  %85 = load i32, ptr %13, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  %87 = getelementptr inbounds i8, ptr %13, i64 4
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  %90 = getelementptr inbounds i8, ptr %13, i64 8
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = icmp ne i32 %93, 0
  %95 = load i32, ptr %7, align 4
  %96 = icmp ne i32 %95, 4
  %or.cond = select i1 %94, i1 true, i1 %96
  %97 = load i32, ptr %8, align 4
  %98 = icmp ne i32 %97, 0
  %or.cond8 = select i1 %or.cond, i1 true, i1 %98
  %99 = load float, ptr %10, align 4
  %100 = fcmp une float %99, 9.000000e+01
  %or.cond11 = select i1 %or.cond8, i1 true, i1 %100
  %101 = getelementptr inbounds i8, ptr %10, i64 4
  %102 = load float, ptr %101, align 4
  %103 = fcmp une float %102, 9.000000e+01
  %or.cond14 = select i1 %or.cond11, i1 true, i1 %103
  %104 = getelementptr inbounds i8, ptr %10, i64 8
  %105 = load float, ptr %104, align 4
  %106 = fcmp une float %105, 9.000000e+01
  %or.cond17 = select i1 %or.cond14, i1 true, i1 %106
  br i1 %or.cond17, label %107, label %111

107:                                              ; preds = %84
  %108 = fpext float %99 to double
  %109 = fpext float %102 to double
  %110 = fpext float %105 to double
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.123, i32 noundef %93, i32 noundef %95, i32 noundef %97, double noundef %108, double noundef %109, double noundef %110)
  br label %210

111:                                              ; preds = %84
  %112 = mul nsw i32 %89, %86
  %113 = mul nsw i32 %112, %92
  %114 = getelementptr inbounds i8, ptr %0, i64 560
  %115 = load ptr, ptr %114, align 8, !tbaa !9
  %.not122 = icmp eq ptr %115, null
  %116 = getelementptr inbounds i8, ptr %0, i64 588
  %117 = load i32, ptr %116, align 4
  %118 = icmp sgt i32 %113, %117
  %or.cond135 = select i1 %.not122, i1 true, i1 %118
  br i1 %or.cond135, label %119, label %127

119:                                              ; preds = %111
  br i1 %.not122, label %121, label %120

120:                                              ; preds = %119
  tail call void @_ZdaPv(ptr noundef nonnull %115) #8
  br label %121

121:                                              ; preds = %120, %119
  %122 = sext i32 %113 to i64
  %123 = icmp slt i32 %113, 0
  %124 = shl nsw i64 %122, 3
  %125 = select i1 %123, i64 -1, i64 %124
  %126 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %125) #9
  store ptr %126, ptr %114, align 8, !tbaa !9
  br label %127

127:                                              ; preds = %111, %121
  %128 = phi ptr [ %115, %111 ], [ %126, %121 ]
  %129 = getelementptr inbounds i8, ptr %0, i64 568
  store i32 %86, ptr %129, align 8, !tbaa !5
  %130 = getelementptr inbounds i8, ptr %0, i64 572
  store i32 %89, ptr %130, align 4, !tbaa !5
  %131 = getelementptr inbounds i8, ptr %0, i64 576
  store i32 %92, ptr %131, align 8, !tbaa !5
  %132 = getelementptr inbounds i8, ptr %0, i64 580
  store i32 %86, ptr %132, align 4, !tbaa !18
  %133 = getelementptr inbounds i8, ptr %0, i64 584
  store i32 %112, ptr %133, align 8, !tbaa !19
  store i32 %113, ptr %116, align 4, !tbaa !20
  %134 = icmp slt i32 %113, 1
  br i1 %134, label %135, label %136

135:                                              ; preds = %127
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.49, i32 noundef %113)
  br label %210

136:                                              ; preds = %127
  %.not130174 = icmp sgt i32 %91, -1
  %137 = icmp sgt i32 %88, -1
  %or.cond200 = select i1 %.not130174, i1 %137, i1 false
  br i1 %or.cond200, label %.preheader151, label %.critedge137

.preheader151:                                    ; preds = %136, %.thread145
  %138 = phi i32 [ %169, %.thread145 ], [ %92, %136 ]
  %139 = phi i32 [ %170, %.thread145 ], [ %89, %136 ]
  %.090176 = phi i32 [ %171, %.thread145 ], [ 0, %136 ]
  %.091175 = phi ptr [ %.192.lcssa, %.thread145 ], [ %128, %136 ]
  %.not131169 = icmp sgt i32 %139, 0
  br i1 %.not131169, label %.lr.ph172, label %.thread145

.lr.ph172:                                        ; preds = %.preheader151, %166
  %.089171 = phi i32 [ %167, %166 ], [ 0, %.preheader151 ]
  %.192170 = phi ptr [ %.293.lcssa, %166 ], [ %.091175, %.preheader151 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #7
  %140 = call i64 @fread(ptr noundef nonnull %14, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %20)
  %.not124 = icmp eq i64 %140, 1
  br i1 %.not124, label %142, label %141

141:                                              ; preds = %.lr.ph172
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.124, ptr noundef %1)
  br label %.thread149

142:                                              ; preds = %.lr.ph172
  %143 = load i32, ptr %14, align 4, !tbaa !5
  %144 = zext i32 %143 to i64
  %145 = load i32, ptr %129, align 8, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = shl nsw i64 %146, 2
  %.not125 = icmp eq i64 %147, %144
  br i1 %.not125, label %.preheader, label %148

.preheader:                                       ; preds = %142
  %.not127166 = icmp sgt i32 %145, 0
  br i1 %.not127166, label %.lr.ph, label %._crit_edge

148:                                              ; preds = %142
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.125, i32 noundef %143, ptr noundef %1)
  br label %.thread149

.lr.ph:                                           ; preds = %.preheader, %151
  %.088168 = phi i32 [ %155, %151 ], [ 0, %.preheader ]
  %.293167 = phi ptr [ %154, %151 ], [ %.192170, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #7
  %149 = call i64 @fread(ptr noundef nonnull %15, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %20)
  %.not126 = icmp eq i64 %149, 1
  br i1 %.not126, label %151, label %.thread140

.thread140:                                       ; preds = %.lr.ph
  %150 = load i32, ptr %116, align 4, !tbaa !20
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.51, i32 noundef %.088168, i32 noundef %150)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #7
  br label %.loopexit

151:                                              ; preds = %.lr.ph
  %152 = load float, ptr %15, align 4, !tbaa !21
  %153 = fpext float %152 to double
  %154 = getelementptr inbounds i8, ptr %.293167, i64 8
  store double %153, ptr %.293167, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #7
  %155 = add nuw nsw i32 %.088168, 1
  %156 = load i32, ptr %129, align 8, !tbaa !5
  %.not127 = icmp slt i32 %155, %156
  br i1 %.not127, label %.lr.ph, label %._crit_edge, !llvm.loop !24

._crit_edge:                                      ; preds = %151, %.preheader
  %.293.lcssa = phi ptr [ %.192170, %.preheader ], [ %154, %151 ]
  %157 = call i64 @fread(ptr noundef nonnull %14, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %20)
  %.not128 = icmp eq i64 %157, 1
  br i1 %.not128, label %159, label %158

158:                                              ; preds = %._crit_edge
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.124, ptr noundef %1)
  br label %.loopexit

159:                                              ; preds = %._crit_edge
  %160 = load i32, ptr %14, align 4, !tbaa !5
  %161 = zext i32 %160 to i64
  %162 = load i32, ptr %129, align 8, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = shl nsw i64 %163, 2
  %.not129 = icmp eq i64 %164, %161
  br i1 %.not129, label %166, label %165

165:                                              ; preds = %159
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.125, i32 noundef %160, ptr noundef %1)
  br label %.loopexit

166:                                              ; preds = %159
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  %167 = add nuw nsw i32 %.089171, 1
  %168 = load i32, ptr %130, align 4, !tbaa !5
  %.not131 = icmp slt i32 %167, %168
  br i1 %.not131, label %.lr.ph172, label %.thread145.loopexit, !llvm.loop !26

.thread149:                                       ; preds = %141, %148
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  br label %210

.loopexit:                                        ; preds = %158, %165, %.thread140
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  br label %210

.thread145.loopexit:                              ; preds = %166
  %.pre = load i32, ptr %131, align 8, !tbaa !5
  br label %.thread145

.thread145:                                       ; preds = %.thread145.loopexit, %.preheader151
  %169 = phi i32 [ %138, %.preheader151 ], [ %.pre, %.thread145.loopexit ]
  %170 = phi i32 [ %139, %.preheader151 ], [ %168, %.thread145.loopexit ]
  %.192.lcssa = phi ptr [ %.091175, %.preheader151 ], [ %.293.lcssa, %.thread145.loopexit ]
  %171 = add nuw nsw i32 %.090176, 1
  %.not130 = icmp slt i32 %171, %169
  br i1 %.not130, label %.preheader151, label %.critedge137, !llvm.loop !27

.critedge137:                                     ; preds = %.thread145, %136
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %16) #7
  br label %172

172:                                              ; preds = %172, %.critedge137
  %.087 = phi i32 [ 0, %.critedge137 ], [ %175, %172 ]
  %173 = call i64 @fread(ptr noundef nonnull %16, i64 noundef 1, i64 noundef 1, ptr noundef nonnull %20)
  %174 = icmp eq i64 %173, 1
  %175 = add nuw nsw i32 %.087, 1
  br i1 %174, label %172, label %176, !llvm.loop !29

176:                                              ; preds = %172
  %.not132 = icmp eq i32 %.087, 0
  br i1 %.not132, label %180, label %177

177:                                              ; preds = %176
  %178 = load ptr, ptr @stderr, align 8, !tbaa !30
  %179 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %178, ptr noundef nonnull @.str.99, i32 noundef %.087, ptr noundef %1) #10
  br label %209

180:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %17) #7
  %181 = load float, ptr %11, align 4, !tbaa !21
  %182 = load float, ptr %9, align 4, !tbaa !21
  %183 = fmul float %181, %182
  %184 = fpext float %183 to double
  %185 = load float, ptr %61, align 4, !tbaa !21
  %186 = getelementptr inbounds i8, ptr %9, i64 4
  %187 = load float, ptr %186, align 4, !tbaa !21
  %188 = fmul float %185, %187
  %189 = fpext float %188 to double
  %190 = load float, ptr %67, align 4, !tbaa !21
  %191 = getelementptr inbounds i8, ptr %9, i64 8
  %192 = load float, ptr %191, align 4, !tbaa !21
  %193 = fmul float %190, %192
  %194 = fpext float %193 to double
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %17, double noundef %184, double noundef %189, double noundef %194)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %18) #7
  %195 = load float, ptr %12, align 4, !tbaa !21
  %196 = fmul float %182, %195
  %197 = fpext float %196 to double
  %198 = load float, ptr %64, align 4, !tbaa !21
  %199 = fmul float %187, %198
  %200 = fpext float %199 to double
  %201 = load float, ptr %70, align 4, !tbaa !21
  %202 = fmul float %192, %201
  %203 = fpext float %202 to double
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %18, double noundef %197, double noundef %200, double noundef %203)
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %19) #7
  call void @_ZN5R3BoxC1ERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(56) %19, ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(24) %18)
  invoke void @_ZN6R3Grid28SetWorldToGridTransformationERK5R3Box(ptr noundef nonnull align 8 dereferenceable(592) %0, ptr noundef nonnull align 8 dereferenceable(56) %19)
          to label %204 unwind label %207

204:                                              ; preds = %180
  %205 = call i32 @fclose(ptr noundef nonnull %20)
  %206 = load i32, ptr %116, align 4, !tbaa !20
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %19) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %19) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #7
  br label %209

207:                                              ; preds = %180
  %208 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %19) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %19) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  resume { ptr, i32 } %208

209:                                              ; preds = %204, %177
  %.9 = phi i32 [ 0, %177 ], [ %206, %204 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #7
  br label %210

210:                                              ; preds = %.thread149, %.loopexit, %107, %209, %135, %83, %80, %77
  %.13 = phi i32 [ 0, %77 ], [ 0, %80 ], [ 0, %83 ], [ 0, %107 ], [ 0, %135 ], [ %.9, %209 ], [ 0, %.loopexit ], [ 0, %.thread149 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #7
  br label %211

211:                                              ; preds = %73, %76, %210
  %.14 = phi i32 [ %.13, %210 ], [ 0, %76 ], [ 0, %73 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #7
  br label %212

212:                                              ; preds = %211, %57
  %.15 = phi i32 [ 0, %57 ], [ %.14, %211 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #7
  br label %213

213:                                              ; preds = %212, %54
  %.16 = phi i32 [ 0, %54 ], [ %.15, %212 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #7
  br label %214

214:                                              ; preds = %213, %51
  %.17 = phi i32 [ 0, %51 ], [ %.16, %213 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  br label %215

215:                                              ; preds = %214, %48
  %.18 = phi i32 [ 0, %48 ], [ %.17, %214 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br label %216

216:                                              ; preds = %215, %45
  %.19 = phi i32 [ 0, %45 ], [ %.18, %215 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  br label %217

217:                                              ; preds = %216, %42, %39
  %.20 = phi i32 [ 0, %39 ], [ 0, %42 ], [ %.19, %216 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %218

218:                                              ; preds = %217, %36, %33, %30
  %.21 = phi i32 [ 0, %30 ], [ 0, %33 ], [ 0, %36 ], [ %.20, %217 ]
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %4) #7
  br label %219

219:                                              ; preds = %218, %27, %24
  %.22 = phi i32 [ 0, %24 ], [ 0, %27 ], [ %.21, %218 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br label %220

220:                                              ; preds = %219, %21
  %.23 = phi i32 [ %.22, %219 ], [ 0, %21 ]
  ret i32 %.23
}

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

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

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

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

declare void @_ZN5R3BoxC1ERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4

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 = { 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 = { "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 = { 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 #6 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { builtin nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { cold 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !17, i64 560}
!10 = !{!"_ZTS6R3Grid", !11, i64 0, !11, i64 272, !16, i64 544, !16, i64 552, !17, i64 560, !7, i64 568, !6, i64 580, !6, i64 584, !6, i64 588}
!11 = !{!"_ZTS8R3Affine", !12, i64 0, !13, i64 8, !13, i64 136, !14, i64 264}
!12 = !{!"_ZTS16R3Transformation"}
!13 = !{!"_ZTS8R4Matrix", !7, i64 0}
!14 = !{!"_ZTS7RNFlags", !15, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!10, !6, i64 580}
!19 = !{!10, !6, i64 584}
!20 = !{!10, !6, i64 588}
!21 = !{!22, !22, i64 0}
!22 = !{!"float", !7, i64 0}
!23 = !{!16, !16, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}
!27 = distinct !{!27, !25, !28}
!28 = !{!"llvm.loop.unswitch.partial.disable"}
!29 = distinct !{!29, !25}
!30 = !{!17, !17, i64 0}


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