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

; 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.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.141 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.142 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.150 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.151 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.152 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.153 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.154 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.155 = external hidden unnamed_addr constant [1 x i8], align 1

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592)) #2 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6R3Grid13WorldPositionEddd(ptr dead_on_unwind noalias writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(592), double noundef, double noundef, double noundef) #4 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK6R3Grid12WritePDBFileEPKc(ptr noundef nonnull align 8 dereferenceable(592) %0, ptr noundef %1) #4 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %class.R3Point, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %13 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = call noalias ptr @fopen(ptr noundef %14, ptr noundef @.str.141)
  store ptr %15, ptr %6, align 8, !tbaa !5
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = icmp ne ptr %16, null
  br i1 %17, label %20, label %18

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

20:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %21

21:                                               ; preds = %77, %20
  %22 = load i32, ptr %9, align 4, !tbaa !9
  %23 = call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %13)
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %80

26:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %73, %26
  %28 = load i32, ptr %10, align 4, !tbaa !9
  %29 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %13)
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %76

32:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %69, %32
  %34 = load i32, ptr %11, align 4, !tbaa !9
  %35 = call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %13)
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %72

38:                                               ; preds = %33
  %39 = load i32, ptr %11, align 4, !tbaa !9
  %40 = load i32, ptr %10, align 4, !tbaa !9
  %41 = load i32, ptr %9, align 4, !tbaa !9
  %42 = call noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %13, i32 noundef %39, i32 noundef %40, i32 noundef %41)
  %43 = fcmp ogt double %42, 0.000000e+00
  br i1 %43, label %44, label %68

44:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #6
  %45 = load i32, ptr %11, align 4, !tbaa !9
  %46 = sitofp i32 %45 to double
  %47 = load i32, ptr %10, align 4, !tbaa !9
  %48 = sitofp i32 %47 to double
  %49 = load i32, ptr %9, align 4, !tbaa !9
  %50 = sitofp i32 %49 to double
  call void @_ZNK6R3Grid13WorldPositionEddd(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %12, ptr noundef nonnull align 8 dereferenceable(592) %13, double noundef %46, double noundef %48, double noundef %50)
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = load i32, ptr %8, align 4, !tbaa !9
  %53 = load i32, ptr %8, align 4, !tbaa !9
  %54 = call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %55 = call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %56 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %57 = load i32, ptr %11, align 4, !tbaa !9
  %58 = load i32, ptr %10, align 4, !tbaa !9
  %59 = load i32, ptr %9, align 4, !tbaa !9
  %60 = call noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %13, i32 noundef %57, i32 noundef %58, i32 noundef %59)
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = load i32, ptr %10, align 4, !tbaa !9
  %63 = load i32, ptr %9, align 4, !tbaa !9
  %64 = call noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %13, i32 noundef %61, i32 noundef %62, i32 noundef %63)
  %65 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef @.str.150, ptr noundef @.str.151, i32 noundef %52, ptr noundef @.str.152, i32 noundef 32, ptr noundef @.str.153, ptr noundef @.str.154, i32 noundef %53, i32 noundef 32, double noundef %54, double noundef %55, double noundef %56, double noundef %60, double noundef %64, ptr noundef @.str.155) #6
  %66 = load i32, ptr %8, align 4, !tbaa !9
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #6
  br label %68

68:                                               ; preds = %44, %38
  br label %69

69:                                               ; preds = %68
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %11, align 4, !tbaa !9
  br label %33, !llvm.loop !11

72:                                               ; preds = %37
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %10, align 4, !tbaa !9
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %10, align 4, !tbaa !9
  br label %27, !llvm.loop !13

76:                                               ; preds = %31
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %9, align 4, !tbaa !9
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %9, align 4, !tbaa !9
  br label %21, !llvm.loop !14

80:                                               ; preds = %25
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = call i32 @fclose(ptr noundef %81)
  %83 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 8
  %84 = load i32, ptr %83, align 4, !tbaa !15
  store i32 %84, ptr %3, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %85

85:                                               ; preds = %80, %18
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %86 = load i32, ptr %3, align 4
  ret i32 %86
}

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

declare i32 @fclose(ptr noundef) #5

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

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

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


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

@.str.141 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.142 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.150 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.151 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.152 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.153 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.154 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.155 = external hidden unnamed_addr constant [1 x i8], align 1

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592)) local_unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6R3Grid13WorldPositionEddd(ptr dead_on_unwind noalias writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(592), double noundef, double noundef, double noundef) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK6R3Grid12WritePDBFileEPKc(ptr noundef nonnull align 8 dereferenceable(592) %0, ptr noundef %1) local_unnamed_addr #4 align 2 {
  %3 = alloca %class.R3Point, align 8
  %4 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str.141)
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %7, label %.preheader33

.preheader33:                                     ; preds = %2
  %5 = tail call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.preheader32, label %._crit_edge42

7:                                                ; preds = %2
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.142, ptr noundef %1)
  br label %39

.preheader32:                                     ; preds = %.preheader33, %._crit_edge38
  %.02841 = phi i32 [ %17, %._crit_edge38 ], [ 0, %.preheader33 ]
  %.02940 = phi i32 [ %.1.lcssa, %._crit_edge38 ], [ 0, %.preheader33 ]
  %8 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.preheader.lr.ph, label %._crit_edge38

.preheader.lr.ph:                                 ; preds = %.preheader32
  %10 = uitofp nneg i32 %.02841 to double
  br label %.preheader

._crit_edge42:                                    ; preds = %._crit_edge38, %.preheader33
  %11 = call i32 @fclose(ptr noundef nonnull %4)
  %12 = getelementptr inbounds i8, ptr %0, i64 588
  %13 = load i32, ptr %12, align 4, !tbaa !5
  br label %39

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %.02737 = phi i32 [ 0, %.preheader.lr.ph ], [ %20, %._crit_edge ]
  %.136 = phi i32 [ %.02940, %.preheader.lr.ph ], [ %.2.lcssa, %._crit_edge ]
  %14 = call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %16 = uitofp nneg i32 %.02737 to double
  br label %23

._crit_edge38:                                    ; preds = %._crit_edge, %.preheader32
  %.1.lcssa = phi i32 [ %.02940, %.preheader32 ], [ %.2.lcssa, %._crit_edge ]
  %17 = add nuw nsw i32 %.02841, 1
  %18 = call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %.preheader32, label %._crit_edge42, !llvm.loop !17

._crit_edge:                                      ; preds = %35, %.preheader
  %.2.lcssa = phi i32 [ %.136, %.preheader ], [ %.3, %35 ]
  %20 = add nuw nsw i32 %.02737, 1
  %21 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %.preheader, label %._crit_edge38, !llvm.loop !19

23:                                               ; preds = %.lr.ph, %35
  %.035 = phi i32 [ 0, %.lr.ph ], [ %36, %35 ]
  %.234 = phi i32 [ %.136, %.lr.ph ], [ %.3, %35 ]
  %24 = call noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %.035, i32 noundef %.02737, i32 noundef %.02841)
  %25 = fcmp ogt double %24, 0.000000e+00
  br i1 %25, label %26, label %35

26:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  %27 = uitofp nneg i32 %.035 to double
  call void @_ZNK6R3Grid13WorldPositionEddd(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %3, ptr noundef nonnull align 8 dereferenceable(592) %0, double noundef %27, double noundef %16, double noundef %10)
  %28 = call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %29 = call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %30 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %31 = call noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %.035, i32 noundef %.02737, i32 noundef %.02841)
  %32 = call noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %.035, i32 noundef %.02737, i32 noundef %.02841)
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %4, ptr noundef nonnull @.str.150, ptr noundef nonnull @.str.151, i32 noundef %.234, ptr noundef nonnull @.str.152, i32 noundef 32, ptr noundef nonnull @.str.153, ptr noundef nonnull @.str.154, i32 noundef %.234, i32 noundef 32, double noundef %28, double noundef %29, double noundef %30, double noundef %31, double noundef %32, ptr noundef nonnull @.str.155) #6
  %34 = add nsw i32 %.234, 1
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  br label %35

35:                                               ; preds = %23, %26
  %.3 = phi i32 [ %34, %26 ], [ %.234, %23 ]
  %36 = add nuw nsw i32 %.035, 1
  %37 = call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %23, label %._crit_edge, !llvm.loop !20

39:                                               ; preds = %._crit_edge42, %7
  %.030 = phi i32 [ %13, %._crit_edge42 ], [ 0, %7 ]
  ret i32 %.030
}

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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, !16, i64 588}
!6 = !{!"_ZTS6R3Grid", !7, i64 0, !7, i64 272, !14, i64 544, !14, i64 552, !15, i64 560, !10, i64 568, !16, i64 580, !16, i64 584, !16, i64 588}
!7 = !{!"_ZTS8R3Affine", !8, i64 0, !9, i64 8, !9, i64 136, !12, i64 264}
!8 = !{!"_ZTS16R3Transformation"}
!9 = !{!"_ZTS8R4Matrix", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTS7RNFlags", !13, i64 0}
!13 = !{!"long", !10, i64 0}
!14 = !{!"double", !10, i64 0}
!15 = !{!"any pointer", !10, i64 0}
!16 = !{!"int", !10, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}


; Effective O3 passes: GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass