; LLVM IR from tangjz/acm-icpc :: leetcode/extra (meituan_002-小美的仓库整理)

; 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"

@_ZZ4mainE1w = external hidden global [50001 x i32], align 16
@_ZZ4mainE1p = external hidden global [50001 x i32], align 16
@_ZZ4mainE3out = external hidden global [50001 x i32], align 16
@_ZZ4mainE1s = external hidden global [50001 x i32], align 16
@_ZZ4mainE2pL = external hidden global [50001 x i32], align 16
@_ZZ4mainE2pR = external hidden global [50001 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; 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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %31, %0
  %12 = load i32, ptr %4, align 4, !tbaa !5
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = icmp sle i32 %12, %13
  br i1 %14, label %16, label %15

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

16:                                               ; preds = %11
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds i32, ptr @_ZZ4mainE1w, i64 %18
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %19)
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %22
  store i32 0, ptr %23, align 4, !tbaa !5
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE2pR, i64 0, i64 %26
  store i32 %24, ptr %27, align 4, !tbaa !5
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE2pL, i64 0, i64 %29
  store i32 %24, ptr %30, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %16
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %4, align 4, !tbaa !5
  br label %11, !llvm.loop !9

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

35:                                               ; preds = %45, %34
  %36 = load i32, ptr %5, align 4, !tbaa !5
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = icmp sle i32 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %48

40:                                               ; preds = %35
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr @_ZZ4mainE1p, i64 %42
  %44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %43)
  br label %45

45:                                               ; preds = %40
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %5, align 4, !tbaa !5
  br label %35, !llvm.loop !11

48:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %49 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %49, ptr %6, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %168, %48
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = icmp sge i32 %51, 1
  br i1 %52, label %54, label %53

53:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %171

54:                                               ; preds = %50
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = load i32, ptr %6, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE3out, i64 0, i64 %57
  store i32 %55, ptr %58, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1p, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  store i32 %62, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1p, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  store i32 %66, ptr %8, align 4, !tbaa !5
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1w, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %72
  store i32 %70, ptr %73, align 4, !tbaa !5
  %74 = load i32, ptr %7, align 4, !tbaa !5
  %75 = icmp sgt i32 %74, 1
  br i1 %75, label %76, label %117

76:                                               ; preds = %54
  %77 = load i32, ptr %7, align 4, !tbaa !5
  %78 = sub nsw i32 %77, 1
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %117

83:                                               ; preds = %76
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = sub nsw i32 %88, 1
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = add nsw i32 %87, %92
  %94 = load i32, ptr %8, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %95
  store i32 %93, ptr %96, align 4, !tbaa !5
  %97 = load i32, ptr %7, align 4, !tbaa !5
  %98 = sub nsw i32 %97, 1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE2pL, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  store i32 %101, ptr %7, align 4, !tbaa !5
  %102 = load i32, ptr %8, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = load i32, ptr %7, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %107
  store i32 %105, ptr %108, align 4, !tbaa !5
  %109 = load i32, ptr %7, align 4, !tbaa !5
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE2pL, i64 0, i64 %111
  store i32 %109, ptr %112, align 4, !tbaa !5
  %113 = load i32, ptr %8, align 4, !tbaa !5
  %114 = load i32, ptr %7, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE2pR, i64 0, i64 %115
  store i32 %113, ptr %116, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %83, %76, %54
  %118 = load i32, ptr %8, align 4, !tbaa !5
  %119 = load i32, ptr %2, align 4, !tbaa !5
  %120 = icmp slt i32 %118, %119
  br i1 %120, label %121, label %162

121:                                              ; preds = %117
  %122 = load i32, ptr %8, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %162

128:                                              ; preds = %121
  %129 = load i32, ptr %8, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = load i32, ptr %8, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = add nsw i32 %132, %137
  %139 = load i32, ptr %7, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %140
  store i32 %138, ptr %141, align 4, !tbaa !5
  %142 = load i32, ptr %8, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE2pR, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !5
  store i32 %146, ptr %8, align 4, !tbaa !5
  %147 = load i32, ptr %7, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = load i32, ptr %8, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %152
  store i32 %150, ptr %153, align 4, !tbaa !5
  %154 = load i32, ptr %7, align 4, !tbaa !5
  %155 = load i32, ptr %8, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE2pL, i64 0, i64 %156
  store i32 %154, ptr %157, align 4, !tbaa !5
  %158 = load i32, ptr %8, align 4, !tbaa !5
  %159 = load i32, ptr %7, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE2pR, i64 0, i64 %160
  store i32 %158, ptr %161, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %128, %121, %117
  %163 = load i32, ptr %7, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %164
  %166 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %165)
  %167 = load i32, ptr %166, align 4, !tbaa !5
  store i32 %167, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %168

168:                                              ; preds = %162
  %169 = load i32, ptr %6, align 4, !tbaa !5
  %170 = add nsw i32 %169, -1
  store i32 %170, ptr %6, align 4, !tbaa !5
  br label %50, !llvm.loop !12

171:                                              ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %172

172:                                              ; preds = %183, %171
  %173 = load i32, ptr %9, align 4, !tbaa !5
  %174 = load i32, ptr %2, align 4, !tbaa !5
  %175 = icmp sle i32 %173, %174
  br i1 %175, label %177, label %176

176:                                              ; preds = %172
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %186

177:                                              ; preds = %172
  %178 = load i32, ptr %9, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE3out, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %181)
  br label %183

183:                                              ; preds = %177
  %184 = load i32, ptr %9, align 4, !tbaa !5
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %9, align 4, !tbaa !5
  br label %172, !llvm.loop !13

186:                                              ; preds = %176
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  ret i32 0
}

; 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 i32 @printf(ptr 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}


; 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"

@_ZZ4mainE1w = external hidden global [50001 x i32], align 16
@_ZZ4mainE1p = external hidden global [50001 x i32], align 16
@_ZZ4mainE3out = external hidden local_unnamed_addr global [50001 x i32], align 16
@_ZZ4mainE1s = external hidden global [50001 x i32], align 16
@_ZZ4mainE2pL = external hidden local_unnamed_addr global [50001 x i32], align 16
@_ZZ4mainE2pR = external hidden local_unnamed_addr global [50001 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() 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
  store i32 0, ptr %2, align 4, !tbaa !5
  %3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %4 = load i32, ptr %1, align 4, !tbaa !5
  %.not59 = icmp slt i32 %4, 1
  br i1 %.not59, label %._crit_edge, label %.lr.ph

.preheader58:                                     ; preds = %.lr.ph
  %.not5361 = icmp slt i32 %11, 1
  br i1 %.not5361, label %._crit_edge, label %.lr.ph63

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %5 = getelementptr inbounds i32, ptr @_ZZ4mainE1w, i64 %indvars.iv
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %5)
  %7 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %indvars.iv
  store i32 0, ptr %7, align 4, !tbaa !5
  %8 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE2pR, i64 0, i64 %indvars.iv
  %9 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %9, ptr %8, align 4, !tbaa !5
  %10 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE2pL, i64 0, i64 %indvars.iv
  store i32 %9, ptr %10, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %.not.not = icmp slt i64 %indvars.iv, %12
  br i1 %.not.not, label %.lr.ph, label %.preheader58, !llvm.loop !9

.preheader57:                                     ; preds = %.lr.ph63
  %13 = icmp sgt i32 %17, 0
  br i1 %13, label %.lr.ph65.preheader, label %._crit_edge

.lr.ph65.preheader:                               ; preds = %.preheader57
  %14 = zext nneg i32 %17 to i64
  br label %.lr.ph65

.lr.ph63:                                         ; preds = %.preheader58, %.lr.ph63
  %indvars.iv71 = phi i64 [ %indvars.iv.next72, %.lr.ph63 ], [ 1, %.preheader58 ]
  %15 = getelementptr inbounds i32, ptr @_ZZ4mainE1p, i64 %indvars.iv71
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %15)
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %.not53.not = icmp slt i64 %indvars.iv71, %18
  br i1 %.not53.not, label %.lr.ph63, label %.preheader57, !llvm.loop !11

.preheader:                                       ; preds = %61
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  %19 = icmp slt i32 %.pre, 1
  br i1 %19, label %._crit_edge, label %.lr.ph68

.lr.ph65:                                         ; preds = %.lr.ph65.preheader, %61
  %20 = phi i32 [ 0, %.lr.ph65.preheader ], [ %65, %61 ]
  %indvars.iv74 = phi i64 [ %14, %.lr.ph65.preheader ], [ %indvars.iv.next75, %61 ]
  %21 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE3out, i64 0, i64 %indvars.iv74
  store i32 %20, ptr %21, align 4, !tbaa !5
  %22 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1p, i64 0, i64 %indvars.iv74
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1w, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %24
  store i32 %26, ptr %27, align 4, !tbaa !5
  %28 = icmp sgt i32 %23, 1
  br i1 %28, label %29, label %42

29:                                               ; preds = %.lr.ph65
  %30 = add nsw i32 %23, -1
  %31 = zext nneg i32 %30 to i64
  %32 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %.not55 = icmp eq i32 %33, 0
  br i1 %.not55, label %42, label %34

34:                                               ; preds = %29
  %35 = add nsw i32 %33, %26
  store i32 %35, ptr %27, align 4, !tbaa !5
  %36 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE2pL, i64 0, i64 %31
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %38
  store i32 %35, ptr %39, align 4, !tbaa !5
  %40 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE2pL, i64 0, i64 %24
  store i32 %37, ptr %40, align 4, !tbaa !5
  %41 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE2pR, i64 0, i64 %38
  store i32 %23, ptr %41, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %34, %29, %.lr.ph65
  %.045 = phi i32 [ %37, %34 ], [ %23, %29 ], [ %23, %.lr.ph65 ]
  %43 = load i32, ptr %1, align 4, !tbaa !5
  %44 = icmp slt i32 %23, %43
  br i1 %44, label %45, label %61

45:                                               ; preds = %42
  %46 = add nsw i32 %23, 1
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %.not56 = icmp eq i32 %49, 0
  br i1 %.not56, label %61, label %50

50:                                               ; preds = %45
  %51 = load i32, ptr %27, align 4, !tbaa !5
  %52 = add nsw i32 %51, %49
  %53 = sext i32 %.045 to i64
  %54 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %53
  store i32 %52, ptr %54, align 4, !tbaa !5
  %55 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE2pR, i64 0, i64 %47
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %57
  store i32 %52, ptr %58, align 4, !tbaa !5
  %59 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE2pL, i64 0, i64 %57
  store i32 %.045, ptr %59, align 4, !tbaa !5
  %60 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE2pR, i64 0, i64 %53
  store i32 %56, ptr %60, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %50, %45, %42
  %62 = sext i32 %.045 to i64
  %63 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1s, i64 0, i64 %62
  %64 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %63)
  %65 = load i32, ptr %64, align 4, !tbaa !5
  store i32 %65, ptr %2, align 4, !tbaa !5
  %indvars.iv.next75 = add nsw i64 %indvars.iv74, -1
  %66 = icmp sgt i64 %indvars.iv74, 1
  br i1 %66, label %.lr.ph65, label %.preheader, !llvm.loop !12

._crit_edge:                                      ; preds = %.lr.ph68, %0, %.preheader58, %.preheader57, %.preheader
  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 i32 0

.lr.ph68:                                         ; preds = %.preheader, %.lr.ph68
  %indvars.iv77 = phi i64 [ %indvars.iv.next78, %.lr.ph68 ], [ 1, %.preheader ]
  %67 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE3out, i64 0, i64 %indvars.iv77
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %68)
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %70 = load i32, ptr %1, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %.not54.not = icmp slt i64 %indvars.iv77, %71
  br i1 %.not54.not, label %.lr.ph68, label %._crit_edge, !llvm.loop !13
}

; 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

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

attributes #0 = { mustprogress norecurse nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


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