; LLVM IR from Tunghohin/Competitive_Coding :: Luogu (p1091)

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

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

@a = external dso_local global [110 x i32], align 16
@up = external dso_local global [110 x i32], align 16
@dw = external dso_local global [110 x i32], align 16
@num = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  %13 = 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 %14

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

18:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %27

19:                                               ; preds = %14
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [110 x i32], ptr @a, i64 0, i64 %21
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %22)
  br label %24

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

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

28:                                               ; preds = %68, %27
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = icmp sle i32 %29, %30
  br i1 %31, label %33, label %32

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

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

34:                                               ; preds = %64, %33
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %39, label %38

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

39:                                               ; preds = %34
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [110 x i32], ptr @a, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = load i32, ptr %4, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [110 x i32], ptr @a, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = icmp slt i32 %43, %47
  br i1 %48, label %49, label %63

49:                                               ; preds = %39
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [110 x i32], ptr @up, i64 0, i64 %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [110 x i32], ptr @up, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %7, align 4, !tbaa !5
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %52, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [110 x i32], ptr @up, i64 0, i64 %61
  store i32 %59, ptr %62, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %63

63:                                               ; preds = %49, %39
  br label %64

64:                                               ; preds = %63
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %6, align 4, !tbaa !5
  br label %34, !llvm.loop !11

67:                                               ; preds = %38
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %4, align 4, !tbaa !5
  br label %28, !llvm.loop !12

71:                                               ; preds = %32
  %72 = load i32, ptr %2, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [110 x i32], ptr @dw, i64 0, i64 %74
  store i32 0, ptr %75, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %76 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %76, ptr %8, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %118, %71
  %78 = load i32, ptr %8, align 4, !tbaa !5
  %79 = icmp sge i32 %78, 1
  br i1 %79, label %81, label %80

80:                                               ; preds = %77
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %121

81:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %82 = load i32, ptr %2, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %9, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %114, %81
  %85 = load i32, ptr %9, align 4, !tbaa !5
  %86 = load i32, ptr %8, align 4, !tbaa !5
  %87 = icmp sgt i32 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %117

89:                                               ; preds = %84
  %90 = load i32, ptr %9, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [110 x i32], ptr @a, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = load i32, ptr %8, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [110 x i32], ptr @a, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = icmp slt i32 %93, %97
  br i1 %98, label %99, label %113

99:                                               ; preds = %89
  %100 = load i32, ptr %8, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [110 x i32], ptr @dw, i64 0, i64 %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %103 = load i32, ptr %9, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [110 x i32], ptr @dw, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %10, align 4, !tbaa !5
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %102, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [110 x i32], ptr @dw, i64 0, i64 %111
  store i32 %109, ptr %112, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %113

113:                                              ; preds = %99, %89
  br label %114

114:                                              ; preds = %113
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = add nsw i32 %115, -1
  store i32 %116, ptr %9, align 4, !tbaa !5
  br label %84, !llvm.loop !13

117:                                              ; preds = %88
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %8, align 4, !tbaa !5
  %120 = add nsw i32 %119, -1
  store i32 %120, ptr %8, align 4, !tbaa !5
  br label %77, !llvm.loop !14

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

122:                                              ; preds = %140, %121
  %123 = load i32, ptr %11, align 4, !tbaa !5
  %124 = load i32, ptr %2, align 4, !tbaa !5
  %125 = icmp sle i32 %123, %124
  br i1 %125, label %127, label %126

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

127:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %128 = load i32, ptr %11, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [110 x i32], ptr @up, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = load i32, ptr %11, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [110 x i32], ptr @dw, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = add nsw i32 %131, %135
  %137 = sub nsw i32 %136, 1
  store i32 %137, ptr %12, align 4, !tbaa !5
  %138 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @num, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %139 = load i32, ptr %138, align 4, !tbaa !5
  store i32 %139, ptr @num, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %140

140:                                              ; preds = %127
  %141 = load i32, ptr %11, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %11, align 4, !tbaa !5
  br label %122, !llvm.loop !15

143:                                              ; preds = %126
  %144 = load i32, ptr %2, align 4, !tbaa !5
  %145 = load i32, ptr @num, align 4, !tbaa !5
  %146 = sub nsw i32 %144, %145
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %146)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %148 = load i32, ptr %1, align 4
  ret i32 %148
}

; 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 nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #2

attributes #0 = { mustprogress norecurse 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 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 = 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"

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

@a = external dso_local global [110 x i32], align 16
@up = external dso_local global [110 x i32], align 16
@dw = external dso_local global [110 x i32], align 16
@num = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %6 = load i32, ptr %1, align 4, !tbaa !5
  %.not39 = icmp slt i32 %6, 1
  br i1 %.not39, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %0
  store i32 0, ptr @up, align 16, !tbaa !5
  br label %._crit_edge44.thread

._crit_edge:                                      ; preds = %.lr.ph
  store i32 0, ptr @up, align 16, !tbaa !5
  %.not3542 = icmp slt i32 %9, 1
  br i1 %.not3542, label %._crit_edge44.thread, label %.preheader37

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

.preheader37:                                     ; preds = %._crit_edge, %21
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %21 ], [ 1, %._crit_edge ]
  %11 = getelementptr inbounds [110 x i32], ptr @a, i64 0, i64 %indvars.iv63
  %12 = getelementptr inbounds [110 x i32], ptr @up, i64 0, i64 %indvars.iv63
  br label %24

._crit_edge44.thread:                             ; preds = %._crit_edge, %._crit_edge.thread
  %.lcssa38.ph = phi i32 [ %6, %._crit_edge.thread ], [ %9, %._crit_edge ]
  %13 = add nsw i32 %.lcssa38.ph, 1
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [110 x i32], ptr @dw, i64 0, i64 %14
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %.preheader.._crit_edge55_crit_edge

._crit_edge44:                                    ; preds = %21
  %16 = add nsw i32 %22, 1
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [110 x i32], ptr @dw, i64 0, i64 %17
  store i32 0, ptr %18, align 4, !tbaa !5
  %19 = icmp sgt i32 %22, 0
  br i1 %19, label %.lr.ph51.preheader, label %.preheader.._crit_edge55_crit_edge

.lr.ph51.preheader:                               ; preds = %._crit_edge44
  %20 = zext nneg i32 %22 to i64
  br label %.lr.ph51

21:                                               ; preds = %35
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %22 = load i32, ptr %1, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %.not35.not = icmp slt i64 %indvars.iv63, %23
  br i1 %.not35.not, label %.preheader37, label %._crit_edge44, !llvm.loop !11

24:                                               ; preds = %.preheader37, %35
  %indvars.iv60 = phi i64 [ 0, %.preheader37 ], [ %indvars.iv.next61, %35 ]
  %25 = getelementptr inbounds [110 x i32], ptr @a, i64 0, i64 %indvars.iv60
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = load i32, ptr %11, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %29, label %35

29:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %30 = getelementptr inbounds [110 x i32], ptr @up, i64 0, i64 %indvars.iv60
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %2, align 4, !tbaa !5
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %34 = load i32, ptr %33, align 4, !tbaa !5
  store i32 %34, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  br label %35

35:                                               ; preds = %24, %29
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next61, %indvars.iv63
  br i1 %exitcond.not, label %21, label %24, !llvm.loop !12

.preheader:                                       ; preds = %._crit_edge48
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  %.not3652 = icmp slt i32 %.pre, 1
  br i1 %.not3652, label %.preheader.._crit_edge55_crit_edge, label %.lr.ph54

.preheader.._crit_edge55_crit_edge:               ; preds = %._crit_edge44.thread, %._crit_edge44, %.preheader
  %36 = phi i32 [ %.pre, %.preheader ], [ %.lcssa38.ph, %._crit_edge44.thread ], [ %22, %._crit_edge44 ]
  %.pre72 = load i32, ptr @num, align 4, !tbaa !5
  br label %._crit_edge55

.lr.ph51:                                         ; preds = %.lr.ph51.preheader, %._crit_edge48
  %indvars.iv66 = phi i64 [ %20, %.lr.ph51.preheader ], [ %indvars.iv.next67, %._crit_edge48 ]
  %37 = load i32, ptr %1, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %.not = icmp sgt i64 %indvars.iv66, %38
  br i1 %.not, label %._crit_edge48, label %.lr.ph47

.lr.ph47:                                         ; preds = %.lr.ph51
  %39 = add nsw i32 %37, 1
  %40 = getelementptr inbounds [110 x i32], ptr @a, i64 0, i64 %indvars.iv66
  %41 = getelementptr inbounds [110 x i32], ptr @dw, i64 0, i64 %indvars.iv66
  br label %43

._crit_edge48:                                    ; preds = %55, %.lr.ph51
  %indvars.iv.next67 = add nsw i64 %indvars.iv66, -1
  %42 = icmp sgt i64 %indvars.iv66, 1
  br i1 %42, label %.lr.ph51, label %.preheader, !llvm.loop !13

43:                                               ; preds = %.lr.ph47, %55
  %.02845 = phi i32 [ %39, %.lr.ph47 ], [ %56, %55 ]
  %44 = zext nneg i32 %.02845 to i64
  %45 = getelementptr inbounds [110 x i32], ptr @a, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = load i32, ptr %40, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %49, label %55

49:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %50 = getelementptr inbounds [110 x i32], ptr @dw, i64 0, i64 %44
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %3, align 4, !tbaa !5
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %41, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %54 = load i32, ptr %53, align 4, !tbaa !5
  store i32 %54, ptr %41, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  br label %55

55:                                               ; preds = %43, %49
  %56 = add nsw i32 %.02845, -1
  %57 = sext i32 %56 to i64
  %58 = icmp slt i64 %indvars.iv66, %57
  br i1 %58, label %43, label %._crit_edge48, !llvm.loop !14

._crit_edge55:                                    ; preds = %.lr.ph54, %.preheader.._crit_edge55_crit_edge
  %59 = phi i32 [ %.pre72, %.preheader.._crit_edge55_crit_edge ], [ %69, %.lr.ph54 ]
  %.lcssa = phi i32 [ %36, %.preheader.._crit_edge55_crit_edge ], [ %70, %.lr.ph54 ]
  %60 = sub nsw i32 %.lcssa, %59
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %60)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0

.lr.ph54:                                         ; preds = %.preheader, %.lr.ph54
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %.lr.ph54 ], [ 1, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %62 = getelementptr inbounds [110 x i32], ptr @up, i64 0, i64 %indvars.iv69
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = getelementptr inbounds [110 x i32], ptr @dw, i64 0, i64 %indvars.iv69
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = add i32 %63, -1
  %67 = add i32 %66, %65
  store i32 %67, ptr %4, align 4, !tbaa !5
  %68 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @num, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %69 = load i32, ptr %68, align 4, !tbaa !5
  store i32 %69, ptr @num, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %70 = load i32, ptr %1, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %.not36.not = icmp slt i64 %indvars.iv69, %71
  br i1 %.not36.not, label %.lr.ph54, label %._crit_edge55, !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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

attributes #0 = { mustprogress norecurse 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 = { "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 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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