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

; 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
@val = external dso_local global [9 x double], align 16
@mat = external dso_local global [9 x [9 x double]], align 16
@sei = external dso_local global [9 x double], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5gaussv() #0

; 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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %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 double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  br label %15

15:                                               ; preds = %176, %0
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @d)
  %17 = icmp eq i32 %16, 1
  br i1 %17, label %18, label %21

18:                                               ; preds = %15
  %19 = load i32, ptr @d, align 4, !tbaa !5
  %20 = icmp ne i32 %19, 0
  br label %21

21:                                               ; preds = %18, %15
  %22 = phi i1 [ false, %15 ], [ %20, %18 ]
  br i1 %22, label %23, label %177

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

24:                                               ; preds = %35, %23
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = load i32, ptr @d, align 4, !tbaa !5
  %27 = add nsw i32 %26, 2
  %28 = icmp sle i32 %25, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %38

30:                                               ; preds = %24
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds double, ptr @val, i64 %32
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %33)
  br label %35

35:                                               ; preds = %30
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %2, align 4, !tbaa !5
  br label %24, !llvm.loop !9

38:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %172, %38
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = load i32, ptr @d, align 4, !tbaa !5
  %42 = add nsw i32 %41, 2
  %43 = icmp sle i32 %40, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %39
  store i32 7, ptr %4, align 4
  br label %175

45:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = load i32, ptr @d, align 4, !tbaa !5
  %48 = add nsw i32 %47, 2
  %49 = icmp eq i32 %46, %48
  br i1 %49, label %50, label %53

50:                                               ; preds = %45
  %51 = load i32, ptr @d, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  br label %56

53:                                               ; preds = %45
  %54 = load i32, ptr @d, align 4, !tbaa !5
  %55 = add nsw i32 %54, 2
  br label %56

56:                                               ; preds = %53, %50
  %57 = phi i32 [ %52, %50 ], [ %55, %53 ]
  store i32 %57, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %108, %56
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = load i32, ptr @d, align 4, !tbaa !5
  %61 = add nsw i32 %60, 2
  %62 = icmp sle i32 %59, %61
  br i1 %62, label %64, label %63

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

64:                                               ; preds = %58
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = icmp eq i32 %65, %66
  br i1 %67, label %72, label %68

68:                                               ; preds = %64
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = icmp eq i32 %69, %70
  br i1 %71, label %72, label %73

72:                                               ; preds = %68, %64
  br label %108

73:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store double 1.000000e+00, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %87, %73
  %75 = load i32, ptr %9, align 4, !tbaa !5
  %76 = load i32, ptr @d, align 4, !tbaa !5
  %77 = icmp sle i32 %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  store i32 13, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %94

79:                                               ; preds = %74
  %80 = load double, ptr %8, align 8, !tbaa !11
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %82
  %84 = load i32, ptr %9, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [9 x double], ptr %83, i64 0, i64 %85
  store double %80, ptr %86, align 8, !tbaa !11
  br label %87

87:                                               ; preds = %79
  %88 = load i32, ptr %9, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %9, align 4, !tbaa !5
  %90 = load i32, ptr %6, align 4, !tbaa !5
  %91 = sitofp i32 %90 to double
  %92 = load double, ptr %8, align 8, !tbaa !11
  %93 = fmul double %92, %91
  store double %93, ptr %8, align 8, !tbaa !11
  br label %74, !llvm.loop !13

94:                                               ; preds = %78
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [9 x double], ptr @val, i64 0, i64 %96
  %98 = load double, ptr %97, align 8, !tbaa !11
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %100
  %102 = load i32, ptr @d, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [9 x double], ptr %101, i64 0, i64 %104
  store double %98, ptr %105, align 8, !tbaa !11
  %106 = load i32, ptr %7, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %108

108:                                              ; preds = %94, %72
  %109 = load i32, ptr %6, align 4, !tbaa !5
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %6, align 4, !tbaa !5
  br label %58, !llvm.loop !14

111:                                              ; preds = %63
  %112 = call noundef zeroext i1 @_Z5gaussv()
  br i1 %112, label %113, label %168

113:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store double 0.000000e+00, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store double 0.000000e+00, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store double 1.000000e+00, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store double 1.000000e+00, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %134, %113
  %115 = load i32, ptr %14, align 4, !tbaa !5
  %116 = load i32, ptr @d, align 4, !tbaa !5
  %117 = icmp sle i32 %115, %116
  br i1 %117, label %119, label %118

118:                                              ; preds = %114
  store i32 16, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %145

119:                                              ; preds = %114
  %120 = load i32, ptr %14, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [9 x double], ptr @sei, i64 0, i64 %121
  %123 = load double, ptr %122, align 8, !tbaa !11
  %124 = load double, ptr %12, align 8, !tbaa !11
  %125 = load double, ptr %10, align 8, !tbaa !11
  %126 = call double @llvm.fmuladd.f64(double %123, double %124, double %125)
  store double %126, ptr %10, align 8, !tbaa !11
  %127 = load i32, ptr %14, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [9 x double], ptr @sei, i64 0, i64 %128
  %130 = load double, ptr %129, align 8, !tbaa !11
  %131 = load double, ptr %13, align 8, !tbaa !11
  %132 = load double, ptr %11, align 8, !tbaa !11
  %133 = call double @llvm.fmuladd.f64(double %130, double %131, double %132)
  store double %133, ptr %11, align 8, !tbaa !11
  br label %134

134:                                              ; preds = %119
  %135 = load i32, ptr %14, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %14, align 4, !tbaa !5
  %137 = load i32, ptr %3, align 4, !tbaa !5
  %138 = sitofp i32 %137 to double
  %139 = load double, ptr %12, align 8, !tbaa !11
  %140 = fmul double %139, %138
  store double %140, ptr %12, align 8, !tbaa !11
  %141 = load i32, ptr %5, align 4, !tbaa !5
  %142 = sitofp i32 %141 to double
  %143 = load double, ptr %13, align 8, !tbaa !11
  %144 = fmul double %143, %142
  store double %144, ptr %13, align 8, !tbaa !11
  br label %114, !llvm.loop !15

145:                                              ; preds = %118
  %146 = load double, ptr %10, align 8, !tbaa !11
  %147 = load i32, ptr %3, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [9 x double], ptr @val, i64 0, i64 %148
  %150 = load double, ptr %149, align 8, !tbaa !11
  %151 = call noundef i32 @_Z4dcmpdd(double noundef %146, double noundef %150)
  %152 = icmp ne i32 %151, 0
  br i1 %152, label %153, label %164

153:                                              ; preds = %145
  %154 = load double, ptr %11, align 8, !tbaa !11
  %155 = load i32, ptr %5, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [9 x double], ptr @val, i64 0, i64 %156
  %158 = load double, ptr %157, align 8, !tbaa !11
  %159 = call noundef i32 @_Z4dcmpdd(double noundef %154, double noundef %158)
  %160 = icmp ne i32 %159, 0
  br i1 %160, label %164, label %161

161:                                              ; preds = %153
  %162 = load i32, ptr %3, align 4, !tbaa !5
  %163 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %162)
  store i32 7, ptr %4, align 4
  br label %165

164:                                              ; preds = %153, %145
  store i32 0, ptr %4, align 4
  br label %165

165:                                              ; preds = %164, %161
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %166 = load i32, ptr %4, align 4
  switch i32 %166, label %169 [
    i32 0, label %167
  ]

167:                                              ; preds = %165
  br label %168

168:                                              ; preds = %167, %111
  store i32 0, ptr %4, align 4
  br label %169

169:                                              ; preds = %168, %165
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  %170 = load i32, ptr %4, align 4
  switch i32 %170, label %175 [
    i32 0, label %171
  ]

171:                                              ; preds = %169
  br label %172

172:                                              ; preds = %171
  %173 = load i32, ptr %3, align 4, !tbaa !5
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %3, align 4, !tbaa !5
  br label %39, !llvm.loop !16

175:                                              ; preds = %169, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %176

176:                                              ; preds = %175
  br label %15, !llvm.loop !17

177:                                              ; preds = %21
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #5

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

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 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

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


; 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 global i32, align 4
@val = external dso_local global [9 x double], align 16
@mat = external dso_local local_unnamed_addr global [9 x [9 x double]], align 16
@sei = external dso_local local_unnamed_addr global [9 x double], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5gaussv() local_unnamed_addr #0

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @d)
  %2 = icmp eq i32 %1, 1
  %3 = load i32, ptr @d, align 4
  %4 = icmp ne i32 %3, 0
  %5 = select i1 %2, i1 %4, i1 false
  br i1 %5, label %.preheader69, label %._crit_edge96

.preheader69:                                     ; preds = %0, %.loopexit
  %6 = phi i32 [ %127, %.loopexit ], [ %3, %0 ]
  %.not71 = icmp slt i32 %6, -2
  br i1 %.not71, label %.loopexit, label %.lr.ph

.preheader68:                                     ; preds = %.lr.ph
  %.not5592 = icmp slt i32 %9, -2
  br i1 %.not5592, label %.loopexit, label %.lr.ph95

.lr.ph:                                           ; preds = %.preheader69, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader69 ]
  %7 = getelementptr inbounds double, ptr @val, i64 %indvars.iv
  %8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %7)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %9 = load i32, ptr @d, align 4
  %10 = add nsw i32 %9, 2
  %11 = sext i32 %10 to i64
  %.not.not = icmp slt i64 %indvars.iv, %11
  br i1 %.not.not, label %.lr.ph, label %.preheader68, !llvm.loop !5

.lr.ph95:                                         ; preds = %.preheader68, %.thread
  %indvars.iv119 = phi i64 [ %indvars.iv.next120, %.thread ], [ 0, %.preheader68 ]
  %12 = phi i32 [ %123, %.thread ], [ %10, %.preheader68 ]
  %13 = phi i32 [ %122, %.thread ], [ %9, %.preheader68 ]
  %.fr = freeze i32 %13
  %14 = zext i32 %12 to i64
  %15 = icmp eq i64 %indvars.iv119, %14
  %16 = add i32 %.fr, 1
  %17 = select i1 %15, i32 %16, i32 %12
  %.not5677 = icmp slt i32 %12, 0
  br i1 %.not5677, label %._crit_edge82, label %.lr.ph81

.lr.ph81:                                         ; preds = %.lr.ph95
  %.not6073 = icmp slt i32 %.fr, 0
  %18 = sext i32 %16 to i64
  %19 = zext i32 %17 to i64
  %20 = add nuw i32 %12, 1
  %wide.trip.count112 = zext i32 %20 to i64
  br i1 %.not6073, label %.lr.ph81.split.us.preheader, label %.lr.ph81.split.preheader

.lr.ph81.split.us.preheader:                      ; preds = %.lr.ph81
  %xtraiter138 = and i64 %wide.trip.count112, 1
  %21 = icmp eq i32 %12, 0
  br i1 %21, label %._crit_edge82.loopexit.unr-lcssa, label %.lr.ph81.split.us.preheader.new

.lr.ph81.split.us.preheader.new:                  ; preds = %.lr.ph81.split.us.preheader
  %unroll_iter141 = and i64 %wide.trip.count112, 4294967294
  br label %.lr.ph81.split.us

.lr.ph81.split.preheader:                         ; preds = %.lr.ph81
  %wide.trip.count = zext i32 %16 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %22 = icmp ult i32 %16, 4
  %unroll_iter = and i64 %wide.trip.count, 4294967292
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.lr.ph81.split

.lr.ph81.split.us:                                ; preds = %32, %.lr.ph81.split.us.preheader.new
  %indvars.iv109 = phi i64 [ 0, %.lr.ph81.split.us.preheader.new ], [ %indvars.iv.next110.1, %32 ]
  %.04779.us = phi i32 [ 0, %.lr.ph81.split.us.preheader.new ], [ %.1.us.1, %32 ]
  %niter142 = phi i64 [ 0, %.lr.ph81.split.us.preheader.new ], [ %niter142.next.1, %32 ]
  %23 = icmp eq i64 %indvars.iv109, %indvars.iv119
  %24 = icmp eq i64 %indvars.iv109, %19
  %or.cond.us = select i1 %23, i1 true, i1 %24
  br i1 %or.cond.us, label %.lr.ph81.split.us.1, label %.preheader.us

.lr.ph81.split.us.1:                              ; preds = %.preheader.us, %.lr.ph81.split.us
  %.1.us = phi i32 [ %.04779.us, %.lr.ph81.split.us ], [ %37, %.preheader.us ]
  %indvars.iv.next110 = or disjoint i64 %indvars.iv109, 1
  %25 = icmp eq i64 %indvars.iv.next110, %indvars.iv119
  %26 = icmp eq i64 %indvars.iv.next110, %19
  %or.cond.us.1 = select i1 %25, i1 true, i1 %26
  br i1 %or.cond.us.1, label %32, label %.preheader.us.1

.preheader.us.1:                                  ; preds = %.lr.ph81.split.us.1
  %27 = getelementptr inbounds [9 x double], ptr @val, i64 0, i64 %indvars.iv.next110
  %28 = load double, ptr %27, align 8, !tbaa !7
  %29 = sext i32 %.1.us to i64
  %30 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %29, i64 %18
  store double %28, ptr %30, align 8, !tbaa !7
  %31 = add nsw i32 %.1.us, 1
  br label %32

32:                                               ; preds = %.preheader.us.1, %.lr.ph81.split.us.1
  %.1.us.1 = phi i32 [ %.1.us, %.lr.ph81.split.us.1 ], [ %31, %.preheader.us.1 ]
  %indvars.iv.next110.1 = add nuw nsw i64 %indvars.iv109, 2
  %niter142.next.1 = add i64 %niter142, 2
  %niter142.ncmp.1 = icmp eq i64 %niter142.next.1, %unroll_iter141
  br i1 %niter142.ncmp.1, label %._crit_edge82.loopexit.unr-lcssa, label %.lr.ph81.split.us, !llvm.loop !11

.preheader.us:                                    ; preds = %.lr.ph81.split.us
  %33 = getelementptr inbounds [9 x double], ptr @val, i64 0, i64 %indvars.iv109
  %34 = load double, ptr %33, align 16, !tbaa !7
  %35 = sext i32 %.04779.us to i64
  %36 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %35, i64 %18
  store double %34, ptr %36, align 8, !tbaa !7
  %37 = add nsw i32 %.04779.us, 1
  br label %.lr.ph81.split.us.1

._crit_edge82.loopexit.unr-lcssa:                 ; preds = %32, %.lr.ph81.split.us.preheader
  %indvars.iv109.unr = phi i64 [ 0, %.lr.ph81.split.us.preheader ], [ %indvars.iv.next110.1, %32 ]
  %.04779.us.unr = phi i32 [ 0, %.lr.ph81.split.us.preheader ], [ %.1.us.1, %32 ]
  %lcmp.mod140.not = icmp eq i64 %xtraiter138, 0
  br i1 %lcmp.mod140.not, label %._crit_edge82, label %.lr.ph81.split.us.epil

.lr.ph81.split.us.epil:                           ; preds = %._crit_edge82.loopexit.unr-lcssa
  %38 = icmp eq i64 %indvars.iv109.unr, %indvars.iv119
  %39 = icmp eq i64 %indvars.iv109.unr, %19
  %or.cond.us.epil = select i1 %38, i1 true, i1 %39
  br i1 %or.cond.us.epil, label %._crit_edge82, label %.preheader.us.epil

.preheader.us.epil:                               ; preds = %.lr.ph81.split.us.epil
  %40 = getelementptr inbounds [9 x double], ptr @val, i64 0, i64 %indvars.iv109.unr
  %41 = load double, ptr %40, align 8, !tbaa !7
  %42 = sext i32 %.04779.us.unr to i64
  %43 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %42, i64 %18
  store double %41, ptr %43, align 8, !tbaa !7
  br label %._crit_edge82

._crit_edge82:                                    ; preds = %72, %._crit_edge82.loopexit.unr-lcssa, %.preheader.us.epil, %.lr.ph81.split.us.epil, %.lr.ph95
  %44 = tail call noundef zeroext i1 @_Z5gaussv()
  br i1 %44, label %.preheader67, label %.thread

.preheader67:                                     ; preds = %._crit_edge82
  %45 = load i32, ptr @d, align 4, !tbaa !12
  %.not5783 = icmp slt i32 %45, 0
  br i1 %.not5783, label %._crit_edge90, label %.lr.ph89

.lr.ph89:                                         ; preds = %.preheader67
  %46 = trunc nuw nsw i64 %indvars.iv119 to i32
  %47 = uitofp nneg i32 %46 to double
  %48 = sitofp i32 %17 to double
  %49 = add nuw i32 %45, 1
  %wide.trip.count117 = zext i32 %49 to i64
  %50 = insertelement <2 x double> poison, double %47, i64 0
  %51 = insertelement <2 x double> %50, double %48, i64 1
  %xtraiter144 = and i64 %wide.trip.count117, 3
  %52 = icmp ult i32 %45, 3
  br i1 %52, label %._crit_edge90.loopexit.unr-lcssa, label %.lr.ph89.new

.lr.ph89.new:                                     ; preds = %.lr.ph89
  %unroll_iter149 = and i64 %wide.trip.count117, 4294967292
  br label %86

.lr.ph81.split:                                   ; preds = %.lr.ph81.split.preheader, %72
  %indvars.iv104 = phi i64 [ 0, %.lr.ph81.split.preheader ], [ %indvars.iv.next105, %72 ]
  %.04779 = phi i32 [ 0, %.lr.ph81.split.preheader ], [ %.1, %72 ]
  %53 = icmp eq i64 %indvars.iv104, %indvars.iv119
  %54 = icmp eq i64 %indvars.iv104, %19
  %or.cond = select i1 %53, i1 true, i1 %54
  br i1 %or.cond, label %72, label %.preheader

.preheader:                                       ; preds = %.lr.ph81.split
  %55 = sext i32 %.04779 to i64
  %56 = trunc nuw nsw i64 %indvars.iv104 to i32
  %57 = uitofp nneg i32 %56 to double
  br i1 %22, label %._crit_edge.unr-lcssa, label %.preheader.new

._crit_edge.unr-lcssa:                            ; preds = %.preheader.new, %.preheader
  %indvars.iv101.unr = phi i64 [ 0, %.preheader ], [ %indvars.iv.next102.3, %.preheader.new ]
  %.04674.unr = phi double [ 1.000000e+00, %.preheader ], [ %71, %.preheader.new ]
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.unr-lcssa, %.epil.preheader
  %indvars.iv101.epil = phi i64 [ %indvars.iv.next102.epil, %.epil.preheader ], [ %indvars.iv101.unr, %._crit_edge.unr-lcssa ]
  %.04674.epil = phi double [ %59, %.epil.preheader ], [ %.04674.unr, %._crit_edge.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.unr-lcssa ]
  %58 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %55, i64 %indvars.iv101.epil
  store double %.04674.epil, ptr %58, align 8, !tbaa !7
  %indvars.iv.next102.epil = add nuw nsw i64 %indvars.iv101.epil, 1
  %59 = fmul double %.04674.epil, %57
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.epil.preheader, !llvm.loop !14

._crit_edge:                                      ; preds = %.epil.preheader, %._crit_edge.unr-lcssa
  %60 = getelementptr inbounds [9 x double], ptr @val, i64 0, i64 %indvars.iv104
  %61 = load double, ptr %60, align 8, !tbaa !7
  %62 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %55, i64 %18
  store double %61, ptr %62, align 8, !tbaa !7
  %63 = add nsw i32 %.04779, 1
  br label %72

.preheader.new:                                   ; preds = %.preheader, %.preheader.new
  %indvars.iv101 = phi i64 [ %indvars.iv.next102.3, %.preheader.new ], [ 0, %.preheader ]
  %.04674 = phi double [ %71, %.preheader.new ], [ 1.000000e+00, %.preheader ]
  %niter = phi i64 [ %niter.next.3, %.preheader.new ], [ 0, %.preheader ]
  %64 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %55, i64 %indvars.iv101
  store double %.04674, ptr %64, align 8, !tbaa !7
  %indvars.iv.next102 = or disjoint i64 %indvars.iv101, 1
  %65 = fmul double %.04674, %57
  %66 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %55, i64 %indvars.iv.next102
  store double %65, ptr %66, align 8, !tbaa !7
  %indvars.iv.next102.1 = or disjoint i64 %indvars.iv101, 2
  %67 = fmul double %65, %57
  %68 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %55, i64 %indvars.iv.next102.1
  store double %67, ptr %68, align 8, !tbaa !7
  %indvars.iv.next102.2 = or disjoint i64 %indvars.iv101, 3
  %69 = fmul double %67, %57
  %70 = getelementptr inbounds [9 x [9 x double]], ptr @mat, i64 0, i64 %55, i64 %indvars.iv.next102.2
  store double %69, ptr %70, align 8, !tbaa !7
  %indvars.iv.next102.3 = add nuw nsw i64 %indvars.iv101, 4
  %71 = fmul double %69, %57
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.unr-lcssa, label %.preheader.new, !llvm.loop !16

72:                                               ; preds = %.lr.ph81.split, %._crit_edge
  %.1 = phi i32 [ %.04779, %.lr.ph81.split ], [ %63, %._crit_edge ]
  %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
  %exitcond108.not = icmp eq i64 %indvars.iv.next105, %wide.trip.count112
  br i1 %exitcond108.not, label %._crit_edge82, label %.lr.ph81.split, !llvm.loop !11

._crit_edge90.loopexit.unr-lcssa:                 ; preds = %86, %.lr.ph89
  %.lcssa136.ph = phi <2 x double> [ poison, %.lr.ph89 ], [ %111, %86 ]
  %indvars.iv114.unr = phi i64 [ 0, %.lr.ph89 ], [ %indvars.iv.next115.3, %86 ]
  %.unr = phi <2 x double> [ <double 1.000000e+00, double 1.000000e+00>, %.lr.ph89 ], [ %112, %86 ]
  %.unr146 = phi <2 x double> [ zeroinitializer, %.lr.ph89 ], [ %111, %86 ]
  %lcmp.mod147.not = icmp eq i64 %xtraiter144, 0
  br i1 %lcmp.mod147.not, label %._crit_edge90, label %.epil.preheader143

.epil.preheader143:                               ; preds = %._crit_edge90.loopexit.unr-lcssa, %.epil.preheader143
  %indvars.iv114.epil = phi i64 [ %indvars.iv.next115.epil, %.epil.preheader143 ], [ %indvars.iv114.unr, %._crit_edge90.loopexit.unr-lcssa ]
  %73 = phi <2 x double> [ %80, %.epil.preheader143 ], [ %.unr, %._crit_edge90.loopexit.unr-lcssa ]
  %74 = phi <2 x double> [ %79, %.epil.preheader143 ], [ %.unr146, %._crit_edge90.loopexit.unr-lcssa ]
  %epil.iter145 = phi i64 [ %epil.iter145.next, %.epil.preheader143 ], [ 0, %._crit_edge90.loopexit.unr-lcssa ]
  %75 = getelementptr inbounds [9 x double], ptr @sei, i64 0, i64 %indvars.iv114.epil
  %76 = load double, ptr %75, align 8, !tbaa !7
  %77 = insertelement <2 x double> poison, double %76, i64 0
  %78 = shufflevector <2 x double> %77, <2 x double> poison, <2 x i32> zeroinitializer
  %79 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %78, <2 x double> %73, <2 x double> %74)
  %indvars.iv.next115.epil = add nuw nsw i64 %indvars.iv114.epil, 1
  %80 = fmul <2 x double> %73, %51
  %epil.iter145.next = add i64 %epil.iter145, 1
  %epil.iter145.cmp.not = icmp eq i64 %epil.iter145.next, %xtraiter144
  br i1 %epil.iter145.cmp.not, label %._crit_edge90, label %.epil.preheader143, !llvm.loop !17

._crit_edge90:                                    ; preds = %._crit_edge90.loopexit.unr-lcssa, %.epil.preheader143, %.preheader67
  %81 = phi <2 x double> [ zeroinitializer, %.preheader67 ], [ %.lcssa136.ph, %._crit_edge90.loopexit.unr-lcssa ], [ %79, %.epil.preheader143 ]
  %82 = getelementptr inbounds [9 x double], ptr @val, i64 0, i64 %indvars.iv119
  %83 = load double, ptr %82, align 8, !tbaa !7
  %84 = extractelement <2 x double> %81, i64 0
  %85 = tail call noundef i32 @_Z4dcmpdd(double noundef %84, double noundef %83)
  %.not58 = icmp eq i32 %85, 0
  br i1 %.not58, label %.thread, label %113

86:                                               ; preds = %86, %.lr.ph89.new
  %indvars.iv114 = phi i64 [ 0, %.lr.ph89.new ], [ %indvars.iv.next115.3, %86 ]
  %87 = phi <2 x double> [ <double 1.000000e+00, double 1.000000e+00>, %.lr.ph89.new ], [ %112, %86 ]
  %88 = phi <2 x double> [ zeroinitializer, %.lr.ph89.new ], [ %111, %86 ]
  %niter150 = phi i64 [ 0, %.lr.ph89.new ], [ %niter150.next.3, %86 ]
  %89 = getelementptr inbounds [9 x double], ptr @sei, i64 0, i64 %indvars.iv114
  %90 = load double, ptr %89, align 16, !tbaa !7
  %91 = insertelement <2 x double> poison, double %90, i64 0
  %92 = shufflevector <2 x double> %91, <2 x double> poison, <2 x i32> zeroinitializer
  %93 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %92, <2 x double> %87, <2 x double> %88)
  %indvars.iv.next115 = or disjoint i64 %indvars.iv114, 1
  %94 = fmul <2 x double> %87, %51
  %95 = getelementptr inbounds [9 x double], ptr @sei, i64 0, i64 %indvars.iv.next115
  %96 = load double, ptr %95, align 8, !tbaa !7
  %97 = insertelement <2 x double> poison, double %96, i64 0
  %98 = shufflevector <2 x double> %97, <2 x double> poison, <2 x i32> zeroinitializer
  %99 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %98, <2 x double> %94, <2 x double> %93)
  %indvars.iv.next115.1 = or disjoint i64 %indvars.iv114, 2
  %100 = fmul <2 x double> %94, %51
  %101 = getelementptr inbounds [9 x double], ptr @sei, i64 0, i64 %indvars.iv.next115.1
  %102 = load double, ptr %101, align 16, !tbaa !7
  %103 = insertelement <2 x double> poison, double %102, i64 0
  %104 = shufflevector <2 x double> %103, <2 x double> poison, <2 x i32> zeroinitializer
  %105 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %104, <2 x double> %100, <2 x double> %99)
  %indvars.iv.next115.2 = or disjoint i64 %indvars.iv114, 3
  %106 = fmul <2 x double> %100, %51
  %107 = getelementptr inbounds [9 x double], ptr @sei, i64 0, i64 %indvars.iv.next115.2
  %108 = load double, ptr %107, align 8, !tbaa !7
  %109 = insertelement <2 x double> poison, double %108, i64 0
  %110 = shufflevector <2 x double> %109, <2 x double> poison, <2 x i32> zeroinitializer
  %111 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %110, <2 x double> %106, <2 x double> %105)
  %indvars.iv.next115.3 = add nuw nsw i64 %indvars.iv114, 4
  %112 = fmul <2 x double> %106, %51
  %niter150.next.3 = add i64 %niter150, 4
  %niter150.ncmp.3 = icmp eq i64 %niter150.next.3, %unroll_iter149
  br i1 %niter150.ncmp.3, label %._crit_edge90.loopexit.unr-lcssa, label %86, !llvm.loop !18

113:                                              ; preds = %._crit_edge90
  %114 = sext i32 %17 to i64
  %115 = getelementptr inbounds [9 x double], ptr @val, i64 0, i64 %114
  %116 = load double, ptr %115, align 8, !tbaa !7
  %117 = extractelement <2 x double> %81, i64 1
  %118 = tail call noundef i32 @_Z4dcmpdd(double noundef %117, double noundef %116)
  %.not59 = icmp eq i32 %118, 0
  br i1 %.not59, label %119, label %.thread

119:                                              ; preds = %113
  %120 = trunc nuw nsw i64 %indvars.iv119 to i32
  %121 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %120)
  br label %.loopexit

.thread:                                          ; preds = %._crit_edge90, %113, %._crit_edge82
  %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
  %122 = load i32, ptr @d, align 4
  %123 = add nsw i32 %122, 2
  %124 = sext i32 %123 to i64
  %.not55.not = icmp slt i64 %indvars.iv119, %124
  br i1 %.not55.not, label %.lr.ph95, label %.loopexit, !llvm.loop !19

.loopexit:                                        ; preds = %.thread, %.preheader69, %.preheader68, %119
  %125 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @d)
  %126 = icmp eq i32 %125, 1
  %127 = load i32, ptr @d, align 4
  %128 = icmp ne i32 %127, 0
  %129 = select i1 %126, i1 %128, i1 false
  br i1 %129, label %.preheader69, label %._crit_edge96, !llvm.loop !20

._crit_edge96:                                    ; preds = %.loopexit, %0
  ret i32 0
}

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

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

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

!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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !9, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !6}
!19 = distinct !{!19, !6}
!20 = distinct !{!20, !6}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass