; LLVM IR from Tunghohin/Competitive_Coding :: Uva/uva10870.ll (Z5solvev)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%struct.matrix = type { [20 x [20 x i64]] }

@a = external dso_local global [20 x i64], align 16
@f = external dso_local global [20 x i64], align 16
@d = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 {
  %1 = alloca %struct.matrix, align 8
  %2 = alloca %struct.matrix, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %struct.matrix, align 8
  %8 = alloca %struct.matrix, align 8
  %9 = alloca %struct.matrix, align 8
  %10 = alloca %struct.matrix, align 8
  %11 = alloca %struct.matrix, align 8
  %12 = alloca %struct.matrix, align 8
  call void @llvm.lifetime.start.p0(i64 3200, ptr %1) #5
  call void @llvm.lifetime.start.p0(i64 3200, ptr %2) #5
  call void @_ZN6matrix5clearEv(ptr noundef nonnull align 8 dereferenceable(3200) %1)
  call void @_ZN6matrix5clearEv(ptr noundef nonnull align 8 dereferenceable(3200) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %23, %0
  %14 = load i32, ptr %3, align 4, !tbaa !5
  %15 = load i32, ptr @d, align 4, !tbaa !5
  %16 = icmp sle i32 %14, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %26

18:                                               ; preds = %13
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [20 x i64], ptr @a, i64 0, i64 %20
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %21)
  br label %23

23:                                               ; preds = %18
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %3, align 4, !tbaa !5
  br label %13, !llvm.loop !9

26:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %37, %26
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = load i32, ptr @d, align 4, !tbaa !5
  %30 = icmp sle i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %40

32:                                               ; preds = %27
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [20 x i64], ptr @f, i64 0, i64 %34
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %35)
  br label %37

37:                                               ; preds = %32
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %4, align 4, !tbaa !5
  br label %27, !llvm.loop !11

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

41:                                               ; preds = %56, %40
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = load i32, ptr @d, align 4, !tbaa !5
  %44 = icmp sle i32 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %59

46:                                               ; preds = %41
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [20 x i64], ptr @f, i64 0, i64 %48
  %50 = load i64, ptr %49, align 8, !tbaa !12
  %51 = getelementptr inbounds %struct.matrix, ptr %1, i32 0, i32 0
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [20 x [20 x i64]], ptr %51, i64 0, i64 %53
  %55 = getelementptr inbounds [20 x i64], ptr %54, i64 0, i64 0
  store i64 %50, ptr %55, align 8, !tbaa !12
  br label %56

56:                                               ; preds = %46
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %5, align 4, !tbaa !5
  br label %41, !llvm.loop !14

59:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %88, %59
  %61 = load i32, ptr %6, align 4, !tbaa !5
  %62 = load i32, ptr @d, align 4, !tbaa !5
  %63 = icmp sle i32 %61, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %91

65:                                               ; preds = %60
  %66 = getelementptr inbounds %struct.matrix, ptr %2, i32 0, i32 0
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = sub nsw i32 %67, 1
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [20 x [20 x i64]], ptr %66, i64 0, i64 %69
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [20 x i64], ptr %70, i64 0, i64 %72
  store i64 1, ptr %73, align 8, !tbaa !12
  %74 = load i32, ptr @d, align 4, !tbaa !5
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = sub nsw i32 %74, %75
  %77 = add nsw i32 %76, 1
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [20 x i64], ptr @a, i64 0, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !12
  %81 = getelementptr inbounds %struct.matrix, ptr %2, i32 0, i32 0
  %82 = load i32, ptr @d, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [20 x [20 x i64]], ptr %81, i64 0, i64 %83
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [20 x i64], ptr %84, i64 0, i64 %86
  store i64 %80, ptr %87, align 8, !tbaa !12
  br label %88

88:                                               ; preds = %65
  %89 = load i32, ptr %6, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %6, align 4, !tbaa !5
  br label %60, !llvm.loop !15

91:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 3200, ptr %7) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %2, i64 3200, i1 false), !tbaa.struct !16
  %92 = load i32, ptr @n, align 4, !tbaa !5
  %93 = load i32, ptr @d, align 4, !tbaa !5
  %94 = sub nsw i32 %92, %93
  %95 = sext i32 %94 to i64
  call void @_Zeo6matrixx(ptr dead_on_unwind writable sret(%struct.matrix) align 8 %7, ptr noundef byval(%struct.matrix) align 8 %8, i64 noundef %95)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %2, ptr align 8 %7, i64 3200, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 3200, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 3200, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 3200, ptr %10) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %2, i64 3200, i1 false), !tbaa.struct !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %1, i64 3200, i1 false), !tbaa.struct !16
  call void @_Zml6matrixS_(ptr dead_on_unwind writable sret(%struct.matrix) align 8 %10, ptr noundef byval(%struct.matrix) align 8 %11, ptr noundef byval(%struct.matrix) align 8 %12)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %10, i64 3200, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 3200, ptr %10) #5
  %96 = getelementptr inbounds %struct.matrix, ptr %9, i32 0, i32 0
  %97 = load i32, ptr @d, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [20 x [20 x i64]], ptr %96, i64 0, i64 %98
  %100 = getelementptr inbounds [20 x i64], ptr %99, i64 0, i64 0
  %101 = load i64, ptr %100, align 8, !tbaa !12
  %102 = load i32, ptr @m, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = srem i64 %101, %103
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %104)
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %105, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 3200, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 3200, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 3200, ptr %1) #5
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6matrix5clearEv(ptr noundef nonnull align 8 dereferenceable(3200)) #2 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Zeo6matrixx(ptr dead_on_unwind noalias writable sret(%struct.matrix) align 8, ptr noundef byval(%struct.matrix) align 8, i64 noundef) #0

; 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) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Zml6matrixS_(ptr dead_on_unwind noalias writable sret(%struct.matrix) align 8, ptr noundef byval(%struct.matrix) align 8, ptr noundef byval(%struct.matrix) align 8) #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0 align 2

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 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = !{i64 0, i64 3200, !17}
!17 = !{!7, !7, i64 0}


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%struct.matrix = type { [20 x [20 x i64]] }

@a = external dso_local global [20 x i64], align 16
@f = external dso_local global [20 x i64], align 16
@d = external dso_local local_unnamed_addr global i32, align 4
@n = external dso_local local_unnamed_addr global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca %struct.matrix, align 8
  %2 = alloca %struct.matrix, align 8
  %3 = alloca %struct.matrix, align 8
  %4 = alloca %struct.matrix, align 8
  call void @llvm.lifetime.start.p0(i64 3200, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 3200, ptr nonnull %2) #5
  call void @_ZN6matrix5clearEv(ptr noundef nonnull align 8 dereferenceable(3200) %1)
  call void @_ZN6matrix5clearEv(ptr noundef nonnull align 8 dereferenceable(3200) %2)
  %5 = load i32, ptr @d, align 4, !tbaa !5
  %.not24 = icmp slt i32 %5, 1
  br i1 %.not24, label %.preheader22, label %.lr.ph

.preheader23:                                     ; preds = %.lr.ph
  %.not1926 = icmp slt i32 %8, 1
  br i1 %.not1926, label %.preheader22, label %.lr.ph28

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %6 = getelementptr inbounds [20 x i64], ptr @a, i64 0, i64 %indvars.iv
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %8 = load i32, ptr @d, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %.not.not = icmp slt i64 %indvars.iv, %9
  br i1 %.not.not, label %.lr.ph, label %.preheader23, !llvm.loop !9

.preheader22:                                     ; preds = %.lr.ph28, %0, %.preheader23
  %.lcssa = phi i32 [ %8, %.preheader23 ], [ %5, %0 ], [ %15, %.lr.ph28 ]
  %.not2029 = icmp slt i32 %.lcssa, 0
  br i1 %.not2029, label %._crit_edge, label %.lr.ph31.preheader

.lr.ph31.preheader:                               ; preds = %.preheader22
  %10 = add nuw i32 %.lcssa, 1
  %wide.trip.count = zext i32 %10 to i64
  %11 = zext nneg i32 %.lcssa to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %12 = icmp ult i32 %.lcssa, 3
  br i1 %12, label %.preheader.unr-lcssa, label %.lr.ph31.preheader.new

.lr.ph31.preheader.new:                           ; preds = %.lr.ph31.preheader
  %unroll_iter = and i64 %wide.trip.count, 4294967292
  br label %.lr.ph31

.lr.ph28:                                         ; preds = %.preheader23, %.lr.ph28
  %indvars.iv37 = phi i64 [ %indvars.iv.next38, %.lr.ph28 ], [ 1, %.preheader23 ]
  %13 = getelementptr inbounds [20 x i64], ptr @f, i64 0, i64 %indvars.iv37
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
  %15 = load i32, ptr @d, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %.not19.not = icmp slt i64 %indvars.iv37, %16
  br i1 %.not19.not, label %.lr.ph28, label %.preheader22, !llvm.loop !11

.preheader.unr-lcssa:                             ; preds = %.lr.ph31, %.lr.ph31.preheader
  %indvars.iv40.unr = phi i64 [ 0, %.lr.ph31.preheader ], [ %indvars.iv.next41.3, %.lr.ph31 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.lr.ph31.epil

.lr.ph31.epil:                                    ; preds = %.preheader.unr-lcssa, %.lr.ph31.epil
  %indvars.iv40.epil = phi i64 [ %indvars.iv.next41.epil, %.lr.ph31.epil ], [ %indvars.iv40.unr, %.preheader.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph31.epil ], [ 0, %.preheader.unr-lcssa ]
  %17 = getelementptr inbounds [20 x i64], ptr @f, i64 0, i64 %indvars.iv40.epil
  %18 = load i64, ptr %17, align 8, !tbaa !12
  %19 = getelementptr inbounds [20 x [20 x i64]], ptr %1, i64 0, i64 %indvars.iv40.epil
  store i64 %18, ptr %19, align 8, !tbaa !12
  %indvars.iv.next41.epil = add nuw nsw i64 %indvars.iv40.epil, 1
  %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 %.preheader, label %.lr.ph31.epil, !llvm.loop !14

.preheader:                                       ; preds = %.lr.ph31.epil, %.preheader.unr-lcssa
  %.not2132 = icmp eq i32 %.lcssa, 0
  br i1 %.not2132, label %._crit_edge, label %.lr.ph34

.lr.ph34:                                         ; preds = %.preheader
  %20 = add nuw i32 %.lcssa, 1
  %21 = zext nneg i32 %.lcssa to i64
  %xtraiter56 = and i64 %11, 1
  %22 = icmp eq i32 %.lcssa, 1
  br i1 %22, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph34.new

.lr.ph34.new:                                     ; preds = %.lr.ph34
  %unroll_iter59 = and i64 %11, 2147483646
  br label %55

.lr.ph31:                                         ; preds = %.lr.ph31, %.lr.ph31.preheader.new
  %indvars.iv40 = phi i64 [ 0, %.lr.ph31.preheader.new ], [ %indvars.iv.next41.3, %.lr.ph31 ]
  %niter = phi i64 [ 0, %.lr.ph31.preheader.new ], [ %niter.next.3, %.lr.ph31 ]
  %23 = getelementptr inbounds [20 x i64], ptr @f, i64 0, i64 %indvars.iv40
  %24 = load i64, ptr %23, align 16, !tbaa !12
  %25 = getelementptr inbounds [20 x [20 x i64]], ptr %1, i64 0, i64 %indvars.iv40
  store i64 %24, ptr %25, align 8, !tbaa !12
  %indvars.iv.next41 = or disjoint i64 %indvars.iv40, 1
  %26 = getelementptr inbounds [20 x i64], ptr @f, i64 0, i64 %indvars.iv.next41
  %27 = load i64, ptr %26, align 8, !tbaa !12
  %28 = getelementptr inbounds [20 x [20 x i64]], ptr %1, i64 0, i64 %indvars.iv.next41
  store i64 %27, ptr %28, align 8, !tbaa !12
  %indvars.iv.next41.1 = or disjoint i64 %indvars.iv40, 2
  %29 = getelementptr inbounds [20 x i64], ptr @f, i64 0, i64 %indvars.iv.next41.1
  %30 = load i64, ptr %29, align 16, !tbaa !12
  %31 = getelementptr inbounds [20 x [20 x i64]], ptr %1, i64 0, i64 %indvars.iv.next41.1
  store i64 %30, ptr %31, align 8, !tbaa !12
  %indvars.iv.next41.2 = or disjoint i64 %indvars.iv40, 3
  %32 = getelementptr inbounds [20 x i64], ptr @f, i64 0, i64 %indvars.iv.next41.2
  %33 = load i64, ptr %32, align 8, !tbaa !12
  %34 = getelementptr inbounds [20 x [20 x i64]], ptr %1, i64 0, i64 %indvars.iv.next41.2
  store i64 %33, ptr %34, align 8, !tbaa !12
  %indvars.iv.next41.3 = add nuw nsw i64 %indvars.iv40, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader.unr-lcssa, label %.lr.ph31, !llvm.loop !16

._crit_edge.loopexit.unr-lcssa:                   ; preds = %55, %.lr.ph34
  %indvars.iv43.unr = phi i64 [ 1, %.lr.ph34 ], [ %indvars.iv.next44.1, %55 ]
  %lcmp.mod58.not = icmp eq i64 %xtraiter56, 0
  br i1 %lcmp.mod58.not, label %._crit_edge, label %._crit_edge.loopexit.epilog-lcssa

._crit_edge.loopexit.epilog-lcssa:                ; preds = %._crit_edge.loopexit.unr-lcssa
  %35 = add nsw i64 %indvars.iv43.unr, -1
  %36 = getelementptr inbounds [20 x [20 x i64]], ptr %2, i64 0, i64 %35, i64 %indvars.iv43.unr
  store i64 1, ptr %36, align 8, !tbaa !12
  %37 = trunc nuw nsw i64 %indvars.iv43.unr to i32
  %38 = sub i32 %20, %37
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [20 x i64], ptr @a, i64 0, i64 %39
  %41 = load i64, ptr %40, align 8, !tbaa !12
  %42 = getelementptr inbounds [20 x [20 x i64]], ptr %2, i64 0, i64 %21, i64 %indvars.iv43.unr
  store i64 %41, ptr %42, align 8, !tbaa !12
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.epilog-lcssa, %._crit_edge.loopexit.unr-lcssa, %.preheader22, %.preheader
  call void @llvm.lifetime.start.p0(i64 3200, ptr nonnull %3) #5
  %43 = load i32, ptr @n, align 4, !tbaa !5
  %44 = sub nsw i32 %43, %.lcssa
  %45 = sext i32 %44 to i64
  call void @_Zeo6matrixx(ptr dead_on_unwind nonnull writable sret(%struct.matrix) align 8 %3, ptr noundef nonnull byval(%struct.matrix) align 8 %2, i64 noundef %45)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(3200) %2, ptr noundef nonnull align 8 dereferenceable(3200) %3, i64 3200, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 3200, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 3200, ptr nonnull %4) #5
  call void @_Zml6matrixS_(ptr dead_on_unwind nonnull writable sret(%struct.matrix) align 8 %4, ptr noundef nonnull byval(%struct.matrix) align 8 %2, ptr noundef nonnull byval(%struct.matrix) align 8 %1)
  %46 = load i32, ptr @d, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [20 x [20 x i64]], ptr %4, i64 0, i64 %47
  %49 = load i64, ptr %48, align 8, !tbaa !12
  %50 = load i32, ptr @m, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = srem i64 %49, %51
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %52)
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %53, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 3200, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 3200, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 3200, ptr nonnull %1) #5
  ret void

55:                                               ; preds = %55, %.lr.ph34.new
  %indvars.iv43 = phi i64 [ 1, %.lr.ph34.new ], [ %indvars.iv.next44.1, %55 ]
  %niter60 = phi i64 [ 0, %.lr.ph34.new ], [ %niter60.next.1, %55 ]
  %56 = add nsw i64 %indvars.iv43, -1
  %57 = getelementptr inbounds [20 x [20 x i64]], ptr %2, i64 0, i64 %56, i64 %indvars.iv43
  store i64 1, ptr %57, align 8, !tbaa !12
  %58 = trunc nuw nsw i64 %indvars.iv43 to i32
  %59 = sub i32 %20, %58
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [20 x i64], ptr @a, i64 0, i64 %60
  %62 = load i64, ptr %61, align 8, !tbaa !12
  %63 = getelementptr inbounds [20 x [20 x i64]], ptr %2, i64 0, i64 %21, i64 %indvars.iv43
  store i64 %62, ptr %63, align 8, !tbaa !12
  %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
  %64 = getelementptr inbounds [20 x [20 x i64]], ptr %2, i64 0, i64 %indvars.iv43, i64 %indvars.iv.next44
  store i64 1, ptr %64, align 8, !tbaa !12
  %65 = trunc nuw nsw i64 %indvars.iv.next44 to i32
  %66 = sub i32 %20, %65
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [20 x i64], ptr @a, i64 0, i64 %67
  %69 = load i64, ptr %68, align 8, !tbaa !12
  %70 = getelementptr inbounds [20 x [20 x i64]], ptr %2, i64 0, i64 %21, i64 %indvars.iv.next44
  store i64 %69, ptr %70, align 8, !tbaa !12
  %indvars.iv.next44.1 = add nuw nsw i64 %indvars.iv43, 2
  %niter60.next.1 = add i64 %niter60, 2
  %niter60.ncmp.1 = icmp eq i64 %niter60.next.1, %unroll_iter59
  br i1 %niter60.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %55, !llvm.loop !19
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6matrix5clearEv(ptr noundef nonnull align 8 dereferenceable(3200)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Zeo6matrixx(ptr dead_on_unwind noalias writable sret(%struct.matrix) align 8, ptr noundef byval(%struct.matrix) align 8, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress 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) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Zml6matrixS_(ptr dead_on_unwind noalias writable sret(%struct.matrix) align 8, ptr noundef byval(%struct.matrix) align 8, ptr noundef byval(%struct.matrix) align 8) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #0 align 2

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !10}
!17 = !{i64 0, i64 3200, !18}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,ReassociatePass,SROAPass,SimplifyCFGPass