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

; 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.R3Vector = 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.49 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.126 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.127 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.128 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.129 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.130 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.131 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.132 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.133 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.134 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.135 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.136 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.137 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.138 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.139 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.140 = external hidden unnamed_addr constant [35 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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #6 align 2

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

declare void @_ZN8R3VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #6 align 2

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

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

declare void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6R3Grid10ReadDXFileEPKc(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 [1024 x i8], align 16
  %9 = alloca [3 x i32], align 4
  %10 = alloca %class.R3Point, align 8
  %11 = alloca [3 x %class.R3Vector], align 16
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca %class.R3Vector, align 8
  %17 = alloca %class.R3Box, align 8
  %18 = alloca %class.R3Point, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %21 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = call noalias ptr @fopen(ptr noundef %22, ptr noundef @.str.126)
  store ptr %23, ptr %6, align 8, !tbaa !5
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = icmp ne ptr %24, null
  br i1 %25, label %30, label %26

26:                                               ; preds = %2
  %27 = load ptr, ptr @stderr, align 8, !tbaa !5
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef @.str.127, ptr noundef %28) #8
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %281

30:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1024, ptr %8) #8
  br label %31

31:                                               ; preds = %41, %30
  %32 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = call ptr @fgets(ptr noundef %32, i32 noundef 1024, ptr noundef %33)
  %35 = icmp ne ptr %34, null
  br i1 %35, label %40, label %36

36:                                               ; preds = %31
  %37 = load ptr, ptr @stderr, align 8, !tbaa !5
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef @.str.128, ptr noundef %38) #8
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %280

40:                                               ; preds = %31
  br label %41

41:                                               ; preds = %40
  %42 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %43 = load i8, ptr %42, align 16, !tbaa !9
  %44 = sext i8 %43 to i32
  %45 = icmp eq i32 %44, 35
  br i1 %45, label %31, label %46, !llvm.loop !10

46:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #8
  %47 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %48 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 0
  %49 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 1
  %50 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 2
  %51 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %47, ptr noundef @.str.129, ptr noundef %48, ptr noundef %49, ptr noundef %50) #8
  %52 = icmp ne i32 %51, 3
  br i1 %52, label %53, label %57

53:                                               ; preds = %46
  %54 = load ptr, ptr @stderr, align 8, !tbaa !5
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef @.str.130, ptr noundef %55) #8
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %279

57:                                               ; preds = %46
  %58 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = call ptr @fgets(ptr noundef %58, i32 noundef 1023, ptr noundef %59)
  %61 = icmp ne ptr %60, null
  br i1 %61, label %66, label %62

62:                                               ; preds = %57
  %63 = load ptr, ptr @stderr, align 8, !tbaa !5
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef @.str.131, ptr noundef %64) #8
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %279

66:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #8
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %10)
  %67 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %10, i32 noundef 0)
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %10, i32 noundef 1)
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %10, i32 noundef 2)
  %71 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %67, ptr noundef @.str.132, ptr noundef %68, ptr noundef %69, ptr noundef %70) #8
  %72 = icmp ne i32 %71, 3
  br i1 %72, label %73, label %77

73:                                               ; preds = %66
  %74 = load ptr, ptr @stderr, align 8, !tbaa !5
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef @.str.133, ptr noundef %75) #8
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %278

77:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 72, ptr %11) #8
  %78 = getelementptr inbounds [3 x %class.R3Vector], ptr %11, i32 0, i32 0
  %79 = getelementptr inbounds %class.R3Vector, ptr %78, i64 3
  br label %80

80:                                               ; preds = %80, %77
  %81 = phi ptr [ %78, %77 ], [ %82, %80 ]
  call void @_ZN8R3VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %81)
  %82 = getelementptr inbounds %class.R3Vector, ptr %81, i64 1
  %83 = icmp eq ptr %82, %79
  br i1 %83, label %84, label %80

84:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !12
  br label %85

85:                                               ; preds = %119, %84
  %86 = load i32, ptr %12, align 4, !tbaa !12
  %87 = icmp sle i32 %86, 2
  br i1 %87, label %89, label %88

88:                                               ; preds = %85
  store i32 4, ptr %7, align 4
  br label %122

89:                                               ; preds = %85
  %90 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = call ptr @fgets(ptr noundef %90, i32 noundef 1023, ptr noundef %91)
  %93 = icmp ne ptr %92, null
  br i1 %93, label %98, label %94

94:                                               ; preds = %89
  %95 = load ptr, ptr @stderr, align 8, !tbaa !5
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %95, ptr noundef @.str.134, ptr noundef %96) #8
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %122

98:                                               ; preds = %89
  %99 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %100 = load i32, ptr %12, align 4, !tbaa !12
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [3 x %class.R3Vector], ptr %11, i64 0, i64 %101
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %102, i32 noundef 0)
  %104 = load i32, ptr %12, align 4, !tbaa !12
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [3 x %class.R3Vector], ptr %11, i64 0, i64 %105
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %106, i32 noundef 1)
  %108 = load i32, ptr %12, align 4, !tbaa !12
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [3 x %class.R3Vector], ptr %11, i64 0, i64 %109
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %110, i32 noundef 2)
  %112 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %99, ptr noundef @.str.135, ptr noundef %103, ptr noundef %107, ptr noundef %111) #8
  %113 = icmp ne i32 %112, 3
  br i1 %113, label %114, label %118

114:                                              ; preds = %98
  %115 = load ptr, ptr @stderr, align 8, !tbaa !5
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %115, ptr noundef @.str.136, ptr noundef %116) #8
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %122

118:                                              ; preds = %98
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %12, align 4, !tbaa !12
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %12, align 4, !tbaa !12
  br label %85, !llvm.loop !14

122:                                              ; preds = %114, %94, %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  %123 = load i32, ptr %7, align 4
  switch i32 %123, label %277 [
    i32 4, label %124
  ]

124:                                              ; preds = %122
  %125 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = call ptr @fgets(ptr noundef %125, i32 noundef 1023, ptr noundef %126)
  %128 = icmp ne ptr %127, null
  br i1 %128, label %133, label %129

129:                                              ; preds = %124
  %130 = load ptr, ptr @stderr, align 8, !tbaa !5
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %130, ptr noundef @.str.137, ptr noundef %131) #8
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %277

133:                                              ; preds = %124
  %134 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %135 = load ptr, ptr %6, align 8, !tbaa !5
  %136 = call ptr @fgets(ptr noundef %134, i32 noundef 1023, ptr noundef %135)
  %137 = icmp ne ptr %136, null
  br i1 %137, label %142, label %138

138:                                              ; preds = %133
  %139 = load ptr, ptr @stderr, align 8, !tbaa !5
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %139, ptr noundef @.str.138, ptr noundef %140) #8
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %277

142:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %143 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 0
  %144 = load i32, ptr %143, align 4, !tbaa !12
  %145 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 1
  %146 = load i32, ptr %145, align 4, !tbaa !12
  %147 = mul nsw i32 %144, %146
  %148 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 2
  %149 = load i32, ptr %148, align 4, !tbaa !12
  %150 = mul nsw i32 %147, %149
  store i32 %150, ptr %13, align 4, !tbaa !12
  %151 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 4
  %152 = load ptr, ptr %151, align 8, !tbaa !15
  %153 = icmp ne ptr %152, null
  br i1 %153, label %154, label %159

154:                                              ; preds = %142
  %155 = load i32, ptr %13, align 4, !tbaa !12
  %156 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 8
  %157 = load i32, ptr %156, align 4, !tbaa !23
  %158 = icmp sgt i32 %155, %157
  br i1 %158, label %159, label %183

159:                                              ; preds = %154, %142
  %160 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 4
  %161 = load ptr, ptr %160, align 8, !tbaa !15
  %162 = icmp ne ptr %161, null
  br i1 %162, label %163, label %169

163:                                              ; preds = %159
  %164 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 4
  %165 = load ptr, ptr %164, align 8, !tbaa !15
  %166 = icmp eq ptr %165, null
  br i1 %166, label %168, label %167

167:                                              ; preds = %163
  call void @_ZdaPv(ptr noundef %165) #9
  br label %168

168:                                              ; preds = %167, %163
  br label %169

169:                                              ; preds = %168, %159
  %170 = load i32, ptr %13, align 4, !tbaa !12
  %171 = sext i32 %170 to i64
  %172 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %171, i64 8)
  %173 = extractvalue { i64, i1 } %172, 1
  %174 = extractvalue { i64, i1 } %172, 0
  %175 = select i1 %173, i64 -1, i64 %174
  %176 = call noalias noundef nonnull ptr @_Znam(i64 noundef %175) #10
  %177 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 4
  store ptr %176, ptr %177, align 8, !tbaa !15
  %178 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 4
  %179 = load ptr, ptr %178, align 8, !tbaa !15
  %180 = icmp ne ptr %179, null
  br i1 %180, label %182, label %181

181:                                              ; preds = %169
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.10, i32 noundef 4291, ptr noundef @.str.2)
  br label %182

182:                                              ; preds = %181, %169
  br label %183

183:                                              ; preds = %182, %154
  %184 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 0
  %185 = load i32, ptr %184, align 4, !tbaa !12
  %186 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 5
  %187 = getelementptr inbounds [3 x i32], ptr %186, i64 0, i64 0
  store i32 %185, ptr %187, align 8, !tbaa !12
  %188 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 1
  %189 = load i32, ptr %188, align 4, !tbaa !12
  %190 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 5
  %191 = getelementptr inbounds [3 x i32], ptr %190, i64 0, i64 1
  store i32 %189, ptr %191, align 4, !tbaa !12
  %192 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 2
  %193 = load i32, ptr %192, align 4, !tbaa !12
  %194 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 5
  %195 = getelementptr inbounds [3 x i32], ptr %194, i64 0, i64 2
  store i32 %193, ptr %195, align 8, !tbaa !12
  %196 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 5
  %197 = getelementptr inbounds [3 x i32], ptr %196, i64 0, i64 0
  %198 = load i32, ptr %197, align 8, !tbaa !12
  %199 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 6
  store i32 %198, ptr %199, align 4, !tbaa !24
  %200 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 6
  %201 = load i32, ptr %200, align 4, !tbaa !24
  %202 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 5
  %203 = getelementptr inbounds [3 x i32], ptr %202, i64 0, i64 1
  %204 = load i32, ptr %203, align 4, !tbaa !12
  %205 = mul nsw i32 %201, %204
  %206 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 7
  store i32 %205, ptr %206, align 8, !tbaa !25
  %207 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 7
  %208 = load i32, ptr %207, align 8, !tbaa !25
  %209 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 5
  %210 = getelementptr inbounds [3 x i32], ptr %209, i64 0, i64 2
  %211 = load i32, ptr %210, align 8, !tbaa !12
  %212 = mul nsw i32 %208, %211
  %213 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 8
  store i32 %212, ptr %213, align 4, !tbaa !23
  %214 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 8
  %215 = load i32, ptr %214, align 4, !tbaa !23
  %216 = icmp sle i32 %215, 0
  br i1 %216, label %217, label %220

217:                                              ; preds = %183
  %218 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 8
  %219 = load i32, ptr %218, align 4, !tbaa !23
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.49, i32 noundef %219)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %276

220:                                              ; preds = %183
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %221 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 4
  %222 = load ptr, ptr %221, align 8, !tbaa !15
  store ptr %222, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !12
  br label %223

223:                                              ; preds = %240, %220
  %224 = load i32, ptr %15, align 4, !tbaa !12
  %225 = getelementptr inbounds %class.R3Grid, ptr %21, i32 0, i32 8
  %226 = load i32, ptr %225, align 4, !tbaa !23
  %227 = icmp slt i32 %224, %226
  br i1 %227, label %229, label %228

228:                                              ; preds = %223
  store i32 7, ptr %7, align 4
  br label %243

229:                                              ; preds = %223
  %230 = load ptr, ptr %6, align 8, !tbaa !5
  %231 = load ptr, ptr %14, align 8, !tbaa !5
  %232 = getelementptr inbounds double, ptr %231, i32 1
  store ptr %232, ptr %14, align 8, !tbaa !5
  %233 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %230, ptr noundef @.str.139, ptr noundef %231)
  %234 = icmp ne i32 %233, 1
  br i1 %234, label %235, label %239

235:                                              ; preds = %229
  %236 = load ptr, ptr @stderr, align 8, !tbaa !5
  %237 = load ptr, ptr %5, align 8, !tbaa !5
  %238 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %236, ptr noundef @.str.140, ptr noundef %237) #8
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %243

239:                                              ; preds = %229
  br label %240

240:                                              ; preds = %239
  %241 = load i32, ptr %15, align 4, !tbaa !12
  %242 = add nsw i32 %241, 1
  store i32 %242, ptr %15, align 4, !tbaa !12
  br label %223, !llvm.loop !26

243:                                              ; preds = %235, %228
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  %244 = load i32, ptr %7, align 4
  switch i32 %244, label %275 [
    i32 7, label %245
  ]

245:                                              ; preds = %243
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #8
  %246 = getelementptr inbounds [3 x %class.R3Vector], ptr %11, i64 0, i64 0
  %247 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %246, i32 noundef 0)
  %248 = load double, ptr %247, align 8, !tbaa !27
  %249 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 0
  %250 = load i32, ptr %249, align 4, !tbaa !12
  %251 = sub nsw i32 %250, 1
  %252 = sitofp i32 %251 to double
  %253 = fmul double %248, %252
  %254 = getelementptr inbounds [3 x %class.R3Vector], ptr %11, i64 0, i64 1
  %255 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %254, i32 noundef 1)
  %256 = load double, ptr %255, align 8, !tbaa !27
  %257 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 1
  %258 = load i32, ptr %257, align 4, !tbaa !12
  %259 = sub nsw i32 %258, 1
  %260 = sitofp i32 %259 to double
  %261 = fmul double %256, %260
  %262 = getelementptr inbounds [3 x %class.R3Vector], ptr %11, i64 0, i64 2
  %263 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %262, i32 noundef 2)
  %264 = load double, ptr %263, align 8, !tbaa !27
  %265 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 2
  %266 = load i32, ptr %265, align 4, !tbaa !12
  %267 = sub nsw i32 %266, 1
  %268 = sitofp i32 %267 to double
  %269 = fmul double %264, %268
  call void @_ZN8R3VectorC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %16, double noundef %253, double noundef %261, double noundef %269)
  call void @llvm.lifetime.start.p0(i64 56, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #8
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %18, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %16)
  call void @_ZN5R3BoxC1ERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(56) %17, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %18)
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #8
  invoke void @_ZN6R3Grid28SetWorldToGridTransformationERK5R3Box(ptr noundef nonnull align 8 dereferenceable(592) %21, ptr noundef nonnull align 8 dereferenceable(56) %17)
          to label %270 unwind label %271

270:                                              ; preds = %245
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %17) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #8
  br label %275

271:                                              ; preds = %245
  %272 = landingpad { ptr, i32 }
          cleanup
  %273 = extractvalue { ptr, i32 } %272, 0
  store ptr %273, ptr %19, align 8
  %274 = extractvalue { ptr, i32 } %272, 1
  store i32 %274, ptr %20, align 4
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %17) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 72, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %283

275:                                              ; preds = %270, %243
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %276

276:                                              ; preds = %275, %217
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %277

277:                                              ; preds = %276, %138, %129, %122
  call void @llvm.lifetime.end.p0(i64 72, ptr %11) #8
  br label %278

278:                                              ; preds = %277, %73
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #8
  br label %279

279:                                              ; preds = %278, %62, %53
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #8
  br label %280

280:                                              ; preds = %279, %36
  call void @llvm.lifetime.end.p0(i64 1024, ptr %8) #8
  br label %281

281:                                              ; preds = %280, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  %282 = load i32, ptr %3, align 4
  ret i32 %282

283:                                              ; preds = %271
  %284 = load ptr, ptr %19, align 8
  %285 = load i32, ptr %20, align 4
  %286 = insertvalue { ptr, i32 } poison, ptr %284, 0
  %287 = insertvalue { ptr, i32 } %286, i32 %285, 1
  resume { ptr, i32 } %287
}

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

declare noalias ptr @fopen(ptr 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

declare ptr @fgets(ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i32 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #7

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) #2

declare void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { nounwind }
attributes #9 = { builtin nounwind }
attributes #10 = { builtin allocsize(0) }

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.R3Point = type { [3 x double] }
%class.R3Vector = 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.49 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.126 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.127 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.128 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.129 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.130 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.131 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.132 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.133 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.134 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.135 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.136 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.137 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.138 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.139 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.140 = external hidden unnamed_addr constant [35 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

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

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

declare void @_ZN8R3VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5

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

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

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

declare void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 2) i32 @_ZN6R3Grid10ReadDXFileEPKc(ptr noundef nonnull align 8 dereferenceable(592) %0, ptr noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca [1024 x i8], align 16
  %4 = alloca [3 x i32], align 4
  %5 = alloca %class.R3Point, align 8
  %6 = alloca [3 x %class.R3Vector], align 16
  %7 = alloca %class.R3Vector, align 8
  %8 = alloca %class.R3Box, align 8
  %9 = alloca %class.R3Point, align 8
  %10 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str.126)
  %.not = icmp eq ptr %10, null
  br i1 %.not, label %11, label %14

11:                                               ; preds = %2
  %12 = load ptr, ptr @stderr, align 8, !tbaa !5
  %13 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %12, ptr noundef nonnull @.str.127, ptr noundef %1) #8
  br label %140

14:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %3) #9
  br label %15

15:                                               ; preds = %20, %14
  %16 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %10)
  %.not41 = icmp eq ptr %16, null
  br i1 %.not41, label %17, label %20

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

20:                                               ; preds = %15
  %21 = load i8, ptr %3, align 16, !tbaa !9
  %22 = icmp eq i8 %21, 35
  br i1 %22, label %15, label %23, !llvm.loop !10

23:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #9
  %24 = getelementptr inbounds i8, ptr %4, i64 4
  %25 = getelementptr inbounds i8, ptr %4, i64 8
  %26 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %3, ptr noundef nonnull @.str.129, ptr noundef nonnull %4, ptr noundef nonnull %24, ptr noundef nonnull %25) #9
  %.not42 = icmp eq i32 %26, 3
  br i1 %.not42, label %30, label %27

27:                                               ; preds = %23
  %28 = load ptr, ptr @stderr, align 8, !tbaa !5
  %29 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef nonnull @.str.130, ptr noundef %1) #8
  br label %138

30:                                               ; preds = %23
  %31 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1023, ptr noundef nonnull %10)
  %.not43 = icmp eq ptr %31, null
  br i1 %.not43, label %32, label %35

32:                                               ; preds = %30
  %33 = load ptr, ptr @stderr, align 8, !tbaa !5
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef nonnull @.str.131, ptr noundef %1) #8
  br label %138

35:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #9
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef 0)
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef 1)
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef 2)
  %39 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %3, ptr noundef nonnull @.str.132, ptr noundef nonnull %36, ptr noundef nonnull %37, ptr noundef nonnull %38) #9
  %.not44 = icmp eq i32 %39, 3
  br i1 %.not44, label %.preheader.preheader, label %40

40:                                               ; preds = %35
  %41 = load ptr, ptr @stderr, align 8, !tbaa !5
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef nonnull @.str.133, ptr noundef %1) #8
  br label %137

.preheader.preheader:                             ; preds = %35
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %6) #9
  call void @_ZN8R3VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %6)
  %.ptr.1 = getelementptr inbounds i8, ptr %6, i64 24
  call void @_ZN8R3VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1)
  %.ptr.2 = getelementptr inbounds i8, ptr %6, i64 48
  call void @_ZN8R3VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2)
  %43 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1023, ptr noundef nonnull %10)
  %.not46 = icmp eq ptr %43, null
  br i1 %.not46, label %57, label %60

.preheader.1:                                     ; preds = %60
  %44 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1023, ptr noundef nonnull %10)
  %.not46.1 = icmp eq ptr %44, null
  br i1 %.not46.1, label %57, label %45

45:                                               ; preds = %.preheader.1
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1, i32 noundef 0)
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1, i32 noundef 1)
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1, i32 noundef 2)
  %49 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %3, ptr noundef nonnull @.str.135, ptr noundef nonnull %46, ptr noundef nonnull %47, ptr noundef nonnull %48) #9
  %.not47.1 = icmp eq i32 %49, 3
  br i1 %.not47.1, label %.preheader.2, label %65

.preheader.2:                                     ; preds = %45
  %50 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1023, ptr noundef nonnull %10)
  %.not46.2 = icmp eq ptr %50, null
  br i1 %.not46.2, label %57, label %51

51:                                               ; preds = %.preheader.2
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2, i32 noundef 0)
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2, i32 noundef 1)
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2, i32 noundef 2)
  %55 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %3, ptr noundef nonnull @.str.135, ptr noundef nonnull %52, ptr noundef nonnull %53, ptr noundef nonnull %54) #9
  %.not47.2 = icmp eq i32 %55, 3
  br i1 %.not47.2, label %.critedge, label %65

.critedge:                                        ; preds = %51
  %56 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1023, ptr noundef nonnull %10)
  %.not48 = icmp eq ptr %56, null
  br i1 %.not48, label %68, label %71

57:                                               ; preds = %.preheader.2, %.preheader.1, %.preheader.preheader
  %58 = load ptr, ptr @stderr, align 8, !tbaa !5
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef nonnull @.str.134, ptr noundef %1) #8
  br label %136

60:                                               ; preds = %.preheader.preheader
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %6, i32 noundef 0)
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %6, i32 noundef 1)
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %6, i32 noundef 2)
  %64 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %3, ptr noundef nonnull @.str.135, ptr noundef nonnull %61, ptr noundef nonnull %62, ptr noundef nonnull %63) #9
  %.not47 = icmp eq i32 %64, 3
  br i1 %.not47, label %.preheader.1, label %65

65:                                               ; preds = %51, %45, %60
  %66 = load ptr, ptr @stderr, align 8, !tbaa !5
  %67 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef nonnull @.str.136, ptr noundef %1) #8
  br label %136

68:                                               ; preds = %.critedge
  %69 = load ptr, ptr @stderr, align 8, !tbaa !5
  %70 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %69, ptr noundef nonnull @.str.137, ptr noundef %1) #8
  br label %136

71:                                               ; preds = %.critedge
  %72 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1023, ptr noundef nonnull %10)
  %.not49 = icmp eq ptr %72, null
  br i1 %.not49, label %73, label %76

73:                                               ; preds = %71
  %74 = load ptr, ptr @stderr, align 8, !tbaa !5
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.138, ptr noundef %1) #8
  br label %136

76:                                               ; preds = %71
  %77 = load i32, ptr %4, align 4, !tbaa !12
  %78 = load i32, ptr %24, align 4, !tbaa !12
  %79 = mul nsw i32 %78, %77
  %80 = load i32, ptr %25, align 4, !tbaa !12
  %81 = mul nsw i32 %79, %80
  %82 = getelementptr inbounds i8, ptr %0, i64 560
  %83 = load ptr, ptr %82, align 8, !tbaa !14
  %.not50 = icmp eq ptr %83, null
  %84 = getelementptr inbounds i8, ptr %0, i64 588
  %85 = load i32, ptr %84, align 4
  %86 = icmp sgt i32 %81, %85
  %or.cond = select i1 %.not50, i1 true, i1 %86
  br i1 %or.cond, label %87, label %95

87:                                               ; preds = %76
  br i1 %.not50, label %89, label %88

88:                                               ; preds = %87
  call void @_ZdaPv(ptr noundef nonnull %83) #10
  %.pre.pre = load i32, ptr %4, align 4, !tbaa !12
  %.pre63.pre = load i32, ptr %24, align 4, !tbaa !12
  %.pre64.pre = load i32, ptr %25, align 4, !tbaa !12
  %.pre71 = mul nsw i32 %.pre63.pre, %.pre.pre
  %.pre72 = mul nsw i32 %.pre64.pre, %.pre71
  br label %89

89:                                               ; preds = %88, %87
  %.pre69.pre-phi = phi i32 [ %.pre72, %88 ], [ %81, %87 ]
  %.pre68.pre-phi = phi i32 [ %.pre71, %88 ], [ %79, %87 ]
  %.pre64 = phi i32 [ %.pre64.pre, %88 ], [ %80, %87 ]
  %.pre63 = phi i32 [ %.pre63.pre, %88 ], [ %78, %87 ]
  %.pre = phi i32 [ %.pre.pre, %88 ], [ %77, %87 ]
  %90 = sext i32 %81 to i64
  %91 = icmp slt i32 %81, 0
  %92 = shl nsw i64 %90, 3
  %93 = select i1 %91, i64 -1, i64 %92
  %94 = call noalias noundef nonnull ptr @_Znam(i64 noundef %93) #11
  store ptr %94, ptr %82, align 8, !tbaa !14
  br label %95

95:                                               ; preds = %76, %89
  %.pre-phi70 = phi i32 [ %81, %76 ], [ %.pre69.pre-phi, %89 ]
  %.pre-phi = phi i32 [ %79, %76 ], [ %.pre68.pre-phi, %89 ]
  %96 = phi ptr [ %83, %76 ], [ %94, %89 ]
  %97 = phi i32 [ %80, %76 ], [ %.pre64, %89 ]
  %98 = phi i32 [ %78, %76 ], [ %.pre63, %89 ]
  %99 = phi i32 [ %77, %76 ], [ %.pre, %89 ]
  %100 = getelementptr inbounds i8, ptr %0, i64 568
  store i32 %99, ptr %100, align 8, !tbaa !12
  %101 = getelementptr inbounds i8, ptr %0, i64 572
  store i32 %98, ptr %101, align 4, !tbaa !12
  %102 = getelementptr inbounds i8, ptr %0, i64 576
  store i32 %97, ptr %102, align 8, !tbaa !12
  %103 = getelementptr inbounds i8, ptr %0, i64 580
  store i32 %99, ptr %103, align 4, !tbaa !22
  %104 = getelementptr inbounds i8, ptr %0, i64 584
  store i32 %.pre-phi, ptr %104, align 8, !tbaa !23
  store i32 %.pre-phi70, ptr %84, align 4, !tbaa !24
  %105 = icmp slt i32 %.pre-phi70, 1
  br i1 %105, label %106, label %.lr.ph

106:                                              ; preds = %95
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.49, i32 noundef %.pre-phi70)
  br label %136

.lr.ph:                                           ; preds = %95, %111
  %.03661 = phi i32 [ %113, %111 ], [ 0, %95 ]
  %.03760 = phi ptr [ %112, %111 ], [ %96, %95 ]
  %107 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %10, ptr noundef nonnull @.str.139, ptr noundef nonnull %.03760)
  %.not52 = icmp eq i32 %107, 1
  br i1 %.not52, label %111, label %108

108:                                              ; preds = %.lr.ph
  %109 = load ptr, ptr @stderr, align 8, !tbaa !5
  %110 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %109, ptr noundef nonnull @.str.140, ptr noundef %1) #8
  br label %136

111:                                              ; preds = %.lr.ph
  %112 = getelementptr inbounds i8, ptr %.03760, i64 8
  %113 = add nuw nsw i32 %.03661, 1
  %114 = load i32, ptr %84, align 4, !tbaa !24
  %.not53 = icmp slt i32 %113, %114
  br i1 %.not53, label %.lr.ph, label %.critedge57, !llvm.loop !25

.critedge57:                                      ; preds = %111
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #9
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %6, i32 noundef 0)
  %116 = load double, ptr %115, align 8, !tbaa !26
  %117 = load i32, ptr %4, align 4, !tbaa !12
  %118 = add nsw i32 %117, -1
  %119 = sitofp i32 %118 to double
  %120 = fmul double %116, %119
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1, i32 noundef 1)
  %122 = load double, ptr %121, align 8, !tbaa !26
  %123 = load i32, ptr %24, align 4, !tbaa !12
  %124 = add nsw i32 %123, -1
  %125 = sitofp i32 %124 to double
  %126 = fmul double %122, %125
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2, i32 noundef 2)
  %128 = load double, ptr %127, align 8, !tbaa !26
  %129 = load i32, ptr %25, align 4, !tbaa !12
  %130 = add nsw i32 %129, -1
  %131 = sitofp i32 %130 to double
  %132 = fmul double %128, %131
  call void @_ZN8R3VectorC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %7, double noundef %120, double noundef %126, double noundef %132)
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %8) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #9
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %9, ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @_ZN5R3BoxC1ERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(56) %8, ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %9)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #9
  invoke void @_ZN6R3Grid28SetWorldToGridTransformationERK5R3Box(ptr noundef nonnull align 8 dereferenceable(592) %0, ptr noundef nonnull align 8 dereferenceable(56) %8)
          to label %133 unwind label %134

133:                                              ; preds = %.critedge57
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %8) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #9
  br label %136

134:                                              ; preds = %.critedge57
  %135 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %8) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %3) #9
  resume { ptr, i32 } %135

136:                                              ; preds = %108, %57, %65, %106, %133, %73, %68
  %.4 = phi i32 [ 0, %73 ], [ 0, %68 ], [ 0, %106 ], [ 1, %133 ], [ 0, %108 ], [ 0, %65 ], [ 0, %57 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %6) #9
  br label %137

137:                                              ; preds = %136, %40
  %.5 = phi i32 [ 0, %40 ], [ %.4, %136 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #9
  br label %138

138:                                              ; preds = %137, %32, %27
  %.6 = phi i32 [ 0, %27 ], [ %.5, %137 ], [ 0, %32 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #9
  br label %139

139:                                              ; preds = %138, %17
  %.7 = phi i32 [ %.6, %138 ], [ 0, %17 ]
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %3) #9
  br label %140

140:                                              ; preds = %139, %11
  %.8 = phi i32 [ %.7, %139 ], [ 0, %11 ]
  ret i32 %.8
}

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

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

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 #5

; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #6

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

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #5

declare void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !6, i64 560}
!15 = !{!"_ZTS6R3Grid", !16, i64 0, !16, i64 272, !21, i64 544, !21, i64 552, !6, i64 560, !7, i64 568, !13, i64 580, !13, i64 584, !13, i64 588}
!16 = !{!"_ZTS8R3Affine", !17, i64 0, !18, i64 8, !18, i64 136, !19, i64 264}
!17 = !{!"_ZTS16R3Transformation"}
!18 = !{!"_ZTS8R4Matrix", !7, i64 0}
!19 = !{!"_ZTS7RNFlags", !20, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = !{!"double", !7, i64 0}
!22 = !{!15, !13, i64 580}
!23 = !{!15, !13, i64 584}
!24 = !{!15, !13, i64 588}
!25 = distinct !{!25, !11}
!26 = !{!21, !21, i64 0}


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