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

; 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.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
@.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.106 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.107 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.108 = external hidden unnamed_addr constant [41 x i8], align 1

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6R3Grid13ReadVoxelFileEPKc(ptr noundef nonnull align 8 dereferenceable(592) %0, ptr noundef %1) #5 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 ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca float, align 4
  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.45)
  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.106, ptr noundef %19)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %134

20:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = call i64 @fread(ptr noundef %8, i64 noundef 4, i64 noundef 1, ptr noundef %21)
  %23 = icmp ne i64 %22, 1
  br i1 %23, label %24, label %26

24:                                               ; preds = %20
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.107, ptr noundef %25)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %133

26:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %27 = load i32, ptr %8, align 4, !tbaa !9
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = mul nsw i32 %27, %28
  %30 = load i32, ptr %8, align 4, !tbaa !9
  %31 = mul nsw i32 %29, %30
  store i32 %31, ptr %9, align 4, !tbaa !9
  %32 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 4
  %33 = load ptr, ptr %32, align 8, !tbaa !11
  %34 = icmp ne ptr %33, null
  br i1 %34, label %35, label %40

35:                                               ; preds = %26
  %36 = load i32, ptr %9, align 4, !tbaa !9
  %37 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 8
  %38 = load i32, ptr %37, align 4, !tbaa !19
  %39 = icmp sgt i32 %36, %38
  br i1 %39, label %40, label %64

40:                                               ; preds = %35, %26
  %41 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 4
  %42 = load ptr, ptr %41, align 8, !tbaa !11
  %43 = icmp ne ptr %42, null
  br i1 %43, label %44, label %50

44:                                               ; preds = %40
  %45 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 4
  %46 = load ptr, ptr %45, align 8, !tbaa !11
  %47 = icmp eq ptr %46, null
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  call void @_ZdaPv(ptr noundef %46) #7
  br label %49

49:                                               ; preds = %48, %44
  br label %50

50:                                               ; preds = %49, %40
  %51 = load i32, ptr %9, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %52, i64 8)
  %54 = extractvalue { i64, i1 } %53, 1
  %55 = extractvalue { i64, i1 } %53, 0
  %56 = select i1 %54, i64 -1, i64 %55
  %57 = call noalias noundef nonnull ptr @_Znam(i64 noundef %56) #8
  %58 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 4
  store ptr %57, ptr %58, align 8, !tbaa !11
  %59 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 4
  %60 = load ptr, ptr %59, align 8, !tbaa !11
  %61 = icmp ne ptr %60, null
  br i1 %61, label %63, label %62

62:                                               ; preds = %50
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.10, i32 noundef 3949, ptr noundef @.str.2)
  br label %63

63:                                               ; preds = %62, %50
  br label %64

64:                                               ; preds = %63, %35
  %65 = load i32, ptr %8, align 4, !tbaa !9
  %66 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 5
  %67 = getelementptr inbounds [3 x i32], ptr %66, i64 0, i64 0
  store i32 %65, ptr %67, align 8, !tbaa !9
  %68 = load i32, ptr %8, align 4, !tbaa !9
  %69 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 5
  %70 = getelementptr inbounds [3 x i32], ptr %69, i64 0, i64 1
  store i32 %68, ptr %70, align 4, !tbaa !9
  %71 = load i32, ptr %8, align 4, !tbaa !9
  %72 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 5
  %73 = getelementptr inbounds [3 x i32], ptr %72, i64 0, i64 2
  store i32 %71, ptr %73, align 8, !tbaa !9
  %74 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 5
  %75 = getelementptr inbounds [3 x i32], ptr %74, i64 0, i64 0
  %76 = load i32, ptr %75, align 8, !tbaa !9
  %77 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 6
  store i32 %76, ptr %77, align 4, !tbaa !20
  %78 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 6
  %79 = load i32, ptr %78, align 4, !tbaa !20
  %80 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 5
  %81 = getelementptr inbounds [3 x i32], ptr %80, i64 0, i64 1
  %82 = load i32, ptr %81, align 4, !tbaa !9
  %83 = mul nsw i32 %79, %82
  %84 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 7
  store i32 %83, ptr %84, align 8, !tbaa !21
  %85 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 7
  %86 = load i32, ptr %85, align 8, !tbaa !21
  %87 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 5
  %88 = getelementptr inbounds [3 x i32], ptr %87, i64 0, i64 2
  %89 = load i32, ptr %88, align 8, !tbaa !9
  %90 = mul nsw i32 %86, %89
  %91 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 8
  store i32 %90, ptr %91, align 4, !tbaa !19
  %92 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 8
  %93 = load i32, ptr %92, align 4, !tbaa !19
  %94 = icmp sle i32 %93, 0
  br i1 %94, label %95, label %98

95:                                               ; preds = %64
  %96 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 8
  %97 = load i32, ptr %96, align 4, !tbaa !19
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.49, i32 noundef %97)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %132

98:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %99 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 4
  %100 = load ptr, ptr %99, align 8, !tbaa !11
  store ptr %100, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %101

101:                                              ; preds = %121, %98
  %102 = load i32, ptr %11, align 4, !tbaa !9
  %103 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 8
  %104 = load i32, ptr %103, align 4, !tbaa !19
  %105 = icmp slt i32 %102, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %101
  store i32 2, ptr %7, align 4
  br label %124

107:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = call i64 @fread(ptr noundef %12, i64 noundef 4, i64 noundef 1, ptr noundef %108)
  %110 = icmp ne i64 %109, 1
  br i1 %110, label %111, label %113

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

113:                                              ; preds = %107
  %114 = load float, ptr %12, align 4, !tbaa !22
  %115 = fpext float %114 to double
  %116 = load ptr, ptr %10, align 8, !tbaa !5
  %117 = getelementptr inbounds double, ptr %116, i32 1
  store ptr %117, ptr %10, align 8, !tbaa !5
  store double %115, ptr %116, align 8, !tbaa !24
  store i32 0, ptr %7, align 4
  br label %118

118:                                              ; preds = %113, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  %119 = load i32, ptr %7, align 4
  switch i32 %119, label %124 [
    i32 0, label %120
  ]

120:                                              ; preds = %118
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %11, align 4, !tbaa !9
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %11, align 4, !tbaa !9
  br label %101, !llvm.loop !25

124:                                              ; preds = %118, %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  %125 = load i32, ptr %7, align 4
  switch i32 %125, label %131 [
    i32 2, label %126
  ]

126:                                              ; preds = %124
  %127 = load ptr, ptr %6, align 8, !tbaa !5
  %128 = call i32 @fclose(ptr noundef %127)
  %129 = getelementptr inbounds %class.R3Grid, ptr %13, i32 0, i32 8
  %130 = load i32, ptr %129, align 4, !tbaa !19
  store i32 %130, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %131

131:                                              ; preds = %126, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %132

132:                                              ; preds = %131, %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %133

133:                                              ; preds = %132, %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %134

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

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

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

declare i32 @fclose(ptr noundef) #2

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

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { builtin nounwind }
attributes #8 = { 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 = !{!12, !6, i64 560}
!12 = !{!"_ZTS6R3Grid", !13, i64 0, !13, i64 272, !18, i64 544, !18, i64 552, !6, i64 560, !7, i64 568, !10, i64 580, !10, i64 584, !10, i64 588}
!13 = !{!"_ZTS8R3Affine", !14, i64 0, !15, i64 8, !15, i64 136, !16, i64 264}
!14 = !{!"_ZTS16R3Transformation"}
!15 = !{!"_ZTS8R4Matrix", !7, i64 0}
!16 = !{!"_ZTS7RNFlags", !17, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = !{!12, !10, i64 588}
!20 = !{!12, !10, i64 580}
!21 = !{!12, !10, i64 584}
!22 = !{!23, !23, i64 0}
!23 = !{!"float", !7, i64 0}
!24 = !{!18, !18, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


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

@.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.106 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.107 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.108 = external hidden unnamed_addr constant [41 x i8], align 1

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

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

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

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

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

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

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

9:                                                ; preds = %7
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.107, ptr noundef %1)
  br label %45

10:                                               ; preds = %7
  %11 = load i32, ptr %3, align 4, !tbaa !5
  %12 = mul nsw i32 %11, %11
  %13 = mul nsw i32 %12, %11
  %14 = getelementptr inbounds i8, ptr %0, i64 560
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  %.not26 = icmp eq ptr %15, null
  %16 = getelementptr inbounds i8, ptr %0, i64 588
  %17 = load i32, ptr %16, align 4
  %18 = icmp sgt i32 %13, %17
  %or.cond = select i1 %.not26, i1 true, i1 %18
  br i1 %or.cond, label %19, label %27

19:                                               ; preds = %10
  br i1 %.not26, label %21, label %20

20:                                               ; preds = %19
  tail call void @_ZdaPv(ptr noundef nonnull %15) #7
  br label %21

21:                                               ; preds = %20, %19
  %22 = sext i32 %13 to i64
  %23 = icmp slt i32 %13, 0
  %24 = shl nsw i64 %22, 3
  %25 = select i1 %23, i64 -1, i64 %24
  %26 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %25) #8
  store ptr %26, ptr %14, align 8, !tbaa !9
  br label %27

27:                                               ; preds = %10, %21
  %28 = phi ptr [ %15, %10 ], [ %26, %21 ]
  %29 = getelementptr inbounds i8, ptr %0, i64 568
  %30 = insertelement <4 x i32> poison, i32 %11, i64 0
  %31 = shufflevector <4 x i32> %30, <4 x i32> poison, <4 x i32> zeroinitializer
  store <4 x i32> %31, ptr %29, align 8, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %0, i64 584
  store i32 %12, ptr %32, align 8, !tbaa !18
  store i32 %13, ptr %16, align 4, !tbaa !19
  %33 = icmp slt i32 %13, 1
  br i1 %33, label %34, label %.lr.ph

34:                                               ; preds = %27
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.49, i32 noundef %13)
  br label %45

.lr.ph:                                           ; preds = %27, %36
  %.036 = phi i32 [ %40, %36 ], [ 0, %27 ]
  %.01735 = phi ptr [ %39, %36 ], [ %28, %27 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %35 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %5)
  %.not28 = icmp eq i64 %35, 1
  br i1 %.not28, label %36, label %42

36:                                               ; preds = %.lr.ph
  %37 = load float, ptr %4, align 4, !tbaa !20
  %38 = fpext float %37 to double
  %39 = getelementptr inbounds i8, ptr %.01735, i64 8
  store double %38, ptr %.01735, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %40 = add nuw nsw i32 %.036, 1
  %41 = load i32, ptr %16, align 4, !tbaa !19
  %.not29 = icmp slt i32 %40, %41
  br i1 %.not29, label %.lr.ph, label %.critedge, !llvm.loop !23

42:                                               ; preds = %.lr.ph
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.108, ptr noundef %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %45

.critedge:                                        ; preds = %36
  %43 = tail call i32 @fclose(ptr noundef nonnull %5)
  %44 = load i32, ptr %16, align 4, !tbaa !19
  br label %45

45:                                               ; preds = %42, %34, %.critedge, %9
  %.5 = phi i32 [ 0, %9 ], [ 0, %34 ], [ %44, %.critedge ], [ 0, %42 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  br label %46

46:                                               ; preds = %45, %6
  %.6 = phi i32 [ %.5, %45 ], [ 0, %6 ]
  ret i32 %.6
}

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

attributes #0 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 }
attributes #7 = { builtin nounwind }
attributes #8 = { 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 = !{!"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 584}
!19 = !{!10, !6, i64 588}
!20 = !{!21, !21, i64 0}
!21 = !{!"float", !7, i64 0}
!22 = !{!16, !16, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


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