; LLVM IR from Dutta-SD/Numerical_Methods :: Linear_Algebra (Jacobi)

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

@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 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

declare i32 @printf(ptr noundef, ...) #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @MatMult(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @MatAdd(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @check_Mat(ptr noundef, ptr noundef, double noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

; Function Attrs: nounwind uwtable
define dso_local void @Jacobi(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca [4 x [4 x double]], align 16
  %4 = alloca [4 x [1 x double]], align 16
  %5 = alloca [4 x [1 x double]], align 16
  %6 = alloca [4 x [1 x double]], align 16
  %7 = alloca [4 x [1 x double]], align 16
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 128, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store double 0x3EB0C6F7A0B5ED8D, ptr %11, align 8, !tbaa !9
  store i32 0, ptr %8, align 4, !tbaa !11
  br label %12

12:                                               ; preds = %28, %1
  %13 = load i32, ptr %8, align 4, !tbaa !11
  %14 = icmp slt i32 %13, 4
  br i1 %14, label %15, label %31

15:                                               ; preds = %12
  %16 = load i32, ptr %8, align 4, !tbaa !11
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [4 x [1 x double]], ptr %5, i64 0, i64 %17
  %19 = getelementptr inbounds [1 x double], ptr %18, i64 0, i64 0
  store double 0.000000e+00, ptr %19, align 8, !tbaa !9
  %20 = load i32, ptr %8, align 4, !tbaa !11
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [4 x [1 x double]], ptr %6, i64 0, i64 %21
  %23 = getelementptr inbounds [1 x double], ptr %22, i64 0, i64 0
  store double 0.000000e+00, ptr %23, align 8, !tbaa !9
  %24 = load i32, ptr %8, align 4, !tbaa !11
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [4 x [1 x double]], ptr %7, i64 0, i64 %25
  %27 = getelementptr inbounds [1 x double], ptr %26, i64 0, i64 0
  store double 0.000000e+00, ptr %27, align 8, !tbaa !9
  br label %28

28:                                               ; preds = %15
  %29 = load i32, ptr %8, align 4, !tbaa !11
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %8, align 4, !tbaa !11
  br label %12, !llvm.loop !13

31:                                               ; preds = %12
  store i32 0, ptr %8, align 4, !tbaa !11
  br label %32

32:                                               ; preds = %50, %31
  %33 = load i32, ptr %8, align 4, !tbaa !11
  %34 = icmp slt i32 %33, 4
  br i1 %34, label %35, label %53

35:                                               ; preds = %32
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = load i32, ptr %8, align 4, !tbaa !11
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [5 x double], ptr %36, i64 %38
  %40 = load i32, ptr %8, align 4, !tbaa !11
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [5 x double], ptr %39, i64 0, i64 %41
  %43 = load double, ptr %42, align 8, !tbaa !9
  %44 = call double @llvm.fabs.f64(double %43)
  %45 = load double, ptr %11, align 8, !tbaa !9
  %46 = fcmp olt double %44, %45
  br i1 %46, label %47, label %49

47:                                               ; preds = %35
  %48 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @exit(i32 noundef 1) #6
  unreachable

49:                                               ; preds = %35
  br label %50

50:                                               ; preds = %49
  %51 = load i32, ptr %8, align 4, !tbaa !11
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %8, align 4, !tbaa !11
  br label %32, !llvm.loop !15

53:                                               ; preds = %32
  store i32 0, ptr %8, align 4, !tbaa !11
  br label %54

54:                                               ; preds = %102, %53
  %55 = load i32, ptr %8, align 4, !tbaa !11
  %56 = icmp slt i32 %55, 4
  br i1 %56, label %57, label %105

57:                                               ; preds = %54
  store i32 0, ptr %9, align 4, !tbaa !11
  br label %58

58:                                               ; preds = %98, %57
  %59 = load i32, ptr %9, align 4, !tbaa !11
  %60 = icmp slt i32 %59, 4
  br i1 %60, label %61, label %101

61:                                               ; preds = %58
  %62 = load i32, ptr %8, align 4, !tbaa !11
  %63 = load i32, ptr %9, align 4, !tbaa !11
  %64 = icmp ne i32 %62, %63
  br i1 %64, label %65, label %90

65:                                               ; preds = %61
  %66 = load ptr, ptr %2, align 8, !tbaa !5
  %67 = load i32, ptr %8, align 4, !tbaa !11
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [5 x double], ptr %66, i64 %68
  %70 = load i32, ptr %9, align 4, !tbaa !11
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [5 x double], ptr %69, i64 0, i64 %71
  %73 = load double, ptr %72, align 8, !tbaa !9
  %74 = fneg double %73
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  %76 = load i32, ptr %8, align 4, !tbaa !11
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [5 x double], ptr %75, i64 %77
  %79 = load i32, ptr %8, align 4, !tbaa !11
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [5 x double], ptr %78, i64 0, i64 %80
  %82 = load double, ptr %81, align 8, !tbaa !9
  %83 = fdiv double %74, %82
  %84 = load i32, ptr %8, align 4, !tbaa !11
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [4 x [4 x double]], ptr %3, i64 0, i64 %85
  %87 = load i32, ptr %9, align 4, !tbaa !11
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [4 x double], ptr %86, i64 0, i64 %88
  store double %83, ptr %89, align 8, !tbaa !9
  br label %97

90:                                               ; preds = %61
  %91 = load i32, ptr %8, align 4, !tbaa !11
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [4 x [4 x double]], ptr %3, i64 0, i64 %92
  %94 = load i32, ptr %9, align 4, !tbaa !11
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [4 x double], ptr %93, i64 0, i64 %95
  store double 0.000000e+00, ptr %96, align 8, !tbaa !9
  br label %97

97:                                               ; preds = %90, %65
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %9, align 4, !tbaa !11
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %9, align 4, !tbaa !11
  br label %58, !llvm.loop !16

101:                                              ; preds = %58
  br label %102

102:                                              ; preds = %101
  %103 = load i32, ptr %8, align 4, !tbaa !11
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %8, align 4, !tbaa !11
  br label %54, !llvm.loop !17

105:                                              ; preds = %54
  store i32 0, ptr %8, align 4, !tbaa !11
  br label %106

106:                                              ; preds = %129, %105
  %107 = load i32, ptr %8, align 4, !tbaa !11
  %108 = icmp slt i32 %107, 4
  br i1 %108, label %109, label %132

109:                                              ; preds = %106
  %110 = load ptr, ptr %2, align 8, !tbaa !5
  %111 = load i32, ptr %8, align 4, !tbaa !11
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [5 x double], ptr %110, i64 %112
  %114 = getelementptr inbounds [5 x double], ptr %113, i64 0, i64 4
  %115 = load double, ptr %114, align 8, !tbaa !9
  %116 = load ptr, ptr %2, align 8, !tbaa !5
  %117 = load i32, ptr %8, align 4, !tbaa !11
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [5 x double], ptr %116, i64 %118
  %120 = load i32, ptr %8, align 4, !tbaa !11
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [5 x double], ptr %119, i64 0, i64 %121
  %123 = load double, ptr %122, align 8, !tbaa !9
  %124 = fdiv double %115, %123
  %125 = load i32, ptr %8, align 4, !tbaa !11
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [4 x [1 x double]], ptr %4, i64 0, i64 %126
  %128 = getelementptr inbounds [1 x double], ptr %127, i64 0, i64 0
  store double %124, ptr %128, align 8, !tbaa !9
  br label %129

129:                                              ; preds = %109
  %130 = load i32, ptr %8, align 4, !tbaa !11
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %8, align 4, !tbaa !11
  br label %106, !llvm.loop !18

132:                                              ; preds = %106
  %133 = getelementptr inbounds [4 x [4 x double]], ptr %3, i64 0, i64 0
  %134 = getelementptr inbounds [4 x [1 x double]], ptr %5, i64 0, i64 0
  %135 = getelementptr inbounds [4 x [1 x double]], ptr %6, i64 0, i64 0
  call void @MatMult(ptr noundef %133, ptr noundef %134, ptr noundef %135)
  %136 = getelementptr inbounds [4 x [1 x double]], ptr %4, i64 0, i64 0
  %137 = getelementptr inbounds [4 x [1 x double]], ptr %6, i64 0, i64 0
  %138 = getelementptr inbounds [4 x [1 x double]], ptr %5, i64 0, i64 0
  call void @MatAdd(ptr noundef %136, ptr noundef %137, ptr noundef %138)
  br label %139

139:                                              ; preds = %162, %132
  %140 = getelementptr inbounds [4 x [1 x double]], ptr %5, i64 0, i64 0
  %141 = getelementptr inbounds [4 x [1 x double]], ptr %7, i64 0, i64 0
  %142 = load double, ptr %11, align 8, !tbaa !9
  %143 = call i32 @check_Mat(ptr noundef %140, ptr noundef %141, double noundef %142)
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %145, label %169

145:                                              ; preds = %139
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %146

146:                                              ; preds = %159, %145
  %147 = load i32, ptr %10, align 4, !tbaa !11
  %148 = icmp slt i32 %147, 4
  br i1 %148, label %149, label %162

149:                                              ; preds = %146
  %150 = load i32, ptr %10, align 4, !tbaa !11
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [4 x [1 x double]], ptr %5, i64 0, i64 %151
  %153 = getelementptr inbounds [1 x double], ptr %152, i64 0, i64 0
  %154 = load double, ptr %153, align 8, !tbaa !9
  %155 = load i32, ptr %10, align 4, !tbaa !11
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [4 x [1 x double]], ptr %7, i64 0, i64 %156
  %158 = getelementptr inbounds [1 x double], ptr %157, i64 0, i64 0
  store double %154, ptr %158, align 8, !tbaa !9
  br label %159

159:                                              ; preds = %149
  %160 = load i32, ptr %10, align 4, !tbaa !11
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %10, align 4, !tbaa !11
  br label %146, !llvm.loop !19

162:                                              ; preds = %146
  %163 = getelementptr inbounds [4 x [4 x double]], ptr %3, i64 0, i64 0
  %164 = getelementptr inbounds [4 x [1 x double]], ptr %5, i64 0, i64 0
  %165 = getelementptr inbounds [4 x [1 x double]], ptr %6, i64 0, i64 0
  call void @MatMult(ptr noundef %163, ptr noundef %164, ptr noundef %165)
  %166 = getelementptr inbounds [4 x [1 x double]], ptr %4, i64 0, i64 0
  %167 = getelementptr inbounds [4 x [1 x double]], ptr %6, i64 0, i64 0
  %168 = getelementptr inbounds [4 x [1 x double]], ptr %5, i64 0, i64 0
  call void @MatAdd(ptr noundef %166, ptr noundef %167, ptr noundef %168)
  br label %139, !llvm.loop !20

169:                                              ; preds = %139
  store i32 0, ptr %9, align 4, !tbaa !11
  br label %170

170:                                              ; preds = %181, %169
  %171 = load i32, ptr %9, align 4, !tbaa !11
  %172 = icmp slt i32 %171, 4
  br i1 %172, label %173, label %184

173:                                              ; preds = %170
  %174 = load i32, ptr %9, align 4, !tbaa !11
  %175 = load i32, ptr %9, align 4, !tbaa !11
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [4 x [1 x double]], ptr %5, i64 0, i64 %176
  %178 = getelementptr inbounds [1 x double], ptr %177, i64 0, i64 0
  %179 = load double, ptr %178, align 8, !tbaa !9
  %180 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %174, double noundef %179)
  br label %181

181:                                              ; preds = %173
  %182 = load i32, ptr %9, align 4, !tbaa !11
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %9, align 4, !tbaa !11
  br label %170, !llvm.loop !21

184:                                              ; preds = %170
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr %3) #5
  ret void
}

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { noreturn 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 = { nounwind }
attributes #6 = { noreturn 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}


; 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.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @MatMult(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @MatAdd(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @check_Mat(ptr noundef, ptr noundef, double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

; Function Attrs: nounwind uwtable
define dso_local void @Jacobi(ptr nocapture noundef readonly %0) local_unnamed_addr #2 {
.preheader51.preheader:
  %1 = alloca [4 x [4 x double]], align 16
  %2 = alloca [4 x [1 x double]], align 16
  %3 = alloca [4 x [1 x double]], align 16
  %4 = alloca [4 x [1 x double]], align 16
  %5 = alloca [4 x [1 x double]], align 16
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %3, i8 0, i64 32, i1 false), !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %4, i8 0, i64 32, i1 false), !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %5, i8 0, i64 32, i1 false), !tbaa !5
  %6 = load double, ptr %0, align 8, !tbaa !5
  %7 = tail call double @llvm.fabs.f64(double %6)
  %8 = fcmp olt double %7, 0x3EB0C6F7A0B5ED8D
  br i1 %8, label %21, label %.preheader51.1

.preheader51.1:                                   ; preds = %.preheader51.preheader
  %9 = getelementptr inbounds i8, ptr %0, i64 48
  %10 = load double, ptr %9, align 8, !tbaa !5
  %11 = tail call double @llvm.fabs.f64(double %10)
  %12 = fcmp olt double %11, 0x3EB0C6F7A0B5ED8D
  br i1 %12, label %21, label %.preheader51.2

.preheader51.2:                                   ; preds = %.preheader51.1
  %13 = getelementptr inbounds i8, ptr %0, i64 96
  %14 = load double, ptr %13, align 8, !tbaa !5
  %15 = tail call double @llvm.fabs.f64(double %14)
  %16 = fcmp olt double %15, 0x3EB0C6F7A0B5ED8D
  br i1 %16, label %21, label %.preheader51.3

.preheader51.3:                                   ; preds = %.preheader51.2
  %17 = getelementptr inbounds i8, ptr %0, i64 144
  %18 = load double, ptr %17, align 8, !tbaa !5
  %19 = tail call double @llvm.fabs.f64(double %18)
  %20 = fcmp olt double %19, 0x3EB0C6F7A0B5ED8D
  br i1 %20, label %21, label %.preheader48.preheader

21:                                               ; preds = %.preheader51.3, %.preheader51.2, %.preheader51.1, %.preheader51.preheader
  %22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  tail call void @exit(i32 noundef 1) #8
  unreachable

.preheader48.preheader:                           ; preds = %.preheader51.3
  store double 0.000000e+00, ptr %1, align 16
  %23 = getelementptr inbounds i8, ptr %0, i64 8
  %24 = getelementptr inbounds i8, ptr %1, i64 8
  %25 = load <2 x double>, ptr %23, align 8, !tbaa !5
  %26 = fneg <2 x double> %25
  %27 = insertelement <2 x double> poison, double %6, i64 0
  %28 = shufflevector <2 x double> %27, <2 x double> poison, <2 x i32> zeroinitializer
  %29 = fdiv <2 x double> %26, %28
  store <2 x double> %29, ptr %24, align 8
  %30 = getelementptr inbounds i8, ptr %0, i64 24
  %31 = load double, ptr %30, align 8, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %1, i64 24
  %33 = getelementptr inbounds i8, ptr %0, i64 40
  %34 = load double, ptr %33, align 8, !tbaa !5
  %35 = insertelement <2 x double> poison, double %31, i64 0
  %36 = insertelement <2 x double> %35, double %34, i64 1
  %37 = fneg <2 x double> %36
  %38 = insertelement <2 x double> %27, double %10, i64 1
  %39 = fdiv <2 x double> %37, %38
  store <2 x double> %39, ptr %32, align 8
  %40 = getelementptr inbounds i8, ptr %1, i64 40
  store double 0.000000e+00, ptr %40, align 8
  %41 = getelementptr inbounds i8, ptr %0, i64 56
  %42 = getelementptr inbounds i8, ptr %1, i64 48
  %43 = load <2 x double>, ptr %41, align 8, !tbaa !5
  %44 = fneg <2 x double> %43
  %45 = insertelement <2 x double> poison, double %10, i64 0
  %46 = shufflevector <2 x double> %45, <2 x double> poison, <2 x i32> zeroinitializer
  %47 = fdiv <2 x double> %44, %46
  store <2 x double> %47, ptr %42, align 16
  %48 = getelementptr inbounds i8, ptr %0, i64 80
  %49 = getelementptr inbounds i8, ptr %1, i64 64
  %50 = load <2 x double>, ptr %48, align 8, !tbaa !5
  %51 = fneg <2 x double> %50
  %52 = insertelement <2 x double> poison, double %14, i64 0
  %53 = shufflevector <2 x double> %52, <2 x double> poison, <2 x i32> zeroinitializer
  %54 = fdiv <2 x double> %51, %53
  store <2 x double> %54, ptr %49, align 16
  %55 = getelementptr inbounds i8, ptr %1, i64 80
  store double 0.000000e+00, ptr %55, align 16
  %56 = getelementptr inbounds i8, ptr %0, i64 104
  %57 = load double, ptr %56, align 8, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %1, i64 88
  %59 = getelementptr inbounds i8, ptr %0, i64 120
  %60 = load double, ptr %59, align 8, !tbaa !5
  %61 = insertelement <2 x double> poison, double %57, i64 0
  %62 = insertelement <2 x double> %61, double %60, i64 1
  %63 = fneg <2 x double> %62
  %64 = insertelement <2 x double> %52, double %18, i64 1
  %65 = fdiv <2 x double> %63, %64
  store <2 x double> %65, ptr %58, align 8
  %66 = getelementptr inbounds i8, ptr %0, i64 128
  %67 = getelementptr inbounds i8, ptr %1, i64 104
  %68 = load <2 x double>, ptr %66, align 8, !tbaa !5
  %69 = fneg <2 x double> %68
  %70 = insertelement <2 x double> poison, double %18, i64 0
  %71 = shufflevector <2 x double> %70, <2 x double> poison, <2 x i32> zeroinitializer
  %72 = fdiv <2 x double> %69, %71
  store <2 x double> %72, ptr %67, align 8
  %73 = getelementptr inbounds i8, ptr %1, i64 120
  store double 0.000000e+00, ptr %73, align 8
  %74 = getelementptr inbounds i8, ptr %0, i64 32
  %75 = load double, ptr %74, align 8, !tbaa !5
  %76 = getelementptr inbounds i8, ptr %0, i64 72
  %77 = load double, ptr %76, align 8, !tbaa !5
  %78 = insertelement <2 x double> poison, double %75, i64 0
  %79 = insertelement <2 x double> %78, double %77, i64 1
  %80 = fdiv <2 x double> %79, %38
  store <2 x double> %80, ptr %2, align 16, !tbaa !5
  %81 = getelementptr inbounds i8, ptr %0, i64 112
  %82 = load double, ptr %81, align 8, !tbaa !5
  %83 = getelementptr inbounds i8, ptr %2, i64 16
  %84 = getelementptr inbounds i8, ptr %0, i64 152
  %85 = load double, ptr %84, align 8, !tbaa !5
  %86 = insertelement <2 x double> poison, double %82, i64 0
  %87 = insertelement <2 x double> %86, double %85, i64 1
  %88 = fdiv <2 x double> %87, %64
  store <2 x double> %88, ptr %83, align 16, !tbaa !5
  call void @MatMult(ptr noundef nonnull %1, ptr noundef nonnull %3, ptr noundef nonnull %4)
  call void @MatAdd(ptr noundef nonnull %2, ptr noundef nonnull %4, ptr noundef nonnull %3)
  %89 = call i32 @check_Mat(ptr noundef nonnull %3, ptr noundef nonnull %5, double noundef 0x3EB0C6F7A0B5ED8D)
  %.not58 = icmp eq i32 %89, 0
  br i1 %.not58, label %.preheader, label %.preheader47

.preheader47:                                     ; preds = %.preheader48.preheader, %.preheader47
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %5, ptr noundef nonnull align 16 dereferenceable(32) %3, i64 32, i1 false), !tbaa !5
  call void @MatMult(ptr noundef nonnull %1, ptr noundef nonnull %3, ptr noundef nonnull %4)
  call void @MatAdd(ptr noundef nonnull %2, ptr noundef nonnull %4, ptr noundef nonnull %3)
  %90 = call i32 @check_Mat(ptr noundef nonnull %3, ptr noundef nonnull %5, double noundef 0x3EB0C6F7A0B5ED8D)
  %.not = icmp eq i32 %90, 0
  br i1 %.not, label %.preheader, label %.preheader47, !llvm.loop !9

.preheader:                                       ; preds = %.preheader47, %.preheader48.preheader
  %91 = load double, ptr %3, align 16, !tbaa !5
  %92 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 0, double noundef %91)
  %93 = getelementptr inbounds i8, ptr %3, i64 8
  %94 = load double, ptr %93, align 8, !tbaa !5
  %95 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 1, double noundef %94)
  %96 = getelementptr inbounds i8, ptr %3, i64 16
  %97 = load double, ptr %96, align 16, !tbaa !5
  %98 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 2, double noundef %97)
  %99 = getelementptr inbounds i8, ptr %3, i64 24
  %100 = load double, ptr %99, align 8, !tbaa !5
  %101 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 3, double noundef %100)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %1) #7
  ret void
}

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { noreturn 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }
attributes #8 = { noreturn 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass