; LLVM IR from tangjz/acm-icpc :: codeforces/complete/1466D.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.anon = type { i8 }

@_ZZ5solvevE1w = external hidden global [100001 x i32], align 16
@_ZZ5solvevE3deg = external hidden global [100001 x i32], align 16
@_ZZ5solvevE3ord = external hidden global [100001 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@_ZZ5solvevE3ans = external hidden global [100001 x i64], align 16
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = 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 %class.anon, align 1
  %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
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %32, %0
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = icmp sle i32 %16, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %35

20:                                               ; preds = %15
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds i32, ptr @_ZZ5solvevE1w, i64 %22
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %23)
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %26
  store i32 0, ptr %27, align 4, !tbaa !5
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3ord, i64 0, i64 %30
  store i32 %28, ptr %31, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %20
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %2, align 4, !tbaa !5
  br label %15, !llvm.loop !9

35:                                               ; preds = %19
  %36 = load i32, ptr %1, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds i32, ptr @_ZZ5solvevE3ord, i64 %37
  %39 = getelementptr inbounds i32, ptr %38, i64 1
  call void @"_ZSt4sortIPiZ5solvevE3$_0EvT_S2_T0_"(ptr noundef getelementptr inbounds (i32, ptr @_ZZ5solvevE3ord, i64 1), ptr noundef %39)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %57, %35
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = load i32, ptr %1, align 4, !tbaa !5
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %45, label %44

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

45:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %46 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %5, ptr noundef %6)
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %49, align 4, !tbaa !5
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %54, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %57

57:                                               ; preds = %45
  %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 %40, !llvm.loop !11

60:                                               ; preds = %44
  %61 = load i32, ptr %1, align 4, !tbaa !5
  %62 = sub nsw i32 %61, 1
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100001 x i64], ptr @_ZZ5solvevE3ans, i64 0, i64 %63
  store i64 0, ptr %64, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %88, %60
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = load i32, ptr %1, align 4, !tbaa !5
  %68 = icmp sle i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %91

70:                                               ; preds = %65
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = load i32, ptr %7, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE1w, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = mul nsw i64 %75, %80
  %82 = load i32, ptr %1, align 4, !tbaa !5
  %83 = sub nsw i32 %82, 1
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [100001 x i64], ptr @_ZZ5solvevE3ans, i64 0, i64 %84
  %86 = load i64, ptr %85, align 8, !tbaa !12
  %87 = add nsw i64 %86, %81
  store i64 %87, ptr %85, align 8, !tbaa !12
  br label %88

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

91:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 1, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %92 = load i32, ptr %1, align 4, !tbaa !5
  %93 = sub nsw i32 %92, 1
  store i32 %93, ptr %9, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %133, %91
  %95 = load i32, ptr %8, align 4, !tbaa !5
  %96 = load i32, ptr %1, align 4, !tbaa !5
  %97 = icmp sle i32 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %136

99:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %100 = load i32, ptr %8, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3ord, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  store i32 %103, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %127, %99
  %105 = load i32, ptr %12, align 4, !tbaa !5
  %106 = load i32, ptr %11, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = icmp slt i32 %105, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %104
  store i32 14, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %132

112:                                              ; preds = %104
  %113 = load i32, ptr %9, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [100001 x i64], ptr @_ZZ5solvevE3ans, i64 0, i64 %114
  %116 = load i64, ptr %115, align 8, !tbaa !12
  %117 = load i32, ptr %11, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE1w, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = sub nsw i64 %116, %121
  %123 = load i32, ptr %9, align 4, !tbaa !5
  %124 = sub nsw i32 %123, 1
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [100001 x i64], ptr @_ZZ5solvevE3ans, i64 0, i64 %125
  store i64 %122, ptr %126, align 8, !tbaa !12
  br label %127

127:                                              ; preds = %112
  %128 = load i32, ptr %12, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %12, align 4, !tbaa !5
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = add nsw i32 %130, -1
  store i32 %131, ptr %9, align 4, !tbaa !5
  br label %104, !llvm.loop !15

132:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %133

133:                                              ; preds = %132
  %134 = load i32, ptr %8, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %8, align 4, !tbaa !5
  br label %94, !llvm.loop !16

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

137:                                              ; preds = %156, %136
  %138 = load i32, ptr %13, align 4, !tbaa !5
  %139 = load i32, ptr %1, align 4, !tbaa !5
  %140 = icmp slt i32 %138, %139
  br i1 %140, label %142, label %141

141:                                              ; preds = %137
  store i32 17, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %159

142:                                              ; preds = %137
  %143 = load i32, ptr %13, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [100001 x i64], ptr @_ZZ5solvevE3ans, i64 0, i64 %144
  %146 = load i64, ptr %145, align 8, !tbaa !12
  %147 = load i32, ptr %13, align 4, !tbaa !5
  %148 = load i32, ptr %1, align 4, !tbaa !5
  %149 = sub nsw i32 %148, 1
  %150 = icmp eq i32 %147, %149
  %151 = zext i1 %150 to i64
  %152 = getelementptr inbounds [3 x i8], ptr @.str.4, i64 0, i64 %151
  %153 = load i8, ptr %152, align 1, !tbaa !17
  %154 = sext i8 %153 to i32
  %155 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %146, i32 noundef %154)
  br label %156

156:                                              ; preds = %142
  %157 = load i32, ptr %13, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %13, align 4, !tbaa !5
  br label %137, !llvm.loop !18

159:                                              ; preds = %141
  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 hidden void @"_ZSt4sortIPiZ5solvevE3$_0EvT_S2_T0_"(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 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !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"

@_ZZ5solvevE1w = external hidden global [100001 x i32], align 16
@_ZZ5solvevE3deg = external hidden local_unnamed_addr global [100001 x i32], align 16
@_ZZ5solvevE3ord = external hidden global [100001 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@_ZZ5solvevE3ans = external hidden local_unnamed_addr global [100001 x i64], align 16
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = 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
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %.not41 = icmp slt i32 %5, 1
  br i1 %.not41, label %.._crit_edge_crit_edge, label %.lr.ph

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre86 = sext i32 %5 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre86, %.._crit_edge_crit_edge ], [ %16, %.lr.ph ]
  %6 = getelementptr inbounds i32, ptr @_ZZ5solvevE3ord, i64 %.pre-phi
  %7 = getelementptr inbounds i8, ptr %6, i64 4
  call void @"_ZSt4sortIPiZ5solvevE3$_0EvT_S2_T0_"(ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZZ5solvevE3ord, i64 4), ptr noundef nonnull %7)
  %8 = load i32, ptr %1, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 1
  br i1 %9, label %.lr.ph45, label %._crit_edge46

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %10 = getelementptr inbounds i32, ptr @_ZZ5solvevE1w, i64 %indvars.iv
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %10)
  %12 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %indvars.iv
  store i32 0, ptr %12, align 4, !tbaa !5
  %13 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3ord, i64 0, i64 %indvars.iv
  %14 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %14, ptr %13, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %.not.not = icmp slt i64 %indvars.iv, %16
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge46:                                    ; preds = %.lr.ph45, %._crit_edge
  %17 = phi i32 [ %8, %._crit_edge ], [ %35, %.lr.ph45 ]
  %18 = add nsw i32 %17, -1
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [100001 x i64], ptr @_ZZ5solvevE3ans, i64 0, i64 %19
  store i64 0, ptr %20, align 8, !tbaa !11
  %.not3748 = icmp slt i32 %17, 1
  br i1 %.not3748, label %._crit_edge65, label %.lr.ph51

.lr.ph51:                                         ; preds = %._crit_edge46
  %21 = zext nneg i32 %17 to i64
  %xtraiter = and i64 %21, 3
  %22 = icmp ult i32 %17, 4
  br i1 %22, label %.preheader39.unr-lcssa, label %.lr.ph51.new

.lr.ph51.new:                                     ; preds = %.lr.ph51
  %unroll_iter = and i64 %21, 2147483644
  br label %47

.lr.ph45:                                         ; preds = %._crit_edge, %.lr.ph45
  %.03143 = phi i32 [ %34, %.lr.ph45 ], [ 1, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %26, align 4, !tbaa !5
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  %34 = add nuw nsw i32 %.03143, 1
  %35 = load i32, ptr %1, align 4, !tbaa !5
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %.lr.ph45, label %._crit_edge46, !llvm.loop !13

.preheader39.unr-lcssa:                           ; preds = %47, %.lr.ph51
  %.lcssa.ph = phi i64 [ poison, %.lr.ph51 ], [ %80, %47 ]
  %indvars.iv71.unr = phi i64 [ 1, %.lr.ph51 ], [ %indvars.iv.next72.3, %47 ]
  %.unr = phi i64 [ 0, %.lr.ph51 ], [ %80, %47 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader39, label %.epil.preheader

.epil.preheader:                                  ; preds = %.preheader39.unr-lcssa, %.epil.preheader
  %indvars.iv71.epil = phi i64 [ %indvars.iv.next72.epil, %.epil.preheader ], [ %indvars.iv71.unr, %.preheader39.unr-lcssa ]
  %37 = phi i64 [ %45, %.epil.preheader ], [ %.unr, %.preheader39.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %.preheader39.unr-lcssa ]
  %38 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %indvars.iv71.epil
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE1w, i64 0, i64 %indvars.iv71.epil
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = mul nsw i64 %43, %40
  %45 = add nsw i64 %44, %37
  %indvars.iv.next72.epil = add nuw nsw i64 %indvars.iv71.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 %.preheader39, label %.epil.preheader, !llvm.loop !14

.preheader39:                                     ; preds = %.epil.preheader, %.preheader39.unr-lcssa
  %.lcssa = phi i64 [ %.lcssa.ph, %.preheader39.unr-lcssa ], [ %45, %.epil.preheader ]
  store i64 %.lcssa, ptr %20, align 8, !tbaa !11
  br i1 %.not3748, label %._crit_edge65, label %.lr.ph62.preheader

.lr.ph62.preheader:                               ; preds = %.preheader39
  %46 = add nuw i32 %17, 1
  %wide.trip.count81 = zext i32 %46 to i64
  br label %.lr.ph62

47:                                               ; preds = %47, %.lr.ph51.new
  %indvars.iv71 = phi i64 [ 1, %.lr.ph51.new ], [ %indvars.iv.next72.3, %47 ]
  %48 = phi i64 [ 0, %.lr.ph51.new ], [ %80, %47 ]
  %niter = phi i64 [ 0, %.lr.ph51.new ], [ %niter.next.3, %47 ]
  %49 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %indvars.iv71
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE1w, i64 0, i64 %indvars.iv71
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = mul nsw i64 %54, %51
  %56 = add nsw i64 %55, %48
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %57 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %indvars.iv.next72
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE1w, i64 0, i64 %indvars.iv.next72
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = mul nsw i64 %62, %59
  %64 = add nsw i64 %63, %56
  %indvars.iv.next72.1 = add nuw nsw i64 %indvars.iv71, 2
  %65 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %indvars.iv.next72.1
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE1w, i64 0, i64 %indvars.iv.next72.1
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = mul nsw i64 %70, %67
  %72 = add nsw i64 %71, %64
  %indvars.iv.next72.2 = add nuw nsw i64 %indvars.iv71, 3
  %73 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %indvars.iv.next72.2
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE1w, i64 0, i64 %indvars.iv.next72.2
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = mul nsw i64 %78, %75
  %80 = add nsw i64 %79, %72
  %indvars.iv.next72.3 = add nuw nsw i64 %indvars.iv71, 4
  %niter.next.3 = add nuw i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader39.unr-lcssa, label %47, !llvm.loop !16

.preheader:                                       ; preds = %._crit_edge57
  %.not = icmp eq i32 %17, 1
  br i1 %.not, label %._crit_edge65, label %.lr.ph64

.lr.ph62:                                         ; preds = %.lr.ph62.preheader, %._crit_edge57
  %indvars.iv78 = phi i64 [ 1, %.lr.ph62.preheader ], [ %indvars.iv.next79, %._crit_edge57 ]
  %.02861 = phi i32 [ %18, %.lr.ph62.preheader ], [ %.1.lcssa, %._crit_edge57 ]
  %81 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3ord, i64 0, i64 %indvars.iv78
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = icmp sgt i32 %85, 1
  br i1 %86, label %.lr.ph56, label %._crit_edge57

.lr.ph56:                                         ; preds = %.lr.ph62
  %87 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE1w, i64 0, i64 %83
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = sext i32 %.02861 to i64
  %.phi.trans.insert = getelementptr inbounds [100001 x i64], ptr @_ZZ5solvevE3ans, i64 0, i64 %90
  %.pre = load i64, ptr %.phi.trans.insert, align 8, !tbaa !11
  %91 = add nsw i32 %85, -1
  %92 = zext i32 %91 to i64
  %min.iters.check = icmp ult i32 %85, 5
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph56
  %.ph = phi i64 [ %.pre, %.lr.ph56 ], [ %ind.end, %middle.block ]
  %indvars.iv74.ph = phi i64 [ %90, %.lr.ph56 ], [ %ind.end91, %middle.block ]
  %.02654.ph = phi i32 [ 1, %.lr.ph56 ], [ %ind.end93, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph56
  %93 = sub nsw i64 0, %89
  %n.vec = and i64 %92, 4294967292
  %94 = mul i64 %n.vec, %93
  %ind.end = add i64 %.pre, %94
  %ind.end91 = sub nsw i64 %90, %n.vec
  %.cast = trunc nuw i64 %n.vec to i32
  %ind.end93 = or disjoint i32 %.cast, 1
  %.splatinsert = insertelement <2 x i64> poison, i64 %.pre, i64 0
  %.splat = shufflevector <2 x i64> %.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  %.splatinsert95 = insertelement <2 x i64> poison, i64 %93, i64 0
  %.splat96 = shufflevector <2 x i64> %.splatinsert95, <2 x i64> poison, <2 x i32> zeroinitializer
  %95 = mul nuw <2 x i64> %.splat96, <i64 0, i64 1>
  %induction = add <2 x i64> %.splat, %95
  %96 = shl nsw i64 %93, 1
  %.splatinsert97 = insertelement <2 x i64> poison, i64 %96, i64 0
  %.splat98 = shufflevector <2 x i64> %.splatinsert97, <2 x i64> poison, <2 x i32> zeroinitializer
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %89, i64 0
  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <2 x i64> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <2 x i64> %vec.ind, %.splat98
  %97 = sub nsw <2 x i64> %vec.ind, %broadcast.splat
  %98 = sub nsw <2 x i64> %step.add, %broadcast.splat
  %99 = xor i64 %index, -1
  %100 = add i64 %99, %90
  %101 = getelementptr inbounds [100001 x i64], ptr @_ZZ5solvevE3ans, i64 0, i64 %100
  %102 = getelementptr inbounds i8, ptr %101, i64 -8
  %103 = getelementptr inbounds i8, ptr %101, i64 -24
  %reverse = shufflevector <2 x i64> %97, <2 x i64> poison, <2 x i32> <i32 1, i32 0>
  store <2 x i64> %reverse, ptr %102, align 8, !tbaa !11
  %reverse100 = shufflevector <2 x i64> %98, <2 x i64> poison, <2 x i32> <i32 1, i32 0>
  store <2 x i64> %reverse100, ptr %103, align 8, !tbaa !11
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <2 x i64> %step.add, %.splat98
  %104 = icmp eq i64 %index.next, %n.vec
  br i1 %104, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %92
  br i1 %cmp.n, label %._crit_edge57.loopexit, label %scalar.ph.preheader

._crit_edge57.loopexit:                           ; preds = %scalar.ph, %middle.block
  %indvars.iv.next75.lcssa = phi i64 [ %ind.end91, %middle.block ], [ %indvars.iv.next75, %scalar.ph ]
  %105 = trunc nsw i64 %indvars.iv.next75.lcssa to i32
  br label %._crit_edge57

._crit_edge57:                                    ; preds = %._crit_edge57.loopexit, %.lr.ph62
  %.1.lcssa = phi i32 [ %.02861, %.lr.ph62 ], [ %105, %._crit_edge57.loopexit ]
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %exitcond82.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count81
  br i1 %exitcond82.not, label %.preheader, label %.lr.ph62, !llvm.loop !20

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %106 = phi i64 [ %107, %scalar.ph ], [ %.ph, %scalar.ph.preheader ]
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %scalar.ph ], [ %indvars.iv74.ph, %scalar.ph.preheader ]
  %.02654 = phi i32 [ %109, %scalar.ph ], [ %.02654.ph, %scalar.ph.preheader ]
  %107 = sub nsw i64 %106, %89
  %indvars.iv.next75 = add nsw i64 %indvars.iv74, -1
  %108 = getelementptr inbounds [100001 x i64], ptr @_ZZ5solvevE3ans, i64 0, i64 %indvars.iv.next75
  store i64 %107, ptr %108, align 8, !tbaa !11
  %109 = add nuw nsw i32 %.02654, 1
  %exitcond77.not = icmp eq i32 %109, %85
  br i1 %exitcond77.not, label %._crit_edge57.loopexit, label %scalar.ph, !llvm.loop !21

._crit_edge65:                                    ; preds = %.lr.ph64, %._crit_edge46, %.preheader39, %.preheader
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  ret void

.lr.ph64:                                         ; preds = %.preheader, %.lr.ph64
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %.lr.ph64 ], [ 1, %.preheader ]
  %110 = phi i32 [ %121, %.lr.ph64 ], [ %17, %.preheader ]
  %111 = getelementptr inbounds [100001 x i64], ptr @_ZZ5solvevE3ans, i64 0, i64 %indvars.iv83
  %112 = load i64, ptr %111, align 8, !tbaa !11
  %113 = add nsw i32 %110, -1
  %114 = zext i32 %113 to i64
  %115 = icmp eq i64 %indvars.iv83, %114
  %116 = zext i1 %115 to i64
  %117 = getelementptr inbounds [3 x i8], ptr @.str.4, i64 0, i64 %116
  %118 = load i8, ptr %117, align 1, !tbaa !22
  %119 = sext i8 %118 to i32
  %120 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %112, i32 noundef %119)
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %121 = load i32, ptr %1, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = icmp slt i64 %indvars.iv.next84, %122
  br i1 %123, label %.lr.ph64, label %._crit_edge65, !llvm.loop !23
}

; 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 hidden void @"_ZSt4sortIPiZ5solvevE3$_0EvT_S2_T0_"(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 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !18, !19}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10, !19, !18}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !10}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass