; LLVM IR from tangjz/acm-icpc :: codeforces/gym/101412D.ll (Z5gaussv)

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

@d = external dso_local global i32, align 4
@mat = external dso_local global [9 x [9 x double]], align 16
@sei = external dso_local global [9 x double], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z5gaussv() #0 {
  %1 = alloca i1, align 1
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %148, %0
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = load i32, ptr @d, align 4, !tbaa !5
  %14 = icmp sle i32 %12, %13
  br i1 %14, label %16, label %15

15:                                               ; preds = %11
  store i32 2, ptr %3, align 4
  br label %151

16:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %17 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %17, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr %5, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %47, %16
  %21 = load i32, ptr %5, align 4, !tbaa !5
  %22 = load i32, ptr @d, align 4, !tbaa !5
  %23 = icmp sle i32 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %50

25:                                               ; preds = %20
  %26 = load i32, ptr %5, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %27
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [9 x double], ptr %28, i64 0, i64 %30
  %32 = load double, ptr %31, align 8, !tbaa !9
  %33 = call double @llvm.fabs.f64(double %32)
  %34 = load i32, ptr %5, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %35
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [9 x double], ptr %36, i64 0, i64 %38
  %40 = load double, ptr %39, align 8, !tbaa !9
  %41 = call double @llvm.fabs.f64(double %40)
  %42 = call noundef i32 @_Z4dcmpdd(double noundef %33, double noundef %41)
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %44, label %46

44:                                               ; preds = %25
  %45 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %45, ptr %4, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %44, %25
  br label %47

47:                                               ; preds = %46
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %5, align 4, !tbaa !5
  br label %20, !llvm.loop !11

50:                                               ; preds = %24
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %52
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [9 x double], ptr %53, i64 0, i64 %55
  %57 = load double, ptr %56, align 8, !tbaa !9
  %58 = call noundef i32 @_Z3sgnd(double noundef %57)
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %61, label %60

60:                                               ; preds = %50
  store i1 false, ptr %1, align 1
  store i32 1, ptr %3, align 4
  br label %145

61:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %62 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %62, ptr %6, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %82, %61
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = load i32, ptr @d, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  %67 = icmp sle i32 %64, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %63
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %85

69:                                               ; preds = %63
  %70 = load i32, ptr %2, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %71
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [9 x double], ptr %72, i64 0, i64 %74
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %77
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [9 x double], ptr %78, i64 0, i64 %80
  call void @_ZSt4swapIdENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %75, ptr noundef nonnull align 8 dereferenceable(8) %81) #5
  br label %82

82:                                               ; preds = %69
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %6, align 4, !tbaa !5
  br label %63, !llvm.loop !13

85:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %141, %85
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = load i32, ptr @d, align 4, !tbaa !5
  %89 = icmp sle i32 %87, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %86
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %144

91:                                               ; preds = %86
  %92 = load i32, ptr %7, align 4, !tbaa !5
  %93 = load i32, ptr %2, align 4, !tbaa !5
  %94 = icmp eq i32 %92, %93
  br i1 %94, label %95, label %96

95:                                               ; preds = %91
  br label %141

96:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %97 = load i32, ptr %7, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %98
  %100 = load i32, ptr %2, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [9 x double], ptr %99, i64 0, i64 %101
  %103 = load double, ptr %102, align 8, !tbaa !9
  %104 = load i32, ptr %2, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %105
  %107 = load i32, ptr %2, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [9 x double], ptr %106, i64 0, i64 %108
  %110 = load double, ptr %109, align 8, !tbaa !9
  %111 = fdiv double %103, %110
  store double %111, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %112 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %112, ptr %9, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %137, %96
  %114 = load i32, ptr %9, align 4, !tbaa !5
  %115 = load i32, ptr @d, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  %117 = icmp sle i32 %114, %116
  br i1 %117, label %119, label %118

118:                                              ; preds = %113
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %140

119:                                              ; preds = %113
  %120 = load double, ptr %8, align 8, !tbaa !9
  %121 = load i32, ptr %2, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %122
  %124 = load i32, ptr %9, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [9 x double], ptr %123, i64 0, i64 %125
  %127 = load double, ptr %126, align 8, !tbaa !9
  %128 = load i32, ptr %7, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %129
  %131 = load i32, ptr %9, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [9 x double], ptr %130, i64 0, i64 %132
  %134 = load double, ptr %133, align 8, !tbaa !9
  %135 = fneg double %120
  %136 = call double @llvm.fmuladd.f64(double %135, double %127, double %134)
  store double %136, ptr %133, align 8, !tbaa !9
  br label %137

137:                                              ; preds = %119
  %138 = load i32, ptr %9, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %9, align 4, !tbaa !5
  br label %113, !llvm.loop !14

140:                                              ; preds = %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %141

141:                                              ; preds = %140, %95
  %142 = load i32, ptr %7, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %7, align 4, !tbaa !5
  br label %86, !llvm.loop !15

144:                                              ; preds = %90
  store i32 0, ptr %3, align 4
  br label %145

145:                                              ; preds = %144, %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  %146 = load i32, ptr %3, align 4
  switch i32 %146, label %151 [
    i32 0, label %147
  ]

147:                                              ; preds = %145
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %2, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !16

151:                                              ; preds = %145, %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %152 = load i32, ptr %3, align 4
  switch i32 %152, label %185 [
    i32 2, label %153
    i32 1, label %183
  ]

153:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %154

154:                                              ; preds = %179, %153
  %155 = load i32, ptr %10, align 4, !tbaa !5
  %156 = load i32, ptr @d, align 4, !tbaa !5
  %157 = icmp sle i32 %155, %156
  br i1 %157, label %159, label %158

158:                                              ; preds = %154
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %182

159:                                              ; preds = %154
  %160 = load i32, ptr %10, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %161
  %163 = load i32, ptr @d, align 4, !tbaa !5
  %164 = add nsw i32 %163, 1
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [9 x double], ptr %162, i64 0, i64 %165
  %167 = load double, ptr %166, align 8, !tbaa !9
  %168 = load i32, ptr %10, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %169
  %171 = load i32, ptr %10, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [9 x double], ptr %170, i64 0, i64 %172
  %174 = load double, ptr %173, align 8, !tbaa !9
  %175 = fdiv double %167, %174
  %176 = load i32, ptr %10, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [9 x double], ptr @sei, i64 0, i64 %177
  store double %175, ptr %178, align 8, !tbaa !9
  br label %179

179:                                              ; preds = %159
  %180 = load i32, ptr %10, align 4, !tbaa !5
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %10, align 4, !tbaa !5
  br label %154, !llvm.loop !17

182:                                              ; preds = %158
  store i1 true, ptr %1, align 1
  br label %183

183:                                              ; preds = %182, %151
  %184 = load i1, ptr %1, align 1
  ret i1 %184

185:                                              ; preds = %151
  unreachable
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z4dcmpdd(double noundef, double noundef) #2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sgnd(double noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIdENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

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

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 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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

@d = external dso_local local_unnamed_addr global i32, align 4
@mat = external dso_local global [9 x [9 x double]], align 16
@sei = external dso_local local_unnamed_addr global [9 x double], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z5gaussv() local_unnamed_addr #0 {
  %1 = load i32, ptr @d, align 4, !tbaa !5
  %.not85 = icmp slt i32 %1, 0
  br i1 %.not85, label %.critedge.thread, label %.lr.ph89

.critedge.preheader:                              ; preds = %._crit_edge84
  %.not5991 = icmp slt i32 %45, 0
  br i1 %.not5991, label %.critedge.thread, label %.lr.ph93

.lr.ph93:                                         ; preds = %.critedge.preheader
  %2 = add nuw nsw i32 %45, 1
  %3 = zext nneg i32 %2 to i64
  %min.iters.check138 = icmp eq i32 %45, 0
  br i1 %min.iters.check138, label %.critedge.preheader147, label %vector.ph139

.critedge.preheader147:                           ; preds = %middle.block136, %.lr.ph93
  %indvars.iv116.ph = phi i64 [ 0, %.lr.ph93 ], [ %n.vec141, %middle.block136 ]
  br label %.critedge

vector.ph139:                                     ; preds = %.lr.ph93
  %n.vec141 = and i64 %3, 2147483646
  br label %vector.body143

vector.body143:                                   ; preds = %vector.body143, %vector.ph139
  %index144 = phi i64 [ 0, %vector.ph139 ], [ %index.next145, %vector.body143 ]
  %4 = or disjoint i64 %index144, 1
  %5 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %index144, i64 %3
  %6 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %4, i64 %3
  %7 = load double, ptr %5, align 8, !tbaa !9
  %8 = load double, ptr %6, align 8, !tbaa !9
  %9 = insertelement <2 x double> poison, double %7, i64 0
  %10 = insertelement <2 x double> %9, double %8, i64 1
  %11 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %index144, i64 %index144
  %12 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %4, i64 %4
  %13 = load double, ptr %11, align 16, !tbaa !9
  %14 = load double, ptr %12, align 16, !tbaa !9
  %15 = insertelement <2 x double> poison, double %13, i64 0
  %16 = insertelement <2 x double> %15, double %14, i64 1
  %17 = fdiv <2 x double> %10, %16
  %18 = getelementptr inbounds [9 x double], ptr @sei, i64 0, i64 %index144
  store <2 x double> %17, ptr %18, align 16, !tbaa !9
  %index.next145 = add nuw i64 %index144, 2
  %19 = icmp eq i64 %index.next145, %n.vec141
  br i1 %19, label %middle.block136, label %vector.body143, !llvm.loop !11

middle.block136:                                  ; preds = %vector.body143
  %cmp.n146 = icmp eq i64 %n.vec141, %3
  br i1 %cmp.n146, label %.critedge.thread, label %.critedge.preheader147

.lr.ph89:                                         ; preds = %0, %._crit_edge84
  %20 = phi i32 [ %45, %._crit_edge84 ], [ %1, %0 ]
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %._crit_edge84 ], [ 0, %0 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %._crit_edge84 ], [ 1, %0 ]
  %21 = shl nuw nsw i64 %indvars.iv103, 3
  %scevgep = getelementptr i8, ptr @mat, i64 %21
  %gep = getelementptr i8, ptr getelementptr (i8, ptr @mat, i64 -64), i64 %21
  %22 = mul nuw nsw i64 %indvars.iv103, 80
  %scevgep130 = getelementptr i8, ptr @mat, i64 %22
  %23 = or disjoint i64 %22, 8
  %scevgep131 = getelementptr i8, ptr @mat, i64 %23
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %24 = sext i32 %20 to i64
  %.not5569.not = icmp slt i64 %indvars.iv103, %24
  %25 = trunc i64 %indvars.iv103 to i32
  br i1 %.not5569.not, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph89
  %.049.lcssa = phi i32 [ %25, %.lr.ph89 ], [ %spec.select, %.lr.ph ]
  %26 = sext i32 %.049.lcssa to i64
  %27 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %26, i64 %indvars.iv103
  %28 = load double, ptr %27, align 8, !tbaa !9
  %29 = tail call noundef i32 @_Z3sgnd(double noundef %28)
  %.not56.not = icmp eq i32 %29, 0
  br i1 %.not56.not, label %.critedge.thread, label %.preheader64

.preheader64:                                     ; preds = %._crit_edge
  %30 = load i32, ptr @d, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  %32 = sext i32 %31 to i64
  %.not5772 = icmp sgt i64 %indvars.iv103, %32
  br i1 %.not5772, label %.preheader, label %.lr.ph74

.lr.ph:                                           ; preds = %.lr.ph89, %.lr.ph
  %indvars.iv100 = phi i64 [ %indvars.iv.next101, %.lr.ph ], [ %indvars.iv, %.lr.ph89 ]
  %.04970 = phi i32 [ %spec.select, %.lr.ph ], [ %25, %.lr.ph89 ]
  %33 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %indvars.iv100, i64 %indvars.iv103
  %34 = load double, ptr %33, align 8, !tbaa !9
  %35 = tail call double @llvm.fabs.f64(double %34)
  %36 = sext i32 %.04970 to i64
  %37 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %indvars.iv100, i64 %36
  %38 = load double, ptr %37, align 8, !tbaa !9
  %39 = tail call double @llvm.fabs.f64(double %38)
  %40 = tail call noundef i32 @_Z4dcmpdd(double noundef %35, double noundef %39)
  %41 = icmp sgt i32 %40, 0
  %42 = trunc nuw i64 %indvars.iv100 to i32
  %spec.select = select i1 %41, i32 %42, i32 %.04970
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %43 = load i32, ptr @d, align 4, !tbaa !5
  %.not55.not = icmp sgt i32 %43, %42
  br i1 %.not55.not, label %.lr.ph, label %._crit_edge, !llvm.loop !15

.preheader.loopexit:                              ; preds = %.lr.ph74
  %44 = add nsw i32 %59, 1
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %.preheader64
  %45 = phi i32 [ %30, %.preheader64 ], [ %59, %.preheader.loopexit ]
  %.lcssa = phi i32 [ %31, %.preheader64 ], [ %44, %.preheader.loopexit ]
  %.not5881 = icmp slt i32 %45, 0
  br i1 %.not5881, label %._crit_edge84, label %.lr.ph83

.lr.ph83:                                         ; preds = %.preheader
  %46 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %indvars.iv103, i64 %indvars.iv103
  %47 = sext i32 %.lcssa to i64
  %.not6077 = icmp sgt i64 %indvars.iv103, %47
  %.not6077.fr = freeze i1 %.not6077
  br i1 %.not6077.fr, label %._crit_edge84, label %.lr.ph83.split.preheader

.lr.ph83.split.preheader:                         ; preds = %.lr.ph83
  %smax = tail call i32 @llvm.smax.i32(i32 %.lcssa, i32 %25)
  %48 = add nuw i32 %smax, 1
  %49 = add nuw i32 %45, 1
  %wide.trip.count114 = zext i32 %49 to i64
  %wide.trip.count = zext i32 %48 to i64
  %50 = mul nuw nsw i64 %wide.trip.count114, 72
  %51 = zext nneg i32 %smax to i64
  %52 = sub nsw i64 %51, %indvars.iv103
  %53 = shl nsw i64 %52, 3
  %54 = getelementptr i8, ptr %gep, i64 %50
  %scevgep129 = getelementptr i8, ptr %54, i64 %53
  %scevgep132 = getelementptr i8, ptr %scevgep131, i64 %53
  %55 = zext i32 %smax to i64
  %reass.sub = sub nsw i64 %55, %indvars.iv103
  %56 = add i64 %reass.sub, 1
  %min.iters.check = icmp ult i64 %56, 4
  %bound0 = icmp ult ptr %scevgep, %scevgep132
  %bound1 = icmp ult ptr %scevgep130, %scevgep129
  %found.conflict = and i1 %bound0, %bound1
  %n.vec = and i64 %56, -4
  %ind.end = add i64 %indvars.iv103, %n.vec
  %cmp.n = icmp eq i64 %56, %n.vec
  br label %.lr.ph83.split

.lr.ph74:                                         ; preds = %.preheader64, %.lr.ph74
  %indvars.iv105 = phi i64 [ %indvars.iv.next106, %.lr.ph74 ], [ %indvars.iv103, %.preheader64 ]
  %57 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %indvars.iv103, i64 %indvars.iv105
  %58 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %26, i64 %indvars.iv105
  tail call void @_ZSt4swapIdENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef nonnull align 8 dereferenceable(8) %58) #5
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %59 = load i32, ptr @d, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %.not57 = icmp sgt i64 %indvars.iv105, %60
  br i1 %.not57, label %.preheader.loopexit, label %.lr.ph74, !llvm.loop !16

.lr.ph83.split:                                   ; preds = %.lr.ph83.split.preheader, %..loopexit_crit_edge
  %indvars.iv111 = phi i64 [ 0, %.lr.ph83.split.preheader ], [ %indvars.iv.next112, %..loopexit_crit_edge ]
  %61 = icmp eq i64 %indvars.iv111, %indvars.iv103
  br i1 %61, label %..loopexit_crit_edge, label %.lr.ph80

.lr.ph80:                                         ; preds = %.lr.ph83.split
  %62 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %indvars.iv111, i64 %indvars.iv103
  %63 = load double, ptr %62, align 8, !tbaa !9
  %64 = load double, ptr %46, align 8, !tbaa !9
  %65 = fneg double %63
  %66 = fdiv double %65, %64
  %brmerge = select i1 %min.iters.check, i1 true, i1 %found.conflict
  br i1 %brmerge, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph80
  %broadcast.splatinsert = insertelement <2 x double> poison, double %66, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %indvars.iv103, %index
  %67 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %indvars.iv103, i64 %offset.idx
  %68 = getelementptr inbounds i8, ptr %67, i64 16
  %wide.load = load <2 x double>, ptr %67, align 8, !tbaa !9, !alias.scope !17
  %wide.load133 = load <2 x double>, ptr %68, align 8, !tbaa !9, !alias.scope !17
  %69 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %indvars.iv111, i64 %offset.idx
  %70 = getelementptr inbounds i8, ptr %69, i64 16
  %wide.load134 = load <2 x double>, ptr %69, align 8, !tbaa !9, !alias.scope !20, !noalias !17
  %wide.load135 = load <2 x double>, ptr %70, align 8, !tbaa !9, !alias.scope !20, !noalias !17
  %71 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat, <2 x double> %wide.load, <2 x double> %wide.load134)
  %72 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat, <2 x double> %wide.load133, <2 x double> %wide.load135)
  store <2 x double> %71, ptr %69, align 8, !tbaa !9, !alias.scope !20, !noalias !17
  store <2 x double> %72, ptr %70, align 8, !tbaa !9, !alias.scope !20, !noalias !17
  %index.next = add nuw i64 %index, 4
  %73 = icmp eq i64 %index.next, %n.vec
  br i1 %73, label %middle.block, label %vector.body, !llvm.loop !22

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %..loopexit_crit_edge, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %.lr.ph80, %middle.block
  %indvars.iv108.ph = phi i64 [ %indvars.iv103, %.lr.ph80 ], [ %ind.end, %middle.block ]
  %74 = add i64 %indvars.iv108.ph, %55
  %75 = and i64 %74, 1
  %lcmp.mod.not.not = icmp eq i64 %75, 0
  br i1 %lcmp.mod.not.not, label %scalar.ph.prol, label %scalar.ph.prol.loopexit

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %76 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %indvars.iv103, i64 %indvars.iv108.ph
  %77 = load double, ptr %76, align 8, !tbaa !9
  %78 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %indvars.iv111, i64 %indvars.iv108.ph
  %79 = load double, ptr %78, align 8, !tbaa !9
  %80 = tail call double @llvm.fmuladd.f64(double %66, double %77, double %79)
  store double %80, ptr %78, align 8, !tbaa !9
  %indvars.iv.next109.prol = add nuw nsw i64 %indvars.iv108.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv108.unr = phi i64 [ %indvars.iv108.ph, %scalar.ph.preheader ], [ %indvars.iv.next109.prol, %scalar.ph.prol ]
  %81 = icmp eq i64 %indvars.iv108.ph, %55
  br i1 %81, label %..loopexit_crit_edge, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv108 = phi i64 [ %indvars.iv.next109.1, %scalar.ph ], [ %indvars.iv108.unr, %scalar.ph.prol.loopexit ]
  %82 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %indvars.iv103, i64 %indvars.iv108
  %83 = load double, ptr %82, align 8, !tbaa !9
  %84 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %indvars.iv111, i64 %indvars.iv108
  %85 = load double, ptr %84, align 8, !tbaa !9
  %86 = tail call double @llvm.fmuladd.f64(double %66, double %83, double %85)
  store double %86, ptr %84, align 8, !tbaa !9
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %87 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %indvars.iv103, i64 %indvars.iv.next109
  %88 = load double, ptr %87, align 8, !tbaa !9
  %89 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %indvars.iv111, i64 %indvars.iv.next109
  %90 = load double, ptr %89, align 8, !tbaa !9
  %91 = tail call double @llvm.fmuladd.f64(double %66, double %88, double %90)
  store double %91, ptr %89, align 8, !tbaa !9
  %indvars.iv.next109.1 = add nuw nsw i64 %indvars.iv108, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next109.1, %wide.trip.count
  br i1 %exitcond.not.1, label %..loopexit_crit_edge, label %scalar.ph, !llvm.loop !23

..loopexit_crit_edge:                             ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %.lr.ph83.split
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %exitcond115.not = icmp eq i64 %indvars.iv.next112, %wide.trip.count114
  br i1 %exitcond115.not, label %._crit_edge84, label %.lr.ph83.split, !llvm.loop !24

._crit_edge84:                                    ; preds = %..loopexit_crit_edge, %.lr.ph83, %.preheader
  %92 = sext i32 %45 to i64
  %.not.not = icmp slt i64 %indvars.iv103, %92
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br i1 %.not.not, label %.lr.ph89, label %.critedge.preheader

.critedge:                                        ; preds = %.critedge.preheader147, %.critedge
  %indvars.iv116 = phi i64 [ %indvars.iv.next117, %.critedge ], [ %indvars.iv116.ph, %.critedge.preheader147 ]
  %93 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %indvars.iv116, i64 %3
  %94 = load double, ptr %93, align 8, !tbaa !9
  %95 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %indvars.iv116, i64 %indvars.iv116
  %96 = load double, ptr %95, align 8, !tbaa !9
  %97 = fdiv double %94, %96
  %98 = getelementptr inbounds [9 x double], ptr @sei, i64 0, i64 %indvars.iv116
  store double %97, ptr %98, align 8, !tbaa !9
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %exitcond120.not = icmp eq i64 %indvars.iv.next117, %3
  br i1 %exitcond120.not, label %.critedge.thread, label %.critedge, !llvm.loop !25

.critedge.thread:                                 ; preds = %._crit_edge, %.critedge, %middle.block136, %0, %.critedge.preheader
  %.not68 = phi i1 [ true, %.critedge.preheader ], [ true, %0 ], [ true, %middle.block136 ], [ true, %.critedge ], [ false, %._crit_edge ]
  ret i1 %.not68
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z4dcmpdd(double noundef, double noundef) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sgnd(double noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIdENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #4

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 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = !{!18}
!18 = distinct !{!18, !19}
!19 = distinct !{!19, !"LVerDomain"}
!20 = !{!21}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !12, !13, !14}
!23 = distinct !{!23, !12, !13}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12, !14, !13}


; Effective O3 passes: ConstraintEliminationPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SROAPass,SimplifyCFGPass,TailCallElimPass