; LLVM IR from hpcg-benchmark/hpcg :: src (WriteProblem)

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

%struct.Vector_STRUCT = type { i32, ptr, ptr }
%struct.Geometry_STRUCT = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, i32, i32, i32, i64, i64, i64, i64, i64, i64 }
%struct.SparseMatrix_STRUCT = type { ptr, ptr, i64, i64, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, %"class.std::unordered_map", %"class.std::vector", i8, i8, i8, i8, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, ptr, ptr, ptr }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z12WriteProblemRK15Geometry_STRUCTRK19SparseMatrix_STRUCT13Vector_STRUCTS5_S5_(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(256) %1, ptr noundef byval(%struct.Vector_STRUCT) align 8 %2, ptr noundef byval(%struct.Vector_STRUCT) align 8 %3, ptr noundef byval(%struct.Vector_STRUCT) align 8 %4) #0 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.Geometry_STRUCT, ptr %20, i32 0, i32 0
  %22 = load i32, ptr %21, align 8, !tbaa !9
  %23 = icmp ne i32 %22, 1
  br i1 %23, label %24, label %25

24:                                               ; preds = %5
  store i32 -1, ptr %6, align 4
  br label %154

25:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.SparseMatrix_STRUCT, ptr %26, i32 0, i32 2
  %28 = load i64, ptr %27, align 8, !tbaa !13
  store i64 %28, ptr %9, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store ptr null, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store ptr null, ptr %13, align 8, !tbaa !5
  %29 = call noalias ptr @fopen(ptr noundef @.str, ptr noundef @.str.1)
  store ptr %29, ptr %10, align 8, !tbaa !5
  %30 = call noalias ptr @fopen(ptr noundef @.str.2, ptr noundef @.str.1)
  store ptr %30, ptr %11, align 8, !tbaa !5
  %31 = call noalias ptr @fopen(ptr noundef @.str.3, ptr noundef @.str.1)
  store ptr %31, ptr %12, align 8, !tbaa !5
  %32 = call noalias ptr @fopen(ptr noundef @.str.4, ptr noundef @.str.1)
  store ptr %32, ptr %13, align 8, !tbaa !5
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %35, label %44

35:                                               ; preds = %25
  %36 = load ptr, ptr %11, align 8, !tbaa !5
  %37 = icmp ne ptr %36, null
  br i1 %37, label %38, label %44

38:                                               ; preds = %35
  %39 = load ptr, ptr %12, align 8, !tbaa !5
  %40 = icmp ne ptr %39, null
  br i1 %40, label %41, label %44

41:                                               ; preds = %38
  %42 = load ptr, ptr %13, align 8, !tbaa !5
  %43 = icmp ne ptr %42, null
  br i1 %43, label %69, label %44

44:                                               ; preds = %41, %38, %35, %25
  %45 = load ptr, ptr %13, align 8, !tbaa !5
  %46 = icmp ne ptr %45, null
  br i1 %46, label %47, label %50

47:                                               ; preds = %44
  %48 = load ptr, ptr %13, align 8, !tbaa !5
  %49 = call i32 @fclose(ptr noundef %48)
  br label %50

50:                                               ; preds = %47, %44
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = icmp ne ptr %51, null
  br i1 %52, label %53, label %56

53:                                               ; preds = %50
  %54 = load ptr, ptr %12, align 8, !tbaa !5
  %55 = call i32 @fclose(ptr noundef %54)
  br label %56

56:                                               ; preds = %53, %50
  %57 = load ptr, ptr %11, align 8, !tbaa !5
  %58 = icmp ne ptr %57, null
  br i1 %58, label %59, label %62

59:                                               ; preds = %56
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = call i32 @fclose(ptr noundef %60)
  br label %62

62:                                               ; preds = %59, %56
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = icmp ne ptr %63, null
  br i1 %64, label %65, label %68

65:                                               ; preds = %62
  %66 = load ptr, ptr %10, align 8, !tbaa !5
  %67 = call i32 @fclose(ptr noundef %66)
  br label %68

68:                                               ; preds = %65, %62
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %153

69:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  store i64 0, ptr %15, align 8, !tbaa !26
  br label %70

70:                                               ; preds = %141, %69
  %71 = load i64, ptr %15, align 8, !tbaa !26
  %72 = load i64, ptr %9, align 8, !tbaa !26
  %73 = icmp slt i64 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %144

75:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.SparseMatrix_STRUCT, ptr %76, i32 0, i32 10
  %78 = load ptr, ptr %77, align 8, !tbaa !27
  %79 = load i64, ptr %15, align 8, !tbaa !26
  %80 = getelementptr inbounds ptr, ptr %78, i64 %79
  %81 = load ptr, ptr %80, align 8, !tbaa !5
  store ptr %81, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.SparseMatrix_STRUCT, ptr %82, i32 0, i32 8
  %84 = load ptr, ptr %83, align 8, !tbaa !28
  %85 = load i64, ptr %15, align 8, !tbaa !26
  %86 = getelementptr inbounds ptr, ptr %84, i64 %85
  %87 = load ptr, ptr %86, align 8, !tbaa !5
  store ptr %87, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.SparseMatrix_STRUCT, ptr %88, i32 0, i32 7
  %90 = load ptr, ptr %89, align 8, !tbaa !29
  %91 = load i64, ptr %15, align 8, !tbaa !26
  %92 = getelementptr inbounds i8, ptr %90, i64 %91
  %93 = load i8, ptr %92, align 1, !tbaa !30
  %94 = sext i8 %93 to i32
  store i32 %94, ptr %18, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 0, ptr %19, align 4, !tbaa !31
  br label %95

95:                                               ; preds = %116, %75
  %96 = load i32, ptr %19, align 4, !tbaa !31
  %97 = load i32, ptr %18, align 4, !tbaa !31
  %98 = icmp slt i32 %96, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %95
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %119

100:                                              ; preds = %95
  %101 = load ptr, ptr %10, align 8, !tbaa !5
  %102 = load i64, ptr %15, align 8, !tbaa !26
  %103 = add nsw i64 %102, 1
  %104 = load ptr, ptr %17, align 8, !tbaa !5
  %105 = load i32, ptr %19, align 4, !tbaa !31
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds i64, ptr %104, i64 %106
  %108 = load i64, ptr %107, align 8, !tbaa !26
  %109 = add nsw i64 %108, 1
  %110 = load ptr, ptr %16, align 8, !tbaa !5
  %111 = load i32, ptr %19, align 4, !tbaa !31
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds double, ptr %110, i64 %112
  %114 = load double, ptr %113, align 8, !tbaa !32
  %115 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %101, ptr noundef @.str.5, i64 noundef %103, i64 noundef %109, double noundef %114) #4
  br label %116

116:                                              ; preds = %100
  %117 = load i32, ptr %19, align 4, !tbaa !31
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %19, align 4, !tbaa !31
  br label %95, !llvm.loop !34

119:                                              ; preds = %99
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.Vector_STRUCT, ptr %3, i32 0, i32 1
  %122 = load ptr, ptr %121, align 8, !tbaa !36
  %123 = load i64, ptr %15, align 8, !tbaa !26
  %124 = getelementptr inbounds double, ptr %122, i64 %123
  %125 = load double, ptr %124, align 8, !tbaa !32
  %126 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %120, ptr noundef @.str.6, double noundef %125) #4
  %127 = load ptr, ptr %12, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.Vector_STRUCT, ptr %4, i32 0, i32 1
  %129 = load ptr, ptr %128, align 8, !tbaa !36
  %130 = load i64, ptr %15, align 8, !tbaa !26
  %131 = getelementptr inbounds double, ptr %129, i64 %130
  %132 = load double, ptr %131, align 8, !tbaa !32
  %133 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %127, ptr noundef @.str.6, double noundef %132) #4
  %134 = load ptr, ptr %13, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.Vector_STRUCT, ptr %2, i32 0, i32 1
  %136 = load ptr, ptr %135, align 8, !tbaa !36
  %137 = load i64, ptr %15, align 8, !tbaa !26
  %138 = getelementptr inbounds double, ptr %136, i64 %137
  %139 = load double, ptr %138, align 8, !tbaa !32
  %140 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %134, ptr noundef @.str.6, double noundef %139) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %141

141:                                              ; preds = %119
  %142 = load i64, ptr %15, align 8, !tbaa !26
  %143 = add nsw i64 %142, 1
  store i64 %143, ptr %15, align 8, !tbaa !26
  br label %70, !llvm.loop !38

144:                                              ; preds = %74
  %145 = load ptr, ptr %10, align 8, !tbaa !5
  %146 = call i32 @fclose(ptr noundef %145)
  %147 = load ptr, ptr %11, align 8, !tbaa !5
  %148 = call i32 @fclose(ptr noundef %147)
  %149 = load ptr, ptr %12, align 8, !tbaa !5
  %150 = call i32 @fclose(ptr noundef %149)
  %151 = load ptr, ptr %13, align 8, !tbaa !5
  %152 = call i32 @fclose(ptr noundef %151)
  store i32 0, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %153

153:                                              ; preds = %144, %68
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %154

154:                                              ; preds = %153, %24
  %155 = load i32, ptr %6, align 4
  ret i32 %155
}

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

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

declare i32 @fclose(ptr noundef) #2

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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, !11, i64 0}
!10 = !{!"_ZTS15Geometry_STRUCT", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !6, i64 48, !6, i64 56, !11, i64 64, !11, i64 68, !11, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !12, i64 16}
!14 = !{!"_ZTS19SparseMatrix_STRUCT", !6, i64 0, !6, i64 8, !12, i64 16, !12, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !15, i64 88, !21, i64 144, !25, i64 168, !25, i64 169, !25, i64 170, !25, i64 171, !6, i64 176, !6, i64 184, !6, i64 192, !11, i64 200, !11, i64 204, !11, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248}
!15 = !{!"_ZTSSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEE", !16, i64 0}
!16 = !{!"_ZTSSt10_HashtableIxSt4pairIKxiESaIS2_ENSt8__detail10_Select1stESt8equal_toIxESt4hashIxENS4_18_Mod_range_hashingENS4_20_Default_ranged_hashENS4_20_Prime_rehash_policyENS4_17_Hashtable_traitsILb0ELb0ELb1EEEE", !6, i64 0, !17, i64 8, !18, i64 16, !17, i64 24, !19, i64 32, !6, i64 48}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!19 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !20, i64 0, !17, i64 8}
!20 = !{!"float", !7, i64 0}
!21 = !{!"_ZTSSt6vectorIxSaIxEE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIxSaIxEE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIxSaIxEE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIxSaIxEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!"bool", !7, i64 0}
!26 = !{!12, !12, i64 0}
!27 = !{!14, !6, i64 72}
!28 = !{!14, !6, i64 56}
!29 = !{!14, !6, i64 48}
!30 = !{!7, !7, i64 0}
!31 = !{!11, !11, i64 0}
!32 = !{!33, !33, i64 0}
!33 = !{!"double", !7, i64 0}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = !{!37, !6, i64 8}
!37 = !{!"_ZTS13Vector_STRUCT", !11, i64 0, !6, i64 8, !6, i64 16}
!38 = distinct !{!38, !35}


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

%struct.Vector_STRUCT = type { i32, ptr, ptr }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress nofree nounwind uwtable
define dso_local noundef range(i32 -1, 1) i32 @_Z12WriteProblemRK15Geometry_STRUCTRK19SparseMatrix_STRUCT13Vector_STRUCTS5_S5_(ptr nocapture noundef nonnull readonly align 8 dereferenceable(128) %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(256) %1, ptr nocapture noundef readonly byval(%struct.Vector_STRUCT) align 8 %2, ptr nocapture noundef readonly byval(%struct.Vector_STRUCT) align 8 %3, ptr nocapture noundef readonly byval(%struct.Vector_STRUCT) align 8 %4) local_unnamed_addr #0 {
  %6 = load i32, ptr %0, align 8, !tbaa !5
  %.not = icmp eq i32 %6, 1
  br i1 %.not, label %7, label %70

7:                                                ; preds = %5
  %8 = getelementptr inbounds i8, ptr %1, i64 16
  %9 = load i64, ptr %8, align 8, !tbaa !12
  %10 = tail call noalias ptr @fopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1)
  %11 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1)
  %12 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1)
  %13 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1)
  %14 = icmp ne ptr %10, null
  %15 = icmp ne ptr %11, null
  %or.cond = and i1 %14, %15
  %16 = icmp ne ptr %12, null
  %or.cond3 = and i1 %or.cond, %16
  %17 = icmp ne ptr %13, null
  %or.cond5 = and i1 %or.cond3, %17
  br i1 %or.cond5, label %.preheader, label %28

.preheader:                                       ; preds = %7
  %18 = icmp sgt i64 %9, 0
  br i1 %18, label %.lr.ph59, label %._crit_edge60

.lr.ph59:                                         ; preds = %.preheader
  %19 = getelementptr inbounds i8, ptr %1, i64 72
  %20 = getelementptr inbounds i8, ptr %1, i64 56
  %21 = getelementptr inbounds i8, ptr %1, i64 48
  %22 = getelementptr inbounds i8, ptr %3, i64 8
  %23 = load ptr, ptr %22, align 8
  %24 = getelementptr inbounds i8, ptr %4, i64 8
  %25 = load ptr, ptr %24, align 8
  %26 = getelementptr inbounds i8, ptr %2, i64 8
  %27 = load ptr, ptr %26, align 8
  br label %41

28:                                               ; preds = %7
  br i1 %17, label %29, label %31

29:                                               ; preds = %28
  %30 = tail call i32 @fclose(ptr noundef nonnull %13)
  br label %31

31:                                               ; preds = %29, %28
  br i1 %16, label %32, label %34

32:                                               ; preds = %31
  %33 = tail call i32 @fclose(ptr noundef nonnull %12)
  br label %34

34:                                               ; preds = %32, %31
  br i1 %15, label %35, label %37

35:                                               ; preds = %34
  %36 = tail call i32 @fclose(ptr noundef nonnull %11)
  br label %37

37:                                               ; preds = %35, %34
  br i1 %14, label %.sink.split, label %70

._crit_edge60:                                    ; preds = %._crit_edge, %.preheader
  %38 = tail call i32 @fclose(ptr noundef nonnull %10)
  %39 = tail call i32 @fclose(ptr noundef nonnull %11)
  %40 = tail call i32 @fclose(ptr noundef nonnull %12)
  br label %.sink.split

41:                                               ; preds = %.lr.ph59, %._crit_edge
  %.04858 = phi i64 [ 0, %.lr.ph59 ], [ %.pre-phi, %._crit_edge ]
  %42 = load ptr, ptr %19, align 8, !tbaa !25
  %43 = getelementptr inbounds ptr, ptr %42, i64 %.04858
  %44 = load ptr, ptr %43, align 8, !tbaa !26
  %45 = load ptr, ptr %20, align 8, !tbaa !27
  %46 = getelementptr inbounds ptr, ptr %45, i64 %.04858
  %47 = load ptr, ptr %46, align 8, !tbaa !26
  %48 = load ptr, ptr %21, align 8, !tbaa !28
  %49 = getelementptr inbounds i8, ptr %48, i64 %.04858
  %50 = load i8, ptr %49, align 1, !tbaa !29
  %51 = icmp sgt i8 %50, 0
  br i1 %51, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %41
  %.pre = add nuw nsw i64 %.04858, 1
  br label %._crit_edge

.lr.ph:                                           ; preds = %41
  %wide.trip.count = zext nneg i8 %50 to i64
  %52 = add nuw nsw i64 %.04858, 1
  br label %62

._crit_edge:                                      ; preds = %62, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge_crit_edge ], [ %52, %62 ]
  %53 = getelementptr inbounds double, ptr %23, i64 %.04858
  %54 = load double, ptr %53, align 8, !tbaa !30
  %55 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %11, ptr noundef nonnull @.str.6, double noundef %54) #2
  %56 = getelementptr inbounds double, ptr %25, i64 %.04858
  %57 = load double, ptr %56, align 8, !tbaa !30
  %58 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %12, ptr noundef nonnull @.str.6, double noundef %57) #2
  %59 = getelementptr inbounds double, ptr %27, i64 %.04858
  %60 = load double, ptr %59, align 8, !tbaa !30
  %61 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %13, ptr noundef nonnull @.str.6, double noundef %60) #2
  %exitcond62.not = icmp eq i64 %.pre-phi, %9
  br i1 %exitcond62.not, label %._crit_edge60, label %41, !llvm.loop !32

62:                                               ; preds = %.lr.ph, %62
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %62 ]
  %63 = getelementptr inbounds i64, ptr %47, i64 %indvars.iv
  %64 = load i64, ptr %63, align 8, !tbaa !34
  %65 = add nsw i64 %64, 1
  %66 = getelementptr inbounds double, ptr %44, i64 %indvars.iv
  %67 = load double, ptr %66, align 8, !tbaa !30
  %68 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %10, ptr noundef nonnull @.str.5, i64 noundef %52, i64 noundef %65, double noundef %67) #2
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %62, !llvm.loop !35

.sink.split:                                      ; preds = %37, %._crit_edge60
  %.sink = phi ptr [ %13, %._crit_edge60 ], [ %10, %37 ]
  %.1.ph = phi i32 [ 0, %._crit_edge60 ], [ -1, %37 ]
  %69 = tail call i32 @fclose(ptr noundef nonnull %.sink)
  br label %70

70:                                               ; preds = %.sink.split, %37, %5
  %.1 = phi i32 [ -1, %5 ], [ -1, %37 ], [ %.1.ph, %.sink.split ]
  ret i32 %.1
}

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

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

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

attributes #0 = { mustprogress nofree 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 #1 = { 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 #2 = { 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, !7, i64 0}
!6 = !{!"_ZTS15Geometry_STRUCT", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !10, i64 48, !10, i64 56, !7, i64 64, !7, i64 68, !7, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !11, i64 120}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"long long", !8, i64 0}
!12 = !{!13, !11, i64 16}
!13 = !{!"_ZTS19SparseMatrix_STRUCT", !10, i64 0, !10, i64 8, !11, i64 16, !11, i64 24, !7, i64 32, !7, i64 36, !7, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !14, i64 88, !20, i64 144, !24, i64 168, !24, i64 169, !24, i64 170, !24, i64 171, !10, i64 176, !10, i64 184, !10, i64 192, !7, i64 200, !7, i64 204, !7, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248}
!14 = !{!"_ZTSSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEE", !15, i64 0}
!15 = !{!"_ZTSSt10_HashtableIxSt4pairIKxiESaIS2_ENSt8__detail10_Select1stESt8equal_toIxESt4hashIxENS4_18_Mod_range_hashingENS4_20_Default_ranged_hashENS4_20_Prime_rehash_policyENS4_17_Hashtable_traitsILb0ELb0ELb1EEEE", !10, i64 0, !16, i64 8, !17, i64 16, !16, i64 24, !18, i64 32, !10, i64 48}
!16 = !{!"long", !8, i64 0}
!17 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !10, i64 0}
!18 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !19, i64 0, !16, i64 8}
!19 = !{!"float", !8, i64 0}
!20 = !{!"_ZTSSt6vectorIxSaIxEE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIxSaIxEE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIxSaIxEE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIxSaIxEE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!24 = !{!"bool", !8, i64 0}
!25 = !{!13, !10, i64 72}
!26 = !{!10, !10, i64 0}
!27 = !{!13, !10, i64 56}
!28 = !{!13, !10, i64 48}
!29 = !{!8, !8, i64 0}
!30 = !{!31, !31, i64 0}
!31 = !{!"double", !8, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!11, !11, i64 0}
!35 = distinct !{!35, !33}


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