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

@_ZZ5solvevE3seq = external hidden global [101 x [101 x i32]], align 16
@_ZZ5solvevE2pL = external hidden global [101 x i32], align 16
@_ZZ5solvevE2pR = external hidden global [101 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ5solvevE3ans = external hidden global [101 x [101 x i32]], align 16
@.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
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  store i32 101, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %57, %0
  %15 = load i32, ptr %4, align 4, !tbaa !5
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = icmp slt i32 %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %60

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

20:                                               ; preds = %34, %19
  %21 = load i32, ptr %6, align 4, !tbaa !5
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %25, label %24

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

25:                                               ; preds = %20
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %27
  %29 = getelementptr inbounds [101 x i32], ptr %28, i64 0, i64 0
  %30 = load i32, ptr %6, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds i32, ptr %29, i64 %31
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %32)
  br label %34

34:                                               ; preds = %25
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %6, align 4, !tbaa !5
  br label %20, !llvm.loop !9

37:                                               ; preds = %24
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %39
  %41 = getelementptr inbounds [101 x i32], ptr %40, i64 0, i64 0
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %43
  %45 = getelementptr inbounds [101 x i32], ptr %44, i64 0, i64 0
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i32, ptr %45, i64 %47
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef %41, ptr noundef %48)
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [101 x i32], ptr @_ZZ5solvevE2pL, i64 0, i64 %50
  store i32 0, ptr %51, align 4, !tbaa !5
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = sub nsw i32 %52, 1
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [101 x i32], ptr @_ZZ5solvevE2pR, i64 0, i64 %55
  store i32 %53, ptr %56, align 4, !tbaa !5
  br label %57

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

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

61:                                               ; preds = %146, %60
  %62 = load i32, ptr %7, align 4, !tbaa !5
  %63 = load i32, ptr %3, align 4, !tbaa !5
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %149

66:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %97, %66
  %68 = load i32, ptr %9, align 4, !tbaa !5
  %69 = load i32, ptr %2, align 4, !tbaa !5
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %100

72:                                               ; preds = %67
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %74
  %76 = load i32, ptr %8, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [101 x i32], ptr @_ZZ5solvevE2pL, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [101 x i32], ptr %75, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = load i32, ptr %9, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %84
  %86 = load i32, ptr %9, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [101 x i32], ptr @_ZZ5solvevE2pL, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [101 x i32], ptr %85, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = icmp sgt i32 %82, %92
  br i1 %93, label %94, label %96

94:                                               ; preds = %72
  %95 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %95, ptr %8, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %94, %72
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %9, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %9, align 4, !tbaa !5
  br label %67, !llvm.loop !12

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

101:                                              ; preds = %142, %100
  %102 = load i32, ptr %10, align 4, !tbaa !5
  %103 = load i32, ptr %2, align 4, !tbaa !5
  %104 = icmp slt i32 %102, %103
  br i1 %104, label %106, label %105

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

106:                                              ; preds = %101
  %107 = load i32, ptr %10, align 4, !tbaa !5
  %108 = load i32, ptr %8, align 4, !tbaa !5
  %109 = icmp eq i32 %107, %108
  br i1 %109, label %110, label %122

110:                                              ; preds = %106
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %112
  %114 = load i32, ptr %10, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [101 x i32], ptr @_ZZ5solvevE2pL, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %116, align 4, !tbaa !5
  %119 = sext i32 %117 to i64
  %120 = getelementptr inbounds [101 x i32], ptr %113, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  br label %134

122:                                              ; preds = %106
  %123 = load i32, ptr %10, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %124
  %126 = load i32, ptr %10, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [101 x i32], ptr @_ZZ5solvevE2pR, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = add nsw i32 %129, -1
  store i32 %130, ptr %128, align 4, !tbaa !5
  %131 = sext i32 %129 to i64
  %132 = getelementptr inbounds [101 x i32], ptr %125, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %122, %110
  %135 = phi i32 [ %121, %110 ], [ %133, %122 ]
  %136 = load i32, ptr %10, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3ans, i64 0, i64 %137
  %139 = load i32, ptr %7, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [101 x i32], ptr %138, i64 0, i64 %140
  store i32 %135, ptr %141, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %134
  %143 = load i32, ptr %10, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %10, align 4, !tbaa !5
  br label %101, !llvm.loop !13

145:                                              ; preds = %105
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %146

146:                                              ; preds = %145
  %147 = load i32, ptr %7, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %7, align 4, !tbaa !5
  br label %61, !llvm.loop !14

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

150:                                              ; preds = %182, %149
  %151 = load i32, ptr %11, align 4, !tbaa !5
  %152 = load i32, ptr %2, align 4, !tbaa !5
  %153 = icmp slt i32 %151, %152
  br i1 %153, label %155, label %154

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

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

156:                                              ; preds = %178, %155
  %157 = load i32, ptr %12, align 4, !tbaa !5
  %158 = load i32, ptr %3, align 4, !tbaa !5
  %159 = icmp slt i32 %157, %158
  br i1 %159, label %161, label %160

160:                                              ; preds = %156
  store i32 20, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %181

161:                                              ; preds = %156
  %162 = load i32, ptr %11, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3ans, i64 0, i64 %163
  %165 = load i32, ptr %12, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [101 x i32], ptr %164, i64 0, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = load i32, ptr %12, align 4, !tbaa !5
  %170 = load i32, ptr %3, align 4, !tbaa !5
  %171 = sub nsw i32 %170, 1
  %172 = icmp eq i32 %169, %171
  %173 = zext i1 %172 to i64
  %174 = getelementptr inbounds [3 x i8], ptr @.str.3, i64 0, i64 %173
  %175 = load i8, ptr %174, align 1, !tbaa !15
  %176 = sext i8 %175 to i32
  %177 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %168, i32 noundef %176)
  br label %178

178:                                              ; preds = %161
  %179 = load i32, ptr %12, align 4, !tbaa !5
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %12, align 4, !tbaa !5
  br label %156, !llvm.loop !16

181:                                              ; preds = %160
  br label %182

182:                                              ; preds = %181
  %183 = load i32, ptr %11, align 4, !tbaa !5
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %11, align 4, !tbaa !5
  br label %150, !llvm.loop !17

185:                                              ; preds = %154
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr 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 = { 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 #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 = distinct !{!14, !10}
!15 = !{!7, !7, i64 0}
!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"

@_ZZ5solvevE3seq = external hidden global [101 x [101 x i32]], align 16
@_ZZ5solvevE2pL = external hidden local_unnamed_addr global [101 x i32], align 16
@_ZZ5solvevE2pR = external hidden local_unnamed_addr global [101 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ5solvevE3ans = external hidden local_unnamed_addr global [101 x [101 x i32]], align 16
@.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() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = 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
  %3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %4 = load i32, ptr %1, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  %.pre102 = load i32, ptr %2, align 4, !tbaa !5
  br i1 %5, label %.preheader49, label %.preheader48

.preheader49:                                     ; preds = %0, %._crit_edge
  %6 = phi i32 [ %86, %._crit_edge ], [ %.pre102, %0 ]
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %._crit_edge ], [ 0, %0 ]
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %.preheader49.._crit_edge_crit_edge

.preheader49.._crit_edge_crit_edge:               ; preds = %.preheader49
  %.pre103 = sext i32 %6 to i64
  br label %._crit_edge

.lr.ph:                                           ; preds = %.preheader49
  %8 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %indvars.iv80
  br label %92

.preheader48:                                     ; preds = %._crit_edge, %0
  %9 = phi i32 [ %.pre102, %0 ], [ %86, %._crit_edge ]
  %10 = phi i32 [ %4, %0 ], [ %89, %._crit_edge ]
  %11 = icmp slt i32 %9, 1
  br i1 %11, label %._crit_edge74, label %.preheader47.lr.ph

.preheader47.lr.ph:                               ; preds = %.preheader48
  %12 = icmp sgt i32 %10, 1
  %13 = icmp sgt i32 %10, 0
  br i1 %13, label %.preheader47.us.preheader, label %._crit_edge74

.preheader47.us.preheader:                        ; preds = %.preheader47.lr.ph
  %wide.trip.count94 = zext nneg i32 %9 to i64
  %.pre104 = zext nneg i32 %10 to i64
  %wide.trip.count = zext nneg i32 %10 to i64
  %14 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %14, 1
  %15 = icmp eq i32 %10, 2
  %unroll_iter = and i64 %14, -2
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader47.us

.preheader47.us:                                  ; preds = %.preheader47.us.preheader, %._crit_edge60.us
  %indvars.iv91 = phi i64 [ 0, %.preheader47.us.preheader ], [ %indvars.iv.next92, %._crit_edge60.us ]
  br i1 %12, label %.lr.ph56.us.preheader, label %.preheader46.us

.lr.ph56.us.preheader:                            ; preds = %.preheader47.us
  br i1 %15, label %.preheader46.us.loopexit.unr-lcssa, label %.lr.ph56.us

16:                                               ; preds = %16, %.preheader46.us.new
  %indvars.iv86 = phi i64 [ 0, %.preheader46.us.new ], [ %indvars.iv.next87.1, %16 ]
  %niter127 = phi i64 [ 0, %.preheader46.us.new ], [ %niter127.next.1, %16 ]
  %17 = icmp eq i64 %indvars.iv86, %72
  %18 = getelementptr inbounds [101 x i32], ptr @_ZZ5solvevE2pR, i64 0, i64 %indvars.iv86
  %.sink115 = select i1 %17, ptr %73, ptr %18
  %.sink114 = select i1 %17, i32 1, i32 -1
  %19 = load i32, ptr %.sink115, align 4, !tbaa !5
  %20 = add nsw i32 %19, %.sink114
  store i32 %20, ptr %.sink115, align 4, !tbaa !5
  %21 = sext i32 %19 to i64
  %22 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %indvars.iv86, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3ans, i64 0, i64 %indvars.iv86, i64 %indvars.iv91
  store i32 %23, ptr %24, align 4, !tbaa !5
  %indvars.iv.next87 = or disjoint i64 %indvars.iv86, 1
  %25 = icmp eq i64 %indvars.iv.next87, %72
  %26 = getelementptr inbounds [101 x i32], ptr @_ZZ5solvevE2pR, i64 0, i64 %indvars.iv.next87
  %.sink115.1 = select i1 %25, ptr %73, ptr %26
  %.sink114.1 = select i1 %25, i32 1, i32 -1
  %27 = load i32, ptr %.sink115.1, align 4, !tbaa !5
  %28 = add nsw i32 %27, %.sink114.1
  store i32 %28, ptr %.sink115.1, align 4, !tbaa !5
  %29 = sext i32 %27 to i64
  %30 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %indvars.iv.next87, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3ans, i64 0, i64 %indvars.iv.next87, i64 %indvars.iv91
  store i32 %31, ptr %32, align 4, !tbaa !5
  %indvars.iv.next87.1 = add nuw nsw i64 %indvars.iv86, 2
  %niter127.next.1 = add i64 %niter127, 2
  %niter127.ncmp.1 = icmp eq i64 %niter127.next.1, %unroll_iter126
  br i1 %niter127.ncmp.1, label %._crit_edge60.us.unr-lcssa, label %16, !llvm.loop !9

.lr.ph56.us:                                      ; preds = %.lr.ph56.us.preheader, %.lr.ph56.us
  %indvars.iv83 = phi i64 [ %indvars.iv.next84.1, %.lr.ph56.us ], [ 1, %.lr.ph56.us.preheader ]
  %.03954.us = phi i32 [ %spec.select.us.1, %.lr.ph56.us ], [ 0, %.lr.ph56.us.preheader ]
  %niter = phi i64 [ %niter.next.1, %.lr.ph56.us ], [ 0, %.lr.ph56.us.preheader ]
  %33 = sext i32 %.03954.us to i64
  %34 = getelementptr inbounds [101 x i32], ptr @_ZZ5solvevE2pL, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %33, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = getelementptr inbounds [101 x i32], ptr @_ZZ5solvevE2pL, i64 0, i64 %indvars.iv83
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %indvars.iv83, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = icmp sgt i32 %38, %43
  %45 = trunc nuw nsw i64 %indvars.iv83 to i32
  %spec.select.us = select i1 %44, i32 %45, i32 %.03954.us
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %46 = sext i32 %spec.select.us to i64
  %47 = getelementptr inbounds [101 x i32], ptr @_ZZ5solvevE2pL, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %46, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = getelementptr inbounds [101 x i32], ptr @_ZZ5solvevE2pL, i64 0, i64 %indvars.iv.next84
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %indvars.iv.next84, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = icmp sgt i32 %51, %56
  %58 = trunc nuw nsw i64 %indvars.iv.next84 to i32
  %spec.select.us.1 = select i1 %57, i32 %58, i32 %spec.select.us
  %indvars.iv.next84.1 = add nuw nsw i64 %indvars.iv83, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader46.us.loopexit.unr-lcssa, label %.lr.ph56.us, !llvm.loop !11

.preheader46.us.loopexit.unr-lcssa:               ; preds = %.lr.ph56.us, %.lr.ph56.us.preheader
  %spec.select.us.lcssa.ph = phi i32 [ poison, %.lr.ph56.us.preheader ], [ %spec.select.us.1, %.lr.ph56.us ]
  %indvars.iv83.unr = phi i64 [ 1, %.lr.ph56.us.preheader ], [ %indvars.iv.next84.1, %.lr.ph56.us ]
  %.03954.us.unr = phi i32 [ 0, %.lr.ph56.us.preheader ], [ %spec.select.us.1, %.lr.ph56.us ]
  br i1 %lcmp.mod.not, label %.preheader46.us, label %.lr.ph56.us.epil

.lr.ph56.us.epil:                                 ; preds = %.preheader46.us.loopexit.unr-lcssa
  %59 = sext i32 %.03954.us.unr to i64
  %60 = getelementptr inbounds [101 x i32], ptr @_ZZ5solvevE2pL, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %59, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = getelementptr inbounds [101 x i32], ptr @_ZZ5solvevE2pL, i64 0, i64 %indvars.iv83.unr
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %indvars.iv83.unr, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = icmp sgt i32 %64, %69
  %71 = trunc nuw nsw i64 %indvars.iv83.unr to i32
  %spec.select.us.epil = select i1 %70, i32 %71, i32 %.03954.us.unr
  br label %.preheader46.us

.preheader46.us:                                  ; preds = %.lr.ph56.us.epil, %.preheader46.us.loopexit.unr-lcssa, %.preheader47.us
  %wide.trip.count89.pre-phi = phi i64 [ %.pre104, %.preheader47.us ], [ %wide.trip.count, %.preheader46.us.loopexit.unr-lcssa ], [ %wide.trip.count, %.lr.ph56.us.epil ]
  %.039.lcssa.us = phi i32 [ 0, %.preheader47.us ], [ %spec.select.us.lcssa.ph, %.preheader46.us.loopexit.unr-lcssa ], [ %spec.select.us.epil, %.lr.ph56.us.epil ]
  %72 = zext i32 %.039.lcssa.us to i64
  %73 = getelementptr inbounds [101 x i32], ptr @_ZZ5solvevE2pL, i64 0, i64 %72
  %xtraiter124 = and i64 %wide.trip.count89.pre-phi, 1
  %74 = icmp eq i64 %wide.trip.count89.pre-phi, 1
  br i1 %74, label %._crit_edge60.us.unr-lcssa, label %.preheader46.us.new

.preheader46.us.new:                              ; preds = %.preheader46.us
  %unroll_iter126 = and i64 %wide.trip.count89.pre-phi, 2147483646
  br label %16

._crit_edge60.us.unr-lcssa:                       ; preds = %16, %.preheader46.us
  %indvars.iv86.unr = phi i64 [ 0, %.preheader46.us ], [ %indvars.iv.next87.1, %16 ]
  %lcmp.mod125.not = icmp eq i64 %xtraiter124, 0
  br i1 %lcmp.mod125.not, label %._crit_edge60.us, label %._crit_edge60.us.epilog-lcssa

._crit_edge60.us.epilog-lcssa:                    ; preds = %._crit_edge60.us.unr-lcssa
  %75 = icmp eq i64 %indvars.iv86.unr, %72
  %76 = getelementptr inbounds [101 x i32], ptr @_ZZ5solvevE2pR, i64 0, i64 %indvars.iv86.unr
  %.sink115.epil = select i1 %75, ptr %73, ptr %76
  %.sink114.epil = select i1 %75, i32 1, i32 -1
  %77 = load i32, ptr %.sink115.epil, align 4, !tbaa !5
  %78 = add nsw i32 %77, %.sink114.epil
  store i32 %78, ptr %.sink115.epil, align 4, !tbaa !5
  %79 = sext i32 %77 to i64
  %80 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %indvars.iv86.unr, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3ans, i64 0, i64 %indvars.iv86.unr, i64 %indvars.iv91
  store i32 %81, ptr %82, align 4, !tbaa !5
  br label %._crit_edge60.us

._crit_edge60.us:                                 ; preds = %._crit_edge60.us.unr-lcssa, %._crit_edge60.us.epilog-lcssa
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %exitcond95.not = icmp eq i64 %indvars.iv.next92, %wide.trip.count94
  br i1 %exitcond95.not, label %.preheader45, label %.preheader47.us, !llvm.loop !12

._crit_edge:                                      ; preds = %92, %.preheader49.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre103, %.preheader49.._crit_edge_crit_edge ], [ %96, %92 ]
  %83 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %indvars.iv80
  %84 = getelementptr inbounds i32, ptr %83, i64 %.pre-phi
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull %83, ptr noundef nonnull %84)
  %85 = getelementptr inbounds [101 x i32], ptr @_ZZ5solvevE2pL, i64 0, i64 %indvars.iv80
  store i32 0, ptr %85, align 4, !tbaa !5
  %86 = load i32, ptr %2, align 4, !tbaa !5
  %87 = add nsw i32 %86, -1
  %88 = getelementptr inbounds [101 x i32], ptr @_ZZ5solvevE2pR, i64 0, i64 %indvars.iv80
  store i32 %87, ptr %88, align 4, !tbaa !5
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %89 = load i32, ptr %1, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = icmp slt i64 %indvars.iv.next81, %90
  br i1 %91, label %.preheader49, label %.preheader48, !llvm.loop !13

92:                                               ; preds = %.lr.ph, %92
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %92 ]
  %93 = getelementptr inbounds i32, ptr %8, i64 %indvars.iv
  %94 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %93)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %95 = load i32, ptr %2, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = icmp slt i64 %indvars.iv.next, %96
  br i1 %97, label %92, label %._crit_edge, !llvm.loop !14

.preheader45:                                     ; preds = %._crit_edge60.us
  br i1 %11, label %._crit_edge74, label %.preheader

.preheader:                                       ; preds = %.preheader45, %._crit_edge72
  %98 = phi i32 [ %101, %._crit_edge72 ], [ %10, %.preheader45 ]
  %99 = phi i32 [ %102, %._crit_edge72 ], [ %9, %.preheader45 ]
  %indvars.iv99 = phi i64 [ %indvars.iv.next100, %._crit_edge72 ], [ 0, %.preheader45 ]
  %100 = icmp sgt i32 %99, 0
  br i1 %100, label %.lr.ph71, label %._crit_edge72

._crit_edge74:                                    ; preds = %._crit_edge72, %.preheader45, %.preheader48, %.preheader47.lr.ph
  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

._crit_edge72.loopexit:                           ; preds = %.lr.ph71
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge72

._crit_edge72:                                    ; preds = %._crit_edge72.loopexit, %.preheader
  %101 = phi i32 [ %.pre, %._crit_edge72.loopexit ], [ %98, %.preheader ]
  %102 = phi i32 [ %116, %._crit_edge72.loopexit ], [ %99, %.preheader ]
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %103 = sext i32 %101 to i64
  %104 = icmp slt i64 %indvars.iv.next100, %103
  br i1 %104, label %.preheader, label %._crit_edge74, !llvm.loop !15

.lr.ph71:                                         ; preds = %.preheader, %.lr.ph71
  %indvars.iv96 = phi i64 [ %indvars.iv.next97, %.lr.ph71 ], [ 0, %.preheader ]
  %105 = phi i32 [ %116, %.lr.ph71 ], [ %99, %.preheader ]
  %106 = getelementptr inbounds [101 x [101 x i32]], ptr @_ZZ5solvevE3ans, i64 0, i64 %indvars.iv99, i64 %indvars.iv96
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = add nsw i32 %105, -1
  %109 = zext i32 %108 to i64
  %110 = icmp eq i64 %indvars.iv96, %109
  %111 = zext i1 %110 to i64
  %112 = getelementptr inbounds [3 x i8], ptr @.str.3, i64 0, i64 %111
  %113 = load i8, ptr %112, align 1, !tbaa !17
  %114 = sext i8 %113 to i32
  %115 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %107, i32 noundef %114)
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %116 = load i32, ptr %2, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = icmp slt i64 %indvars.iv.next97, %117
  br i1 %118, label %.lr.ph71, label %._crit_edge72.loopexit, !llvm.loop !18
}

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = { 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 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 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !16}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !10}


; Effective O3 passes: ADCEPass,BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass