; LLVM IR from tangjz/acm-icpc :: codeforces/gym/101081G.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"

%struct.Matrix = type { [101 x [101 x i32]] }

@n = external dso_local global i32, align 4
@_ZZ5solvevE1f = external hidden global [3 x %struct.Matrix], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 {
  %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 i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 2, ptr %5, align 4, !tbaa !5
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef %1, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %24, %0
  %19 = load i32, ptr %6, align 4, !tbaa !5
  %20 = shl i32 1, %19
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = icmp sle i32 %20, %21
  br i1 %22, label %23, label %27

23:                                               ; preds = %18
  br label %24

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

27:                                               ; preds = %18
  %28 = load i32, ptr %5, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [3 x %struct.Matrix], ptr @_ZZ5solvevE1f, i64 0, i64 %29
  call void @_ZN6Matrix10assignDiagEi(ptr noundef nonnull align 4 dereferenceable(40804) %30, i32 noundef -1)
  br label %31

31:                                               ; preds = %35, %27
  %32 = load i32, ptr %1, align 4, !tbaa !5
  %33 = add nsw i32 %32, -1
  store i32 %33, ptr %1, align 4, !tbaa !5
  %34 = icmp ne i32 %32, 0
  br i1 %34, label %35, label %61

35:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %7, ptr noundef %8)
  %37 = load i32, ptr %7, align 4, !tbaa !5
  %38 = add nsw i32 %37, -1
  store i32 %38, ptr %7, align 4, !tbaa !5
  %39 = load i32, ptr %8, align 4, !tbaa !5
  %40 = add nsw i32 %39, -1
  store i32 %40, ptr %8, align 4, !tbaa !5
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [3 x %struct.Matrix], ptr @_ZZ5solvevE1f, i64 0, i64 %42
  %44 = getelementptr inbounds %struct.Matrix, ptr %43, i32 0, i32 0
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [101 x [101 x i32]], ptr %44, i64 0, i64 %46
  %48 = load i32, ptr %8, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [101 x i32], ptr %47, i64 0, i64 %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !5
  call void @_Z8mergeSolRiRKiS1_(ptr noundef nonnull align 4 dereferenceable(4) %50, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [3 x %struct.Matrix], ptr @_ZZ5solvevE1f, i64 0, i64 %52
  %54 = getelementptr inbounds %struct.Matrix, ptr %53, i32 0, i32 0
  %55 = load i32, ptr %8, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [101 x [101 x i32]], ptr %54, i64 0, i64 %56
  %58 = load i32, ptr %7, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [101 x i32], ptr %57, i64 0, i64 %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 1, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 1, ptr %12, align 4, !tbaa !5
  call void @_Z8mergeSolRiRKiS1_(ptr noundef nonnull align 4 dereferenceable(4) %60, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %31, !llvm.loop !11

61:                                               ; preds = %31
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [3 x %struct.Matrix], ptr @_ZZ5solvevE1f, i64 0, i64 %63
  call void @_ZN6Matrix10assignDiagEi(ptr noundef nonnull align 4 dereferenceable(40804) %64, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %99, %61
  %66 = load i32, ptr %2, align 4, !tbaa !5
  %67 = icmp sgt i32 %66, 0
  br i1 %67, label %69, label %68

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

69:                                               ; preds = %65
  %70 = load i32, ptr %2, align 4, !tbaa !5
  %71 = and i32 %70, 1
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %83

73:                                               ; preds = %69
  %74 = load i32, ptr %4, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [3 x %struct.Matrix], ptr @_ZZ5solvevE1f, i64 0, i64 %75
  %77 = load i32, ptr %3, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [3 x %struct.Matrix], ptr @_ZZ5solvevE1f, i64 0, i64 %78
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [3 x %struct.Matrix], ptr @_ZZ5solvevE1f, i64 0, i64 %81
  call void @_ZN6Matrix9assignMulERKS_S1_(ptr noundef nonnull align 4 dereferenceable(40804) %76, ptr noundef nonnull align 4 dereferenceable(40804) %79, ptr noundef nonnull align 4 dereferenceable(40804) %82)
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #5
  br label %83

83:                                               ; preds = %73, %69
  %84 = load i32, ptr %13, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %88, label %98

88:                                               ; preds = %83
  %89 = load i32, ptr %4, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [3 x %struct.Matrix], ptr @_ZZ5solvevE1f, i64 0, i64 %90
  %92 = load i32, ptr %5, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [3 x %struct.Matrix], ptr @_ZZ5solvevE1f, i64 0, i64 %93
  %95 = load i32, ptr %5, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [3 x %struct.Matrix], ptr @_ZZ5solvevE1f, i64 0, i64 %96
  call void @_ZN6Matrix9assignMulERKS_S1_(ptr noundef nonnull align 4 dereferenceable(40804) %91, ptr noundef nonnull align 4 dereferenceable(40804) %94, ptr noundef nonnull align 4 dereferenceable(40804) %97)
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5) #5
  br label %98

98:                                               ; preds = %88, %83
  br label %99

99:                                               ; preds = %98
  %100 = load i32, ptr %13, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %13, align 4, !tbaa !5
  %102 = load i32, ptr %2, align 4, !tbaa !5
  %103 = ashr i32 %102, 1
  store i32 %103, ptr %2, align 4, !tbaa !5
  br label %65, !llvm.loop !12

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

105:                                              ; preds = %144, %104
  %106 = load i32, ptr %14, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  %108 = load i32, ptr @n, align 4, !tbaa !5
  %109 = icmp slt i32 %107, %108
  br i1 %109, label %111, label %110

110:                                              ; preds = %105
  store i32 10, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %147

111:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %112 = load i32, ptr %14, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %16, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %140, %111
  %115 = load i32, ptr %16, align 4, !tbaa !5
  %116 = load i32, ptr @n, align 4, !tbaa !5
  %117 = icmp slt i32 %115, %116
  br i1 %117, label %119, label %118

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

119:                                              ; preds = %114
  %120 = load i32, ptr %3, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [3 x %struct.Matrix], ptr @_ZZ5solvevE1f, i64 0, i64 %121
  %123 = getelementptr inbounds %struct.Matrix, ptr %122, i32 0, i32 0
  %124 = load i32, ptr %14, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [101 x [101 x i32]], ptr %123, i64 0, i64 %125
  %127 = load i32, ptr %16, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [101 x i32], ptr %126, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = load i32, ptr %16, align 4, !tbaa !5
  %132 = load i32, ptr @n, align 4, !tbaa !5
  %133 = sub nsw i32 %132, 1
  %134 = icmp eq i32 %131, %133
  %135 = zext i1 %134 to i64
  %136 = getelementptr inbounds [3 x i8], ptr @.str.3, i64 0, i64 %135
  %137 = load i8, ptr %136, align 1, !tbaa !13
  %138 = sext i8 %137 to i32
  %139 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %130, i32 noundef %138)
  br label %140

140:                                              ; preds = %119
  %141 = load i32, ptr %16, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %16, align 4, !tbaa !5
  br label %114, !llvm.loop !14

143:                                              ; preds = %118
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %14, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %14, align 4, !tbaa !5
  br label %105, !llvm.loop !15

147:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 4, 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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Matrix10assignDiagEi(ptr noundef nonnull align 4 dereferenceable(40804), i32 noundef) #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Matrix9assignMulERKS_S1_(ptr noundef nonnull align 4 dereferenceable(40804), ptr noundef nonnull align 4 dereferenceable(40804), ptr noundef nonnull align 4 dereferenceable(40804)) #3 align 2

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

declare i32 @printf(ptr noundef, ...) #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 = { "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 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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !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"

%struct.Matrix = type { [101 x [101 x i32]] }

@n = external dso_local global i32, align 4
@_ZZ5solvevE1f = external hidden global [3 x %struct.Matrix], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %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 i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  store i32 1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 2, ptr %5, align 4, !tbaa !5
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %13 = load i32, ptr %2, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %14, %0
  %.015 = phi i32 [ 0, %0 ], [ %16, %14 ]
  %15 = shl nuw i32 1, %.015
  %.not = icmp sgt i32 %15, %13
  %16 = add nuw nsw i32 %.015, 1
  br i1 %.not, label %17, label %14, !llvm.loop !9

17:                                               ; preds = %14
  call void @_ZN6Matrix10assignDiagEi(ptr noundef nonnull align 4 dereferenceable(40804) getelementptr inbounds (i8, ptr @_ZZ5solvevE1f, i64 81608), i32 noundef -1)
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = add nsw i32 %18, -1
  store i32 %19, ptr %1, align 4, !tbaa !5
  %.not1922 = icmp eq i32 %18, 0
  br i1 %.not1922, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %17, %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %6, ptr noundef nonnull %7)
  %21 = load i32, ptr %6, align 4, !tbaa !5
  %22 = add nsw i32 %21, -1
  store i32 %22, ptr %6, align 4, !tbaa !5
  %23 = load i32, ptr %7, align 4, !tbaa !5
  %24 = add nsw i32 %23, -1
  store i32 %24, ptr %7, align 4, !tbaa !5
  %25 = sext i32 %22 to i64
  %26 = sext i32 %24 to i64
  %27 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE1f, i64 81608), i64 0, i64 %25, i64 %26
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  store i32 1, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  store i32 1, ptr %9, align 4, !tbaa !5
  call void @_Z8mergeSolRiRKiS1_(ptr noundef nonnull align 4 dereferenceable(4) %27, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  %28 = load i32, ptr %7, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = load i32, ptr %6, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE1f, i64 81608), i64 0, i64 %29, i64 %31
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #4
  store i32 1, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #4
  store i32 1, ptr %11, align 4, !tbaa !5
  call void @_Z8mergeSolRiRKiS1_(ptr noundef nonnull align 4 dereferenceable(4) %32, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  %33 = load i32, ptr %1, align 4, !tbaa !5
  %34 = add nsw i32 %33, -1
  store i32 %34, ptr %1, align 4, !tbaa !5
  %.not19 = icmp eq i32 %33, 0
  br i1 %.not19, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph, %17
  call void @_ZN6Matrix10assignDiagEi(ptr noundef nonnull align 4 dereferenceable(40804) @_ZZ5solvevE1f, i32 noundef 1)
  %.pr = load i32, ptr %2, align 4, !tbaa !5
  %35 = icmp sgt i32 %.pr, 0
  br i1 %35, label %.lr.ph25, label %.preheader21

.preheader21:                                     ; preds = %60, %._crit_edge
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = icmp sgt i32 %36, 1
  br i1 %37, label %.preheader, label %._crit_edge29

.lr.ph25:                                         ; preds = %._crit_edge, %60
  %.01423 = phi i32 [ %51, %60 ], [ 0, %._crit_edge ]
  %38 = phi i32 [ %62, %60 ], [ %.pr, %._crit_edge ]
  %39 = and i32 %38, 1
  %.not20 = icmp eq i32 %39, 0
  br i1 %.not20, label %50, label %40

40:                                               ; preds = %.lr.ph25
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [3 x %struct.Matrix], ptr @_ZZ5solvevE1f, i64 0, i64 %42
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [3 x %struct.Matrix], ptr @_ZZ5solvevE1f, i64 0, i64 %45
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [3 x %struct.Matrix], ptr @_ZZ5solvevE1f, i64 0, i64 %48
  call void @_ZN6Matrix9assignMulERKS_S1_(ptr noundef nonnull align 4 dereferenceable(40804) %43, ptr noundef nonnull align 4 dereferenceable(40804) %46, ptr noundef nonnull align 4 dereferenceable(40804) %49)
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #4
  br label %50

50:                                               ; preds = %40, %.lr.ph25
  %51 = add nuw nsw i32 %.01423, 1
  %52 = icmp ult i32 %51, %.015
  br i1 %52, label %53, label %60

53:                                               ; preds = %50
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [3 x %struct.Matrix], ptr @_ZZ5solvevE1f, i64 0, i64 %55
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [3 x %struct.Matrix], ptr @_ZZ5solvevE1f, i64 0, i64 %58
  call void @_ZN6Matrix9assignMulERKS_S1_(ptr noundef nonnull align 4 dereferenceable(40804) %56, ptr noundef nonnull align 4 dereferenceable(40804) %59, ptr noundef nonnull align 4 dereferenceable(40804) %59)
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5) #4
  br label %60

60:                                               ; preds = %50, %53
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = ashr i32 %61, 1
  store i32 %62, ptr %2, align 4, !tbaa !5
  %63 = icmp sgt i32 %62, 0
  br i1 %63, label %.lr.ph25, label %.preheader21, !llvm.loop !12

.loopexit.loopexit:                               ; preds = %.lr.ph27
  %.pre = sext i32 %83 to i64
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.preheader
  %.pre-phi = phi i64 [ %.pre, %.loopexit.loopexit ], [ %67, %.preheader ]
  %64 = phi i32 [ %83, %.loopexit.loopexit ], [ %66, %.preheader ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %65 = icmp slt i64 %indvars.iv.next, %.pre-phi
  %indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1
  br i1 %65, label %.preheader, label %._crit_edge29, !llvm.loop !13

.preheader:                                       ; preds = %.preheader21, %.loopexit
  %66 = phi i32 [ %64, %.loopexit ], [ %36, %.preheader21 ]
  %indvars.iv33 = phi i64 [ %indvars.iv.next34, %.loopexit ], [ 0, %.preheader21 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.loopexit ], [ 1, %.preheader21 ]
  %67 = sext i32 %66 to i64
  %68 = icmp slt i64 %indvars.iv, %67
  br i1 %68, label %.lr.ph27, label %.loopexit

._crit_edge29:                                    ; preds = %.loopexit, %.preheader21
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  ret void

.lr.ph27:                                         ; preds = %.preheader, %.lr.ph27
  %indvars.iv30 = phi i64 [ %indvars.iv.next31, %.lr.ph27 ], [ %indvars.iv, %.preheader ]
  %69 = phi i32 [ %83, %.lr.ph27 ], [ %66, %.preheader ]
  %70 = load i32, ptr %3, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [3 x %struct.Matrix], ptr @_ZZ5solvevE1f, i64 0, i64 %71
  %73 = getelementptr inbounds [101 x [101 x i32]], ptr %72, i64 0, i64 %indvars.iv33, i64 %indvars.iv30
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = add nsw i32 %69, -1
  %76 = zext i32 %75 to i64
  %77 = icmp eq i64 %indvars.iv30, %76
  %78 = zext i1 %77 to i64
  %79 = getelementptr inbounds [3 x i8], ptr @.str.3, i64 0, i64 %78
  %80 = load i8, ptr %79, align 1, !tbaa !14
  %81 = sext i8 %80 to i32
  %82 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %74, i32 noundef %81)
  %indvars.iv.next31 = add nuw nsw i64 %indvars.iv30, 1
  %83 = load i32, ptr @n, align 4, !tbaa !5
  %84 = trunc nuw i64 %indvars.iv.next31 to i32
  %85 = icmp sgt i32 %83, %84
  br i1 %85, label %.lr.ph27, label %.loopexit.loopexit, !llvm.loop !15
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Matrix10assignDiagEi(ptr noundef nonnull align 4 dereferenceable(40804), i32 noundef) local_unnamed_addr #0 align 2

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

; 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 nounwind uwtable
declare dso_local void @_ZN6Matrix9assignMulERKS_S1_(ptr noundef nonnull align 4 dereferenceable(40804), ptr noundef nonnull align 4 dereferenceable(40804), ptr noundef nonnull align 4 dereferenceable(40804)) local_unnamed_addr #0 align 2

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !10}


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