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

@_ZZ5solvevE4perm = external hidden global [501 x i32], align 16
@_ZZ5solvevE3mat = external hidden global [501 x [501 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [70 x i8], align 1
@__PRETTY_FUNCTION__._Z5solvev = external hidden unnamed_addr constant [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = 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
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  store i32 501, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %13

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

17:                                               ; preds = %13
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %42

18:                                               ; preds = %13
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds i32, ptr @_ZZ5solvevE4perm, i64 %20
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %21)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %35, %18
  %24 = load i32, ptr %5, align 4, !tbaa !5
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = icmp sle i32 %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %38

28:                                               ; preds = %23
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3mat, i64 0, i64 %30
  %32 = load i32, ptr %5, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [501 x i32], ptr %31, i64 0, i64 %33
  store i32 0, ptr %34, align 4, !tbaa !5
  br label %35

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

38:                                               ; preds = %27
  br label %39

39:                                               ; preds = %38
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %3, align 4, !tbaa !5
  br label %13, !llvm.loop !11

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

43:                                               ; preds = %123, %42
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = icmp sle i32 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %126

48:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %49 = load i32, ptr %6, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [501 x i32], ptr @_ZZ5solvevE4perm, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  store i32 %52, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %53 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %53, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %54 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %54, ptr %9, align 4, !tbaa !5
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [501 x i32], ptr @_ZZ5solvevE4perm, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = load i32, ptr %8, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3mat, i64 0, i64 %60
  %62 = load i32, ptr %9, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [501 x i32], ptr %61, i64 0, i64 %63
  store i32 %58, ptr %64, align 4, !tbaa !5
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = add nsw i32 %65, -1
  store i32 %66, ptr %7, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %109, %48
  %68 = load i32, ptr %7, align 4, !tbaa !5
  %69 = icmp sgt i32 %68, 0
  br i1 %69, label %70, label %122

70:                                               ; preds = %67
  %71 = load i32, ptr %9, align 4, !tbaa !5
  %72 = icmp sgt i32 %71, 1
  br i1 %72, label %73, label %86

73:                                               ; preds = %70
  %74 = load i32, ptr %8, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3mat, i64 0, i64 %75
  %77 = load i32, ptr %9, align 4, !tbaa !5
  %78 = sub nsw i32 %77, 1
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [501 x i32], ptr %76, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %86, label %83

83:                                               ; preds = %73
  %84 = load i32, ptr %9, align 4, !tbaa !5
  %85 = add nsw i32 %84, -1
  store i32 %85, ptr %9, align 4, !tbaa !5
  br label %109

86:                                               ; preds = %73, %70
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = load i32, ptr %2, align 4, !tbaa !5
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %90, label %107

90:                                               ; preds = %86
  %91 = load i32, ptr %8, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3mat, i64 0, i64 %93
  %95 = load i32, ptr %9, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [501 x i32], ptr %94, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = icmp ne i32 %98, 0
  %100 = xor i1 %99, true
  br i1 %100, label %101, label %102

101:                                              ; preds = %90
  br label %104

102:                                              ; preds = %90
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 23, ptr noundef @__PRETTY_FUNCTION__._Z5solvev) #5
  unreachable

103:                                              ; No predecessors!
  br label %104

104:                                              ; preds = %103, %101
  %105 = load i32, ptr %8, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %8, align 4, !tbaa !5
  br label %108

107:                                              ; preds = %86
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.2, i32 noundef 26, ptr noundef @__PRETTY_FUNCTION__._Z5solvev) #5
  unreachable

108:                                              ; preds = %104
  br label %109

109:                                              ; preds = %108, %83
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [501 x i32], ptr @_ZZ5solvevE4perm, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = load i32, ptr %8, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3mat, i64 0, i64 %115
  %117 = load i32, ptr %9, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [501 x i32], ptr %116, i64 0, i64 %118
  store i32 %113, ptr %119, align 4, !tbaa !5
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = add nsw i32 %120, -1
  store i32 %121, ptr %7, align 4, !tbaa !5
  br label %67, !llvm.loop !12

122:                                              ; preds = %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %6, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %6, align 4, !tbaa !5
  br label %43, !llvm.loop !13

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

127:                                              ; preds = %158, %126
  %128 = load i32, ptr %10, align 4, !tbaa !5
  %129 = load i32, ptr %2, align 4, !tbaa !5
  %130 = icmp sle i32 %128, %129
  br i1 %130, label %132, label %131

131:                                              ; preds = %127
  store i32 13, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %161

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

133:                                              ; preds = %154, %132
  %134 = load i32, ptr %11, align 4, !tbaa !5
  %135 = load i32, ptr %10, align 4, !tbaa !5
  %136 = icmp sle i32 %134, %135
  br i1 %136, label %138, label %137

137:                                              ; preds = %133
  store i32 16, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %157

138:                                              ; preds = %133
  %139 = load i32, ptr %10, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3mat, i64 0, i64 %140
  %142 = load i32, ptr %11, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [501 x i32], ptr %141, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = load i32, ptr %11, align 4, !tbaa !5
  %147 = load i32, ptr %10, align 4, !tbaa !5
  %148 = icmp eq i32 %146, %147
  %149 = zext i1 %148 to i64
  %150 = getelementptr inbounds [3 x i8], ptr @.str.5, i64 0, i64 %149
  %151 = load i8, ptr %150, align 1, !tbaa !14
  %152 = sext i8 %151 to i32
  %153 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %145, i32 noundef %152)
  br label %154

154:                                              ; preds = %138
  %155 = load i32, ptr %11, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %11, align 4, !tbaa !5
  br label %133, !llvm.loop !15

157:                                              ; preds = %137
  br label %158

158:                                              ; preds = %157
  %159 = load i32, ptr %10, align 4, !tbaa !5
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %10, align 4, !tbaa !5
  br label %127, !llvm.loop !16

161:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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}
!16 = distinct !{!16, !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"

@_ZZ5solvevE4perm = external hidden global [501 x i32], align 16
@_ZZ5solvevE3mat = external hidden local_unnamed_addr global [501 x [501 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [70 x i8], align 1
@__PRETTY_FUNCTION__._Z5solvev = external hidden unnamed_addr constant [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = 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
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %3 = load i32, ptr %1, align 4, !tbaa !5
  %.not56 = icmp slt i32 %3, 1
  br i1 %.not56, label %._crit_edge69, label %.lr.ph

.preheader54:                                     ; preds = %.lr.ph
  %.not4763 = icmp slt i32 %10, 1
  br i1 %.not4763, label %._crit_edge69, label %.lr.ph65.preheader

.lr.ph65.preheader:                               ; preds = %.preheader54
  %4 = add nuw i32 %10, 1
  %wide.trip.count = zext i32 %4 to i64
  br label %.lr.ph65

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %indvar = phi i64 [ %indvar.next, %.lr.ph ], [ 0, %0 ]
  %5 = mul nuw nsw i64 %indvar, 2004
  %gep = getelementptr i8, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3mat, i64 2008), i64 %5
  %6 = shl nuw nsw i64 %indvar, 2
  %7 = add nuw nsw i64 %6, 4
  %8 = getelementptr inbounds i32, ptr @_ZZ5solvevE4perm, i64 %indvars.iv
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %8)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %gep, i8 0, i64 %7, i1 false), !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %.not.not = icmp slt i64 %indvars.iv, %11
  %indvar.next = add nuw nsw i64 %indvar, 1
  br i1 %.not.not, label %.lr.ph, label %.preheader54, !llvm.loop !9

.preheader53:                                     ; preds = %._crit_edge
  br i1 %.not4763, label %._crit_edge69, label %.preheader

.lr.ph65:                                         ; preds = %.lr.ph65.preheader, %._crit_edge
  %indvars.iv73 = phi i64 [ 1, %.lr.ph65.preheader ], [ %indvars.iv.next74, %._crit_edge ]
  %12 = getelementptr inbounds [501 x i32], ptr @_ZZ5solvevE4perm, i64 0, i64 %indvars.iv73
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %14 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3mat, i64 0, i64 %indvars.iv73, i64 %indvars.iv73
  store i32 %13, ptr %14, align 4, !tbaa !5
  %15 = icmp sgt i32 %13, 1
  br i1 %15, label %.lr.ph62.preheader, label %._crit_edge

.lr.ph62.preheader:                               ; preds = %.lr.ph65
  %16 = trunc nuw nsw i64 %indvars.iv73 to i32
  br label %.lr.ph62

.lr.ph62:                                         ; preds = %.lr.ph62.preheader, %34
  %.04361.in = phi i32 [ %.04361, %34 ], [ %13, %.lr.ph62.preheader ]
  %.04060 = phi i32 [ %.1, %34 ], [ %16, %.lr.ph62.preheader ]
  %.04159 = phi i32 [ %.142, %34 ], [ %16, %.lr.ph62.preheader ]
  %.04361 = add nsw i32 %.04361.in, -1
  %17 = icmp sgt i32 %.04060, 1
  br i1 %17, label %18, label %24

18:                                               ; preds = %.lr.ph62
  %19 = sext i32 %.04159 to i64
  %20 = add nsw i32 %.04060, -1
  %21 = zext nneg i32 %20 to i64
  %22 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3mat, i64 0, i64 %19, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %.not50 = icmp eq i32 %23, 0
  br i1 %.not50, label %._crit_edge90, label %24

._crit_edge90:                                    ; preds = %18
  %.pre = zext nneg i32 %20 to i64
  br label %34

24:                                               ; preds = %18, %.lr.ph62
  %25 = icmp slt i32 %.04159, %10
  br i1 %25, label %26, label %33

26:                                               ; preds = %24
  %27 = add nsw i32 %.04159, 1
  %28 = sext i32 %27 to i64
  %29 = sext i32 %.04060 to i64
  %30 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3mat, i64 0, i64 %28, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %.not51 = icmp eq i32 %31, 0
  br i1 %.not51, label %34, label %32

32:                                               ; preds = %26
  call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 23, ptr noundef nonnull @__PRETTY_FUNCTION__._Z5solvev) #6
  unreachable

33:                                               ; preds = %24
  call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.2, i32 noundef 26, ptr noundef nonnull @__PRETTY_FUNCTION__._Z5solvev) #6
  unreachable

34:                                               ; preds = %._crit_edge90, %26
  %.pre-phi91 = phi i64 [ %.pre, %._crit_edge90 ], [ %29, %26 ]
  %.pre-phi = phi i64 [ %19, %._crit_edge90 ], [ %28, %26 ]
  %.142 = phi i32 [ %.04159, %._crit_edge90 ], [ %27, %26 ]
  %.1 = phi i32 [ %20, %._crit_edge90 ], [ %.04060, %26 ]
  %35 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3mat, i64 0, i64 %.pre-phi, i64 %.pre-phi91
  store i32 %13, ptr %35, align 4, !tbaa !5
  %36 = icmp ugt i32 %.04361.in, 2
  br i1 %36, label %.lr.ph62, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %34, %.lr.ph65
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next74, %wide.trip.count
  br i1 %exitcond.not, label %.preheader53, label %.lr.ph65, !llvm.loop !12

.preheader:                                       ; preds = %.preheader53, %37
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %37 ], [ 1, %.preheader53 ]
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %37 ], [ 2, %.preheader53 ]
  br label %40

._crit_edge69:                                    ; preds = %37, %0, %.preheader54, %.preheader53
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret void

37:                                               ; preds = %40
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %38 = load i32, ptr %1, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %.not48.not = icmp slt i64 %indvars.iv85, %39
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  br i1 %.not48.not, label %.preheader, label %._crit_edge69, !llvm.loop !13

40:                                               ; preds = %.preheader, %40
  %indvars.iv76 = phi i64 [ 1, %.preheader ], [ %indvars.iv.next77, %40 ]
  %41 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3mat, i64 0, i64 %indvars.iv85, i64 %indvars.iv76
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = icmp eq i64 %indvars.iv76, %indvars.iv85
  %44 = zext i1 %43 to i64
  %45 = getelementptr inbounds [3 x i8], ptr @.str.5, i64 0, i64 %44
  %46 = load i8, ptr %45, align 1, !tbaa !14
  %47 = sext i8 %46 to i32
  %48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %42, i32 noundef %47)
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %exitcond82.not = icmp eq i64 %indvars.iv.next77, %indvars.iv83
  br i1 %exitcond82.not, label %37, label %40, !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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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

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

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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
attributes #6 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass