; LLVM IR from tangjz/acm-icpc :: codeforces/complete (1367F1)

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

%struct.Info = type { i32, i32, i32 }
%class.anon = type { i8 }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ4mainE1a = external hidden global [200001 x i32], align 16
@_ZZ4mainE3ord = external hidden global [200001 x i32], align 16
@_ZZ4mainE3seg = external hidden global [200001 x %struct.Info], align 16
@.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 %class.anon, align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %struct.Info, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %176, %0
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = icmp sle i32 %18, %19
  br i1 %20, label %22, label %21

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

22:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %38, %22
  %25 = load i32, ptr %6, align 4, !tbaa !5
  %26 = load i32, ptr %5, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %24
  %30 = load i32, ptr %6, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds i32, ptr @_ZZ4mainE1a, i64 %31
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %32)
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE3ord, i64 0, i64 %36
  store i32 %34, ptr %37, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %29
  %39 = load i32, ptr %6, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %6, align 4, !tbaa !5
  br label %24, !llvm.loop !9

41:                                               ; preds = %28
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds i32, ptr @_ZZ4mainE3ord, i64 %43
  call void @"_ZSt4sortIPiZ4mainE3$_0EvT_S2_T0_"(ptr noundef @_ZZ4mainE3ord, ptr noundef %44)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %104, %41
  %46 = load i32, ptr %9, align 4, !tbaa !5
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %107

50:                                               ; preds = %45
  %51 = load i32, ptr %9, align 4, !tbaa !5
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %53, label %70

53:                                               ; preds = %50
  %54 = load i32, ptr %9, align 4, !tbaa !5
  %55 = sub nsw i32 %54, 1
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE3ord, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE1a, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = load i32, ptr %9, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE3ord, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE1a, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = icmp ne i32 %61, %68
  br i1 %69, label %70, label %86

70:                                               ; preds = %53, %50
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #6
  %71 = getelementptr inbounds %struct.Info, ptr %10, i32 0, i32 0
  %72 = load i32, ptr %9, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE3ord, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  store i32 %75, ptr %71, align 4, !tbaa !11
  %76 = getelementptr inbounds %struct.Info, ptr %10, i32 0, i32 1
  %77 = load i32, ptr %9, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE3ord, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  store i32 %80, ptr %76, align 4, !tbaa !13
  %81 = getelementptr inbounds %struct.Info, ptr %10, i32 0, i32 2
  store i32 1, ptr %81, align 4, !tbaa !14
  %82 = load i32, ptr %8, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %8, align 4, !tbaa !5
  %84 = sext i32 %82 to i64
  %85 = getelementptr inbounds [200001 x %struct.Info], ptr @_ZZ4mainE3seg, i64 0, i64 %84
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %85, ptr align 4 %10, i64 12, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #6
  br label %103

86:                                               ; preds = %53
  %87 = load i32, ptr %9, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE3ord, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = load i32, ptr %8, align 4, !tbaa !5
  %92 = sub nsw i32 %91, 1
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [200001 x %struct.Info], ptr @_ZZ4mainE3seg, i64 0, i64 %93
  %95 = getelementptr inbounds %struct.Info, ptr %94, i32 0, i32 1
  store i32 %90, ptr %95, align 4, !tbaa !13
  %96 = load i32, ptr %8, align 4, !tbaa !5
  %97 = sub nsw i32 %96, 1
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [200001 x %struct.Info], ptr @_ZZ4mainE3seg, i64 0, i64 %98
  %100 = getelementptr inbounds %struct.Info, ptr %99, i32 0, i32 2
  %101 = load i32, ptr %100, align 4, !tbaa !14
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %100, align 4, !tbaa !14
  br label %103

103:                                              ; preds = %86, %70
  br label %104

104:                                              ; preds = %103
  %105 = load i32, ptr %9, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %9, align 4, !tbaa !5
  br label %45, !llvm.loop !16

107:                                              ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %108 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %108, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %170, %107
  %110 = load i32, ptr %13, align 4, !tbaa !5
  %111 = load i32, ptr %5, align 4, !tbaa !5
  %112 = icmp slt i32 %110, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %109
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %173

114:                                              ; preds = %109
  %115 = load i32, ptr %13, align 4, !tbaa !5
  %116 = load i32, ptr %14, align 4, !tbaa !5
  %117 = icmp eq i32 %115, %116
  br i1 %117, label %118, label %127

118:                                              ; preds = %114
  %119 = load i32, ptr %14, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %14, align 4, !tbaa !5
  %121 = sext i32 %119 to i64
  %122 = getelementptr inbounds [200001 x %struct.Info], ptr @_ZZ4mainE3seg, i64 0, i64 %121
  %123 = getelementptr inbounds %struct.Info, ptr %122, i32 0, i32 2
  %124 = load i32, ptr %123, align 4, !tbaa !14
  %125 = load i32, ptr %12, align 4, !tbaa !5
  %126 = add nsw i32 %125, %124
  store i32 %126, ptr %12, align 4, !tbaa !5
  br label %127

127:                                              ; preds = %118, %114
  br label %128

128:                                              ; preds = %148, %127
  %129 = load i32, ptr %14, align 4, !tbaa !5
  %130 = load i32, ptr %5, align 4, !tbaa !5
  %131 = icmp slt i32 %129, %130
  br i1 %131, label %132, label %145

132:                                              ; preds = %128
  %133 = load i32, ptr %14, align 4, !tbaa !5
  %134 = sub nsw i32 %133, 1
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [200001 x %struct.Info], ptr @_ZZ4mainE3seg, i64 0, i64 %135
  %137 = getelementptr inbounds %struct.Info, ptr %136, i32 0, i32 1
  %138 = load i32, ptr %137, align 4, !tbaa !13
  %139 = load i32, ptr %14, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [200001 x %struct.Info], ptr @_ZZ4mainE3seg, i64 0, i64 %140
  %142 = getelementptr inbounds %struct.Info, ptr %141, i32 0, i32 0
  %143 = load i32, ptr %142, align 4, !tbaa !11
  %144 = icmp slt i32 %138, %143
  br label %145

145:                                              ; preds = %132, %128
  %146 = phi i1 [ false, %128 ], [ %144, %132 ]
  br i1 %146, label %147, label %157

147:                                              ; preds = %145
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %14, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %14, align 4, !tbaa !5
  %151 = sext i32 %149 to i64
  %152 = getelementptr inbounds [200001 x %struct.Info], ptr @_ZZ4mainE3seg, i64 0, i64 %151
  %153 = getelementptr inbounds %struct.Info, ptr %152, i32 0, i32 2
  %154 = load i32, ptr %153, align 4, !tbaa !14
  %155 = load i32, ptr %12, align 4, !tbaa !5
  %156 = add nsw i32 %155, %154
  store i32 %156, ptr %12, align 4, !tbaa !5
  br label %128, !llvm.loop !17

157:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %158 = load i32, ptr %5, align 4, !tbaa !5
  %159 = load i32, ptr %12, align 4, !tbaa !5
  %160 = sub nsw i32 %158, %159
  store i32 %160, ptr %15, align 4, !tbaa !5
  %161 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %162 = load i32, ptr %161, align 4, !tbaa !5
  store i32 %162, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  %163 = load i32, ptr %13, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [200001 x %struct.Info], ptr @_ZZ4mainE3seg, i64 0, i64 %164
  %166 = getelementptr inbounds %struct.Info, ptr %165, i32 0, i32 2
  %167 = load i32, ptr %166, align 4, !tbaa !14
  %168 = load i32, ptr %12, align 4, !tbaa !5
  %169 = sub nsw i32 %168, %167
  store i32 %169, ptr %12, align 4, !tbaa !5
  br label %170

170:                                              ; preds = %157
  %171 = load i32, ptr %13, align 4, !tbaa !5
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %13, align 4, !tbaa !5
  br label %109, !llvm.loop !18

173:                                              ; preds = %113
  %174 = load i32, ptr %11, align 4, !tbaa !5
  %175 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %174)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %176

176:                                              ; preds = %173
  %177 = load i32, ptr %3, align 4, !tbaa !5
  %178 = add nsw i32 %177, 1
  store i32 %178, ptr %3, align 4, !tbaa !5
  br label %17, !llvm.loop !19

179:                                              ; preds = %21
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %180 = load i32, ptr %1, align 4
  ret i32 %180
}

; 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 @"_ZSt4sortIPiZ4mainE3$_0EvT_S2_T0_"(ptr noundef, ptr noundef) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

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 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { 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, !6, i64 0}
!12 = !{!"_ZTS4Info", !6, i64 0, !6, i64 4, !6, i64 8}
!13 = !{!12, !6, i64 4}
!14 = !{!12, !6, i64 8}
!15 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !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"

%struct.Info = type { i32, i32, i32 }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ4mainE1a = external hidden global [200001 x i32], align 16
@_ZZ4mainE3ord = external hidden global [200001 x i32], align 16
@_ZZ4mainE3seg = external hidden local_unnamed_addr global [200001 x %struct.Info], align 16
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; 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
  store i32 1, ptr %1, align 4, !tbaa !5
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %6 = load i32, ptr %1, align 4, !tbaa !5
  %.not68 = icmp slt i32 %6, 1
  br i1 %.not68, label %._crit_edge72, label %.lr.ph71

._crit_edge72:                                    ; preds = %._crit_edge67, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0

.lr.ph71:                                         ; preds = %0, %._crit_edge67
  %.03769 = phi i32 [ %47, %._crit_edge67 ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %8 = load i32, ptr %2, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %.lr.ph71.._crit_edge_crit_edge

.lr.ph71.._crit_edge_crit_edge:                   ; preds = %.lr.ph71
  %.pre88 = sext i32 %8 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph71.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre88, %.lr.ph71.._crit_edge_crit_edge ], [ %19, %.lr.ph ]
  %10 = getelementptr inbounds i32, ptr @_ZZ4mainE3ord, i64 %.pre-phi
  call void @"_ZSt4sortIPiZ4mainE3$_0EvT_S2_T0_"(ptr noundef nonnull @_ZZ4mainE3ord, ptr noundef nonnull %10)
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %13, label %._crit_edge51.thread89

._crit_edge51.thread89:                           ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  store i32 %11, ptr %3, align 4, !tbaa !5
  br label %._crit_edge67

13:                                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %11 to i64
  %.pre = load i32, ptr @_ZZ4mainE3ord, align 16, !tbaa !5
  store i32 %.pre, ptr @_ZZ4mainE3seg, align 16, !tbaa !5
  store i32 %.pre, ptr getelementptr inbounds (i8, ptr @_ZZ4mainE3seg, i64 4), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @_ZZ4mainE3seg, i64 8), align 8, !tbaa !5
  %exitcond.peel.not = icmp eq i32 %11, 1
  br i1 %exitcond.peel.not, label %._crit_edge51.thread, label %.lr.ph50.peel.next

._crit_edge51.thread:                             ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  store i32 %11, ptr %3, align 4, !tbaa !5
  br label %.lr.ph66.preheader

.lr.ph:                                           ; preds = %.lr.ph71, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph71 ]
  %14 = getelementptr inbounds i32, ptr @_ZZ4mainE1a, i64 %indvars.iv
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %14)
  %16 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE3ord, i64 0, i64 %indvars.iv
  %17 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %17, ptr %16, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = icmp slt i64 %indvars.iv.next, %19
  br i1 %20, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge51:                                    ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  store i32 %11, ptr %3, align 4, !tbaa !5
  br i1 %12, label %.lr.ph66.preheader, label %._crit_edge67

.lr.ph66.preheader:                               ; preds = %._crit_edge51.thread, %._crit_edge51
  br label %.lr.ph66

.lr.ph50.peel.next:                               ; preds = %13, %44
  %indvars.iv75 = phi i64 [ %indvars.iv.next76, %44 ], [ 1, %13 ]
  %.03947 = phi i32 [ %.140, %44 ], [ 1, %13 ]
  %21 = add nsw i64 %indvars.iv75, -1
  %22 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE3ord, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE1a, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE3ord, i64 0, i64 %indvars.iv75
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE1a, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %.not44 = icmp eq i32 %26, %31
  br i1 %.not44, label %36, label %32

32:                                               ; preds = %.lr.ph50.peel.next
  %33 = add nsw i32 %.03947, 1
  %34 = sext i32 %.03947 to i64
  %35 = getelementptr inbounds [200001 x %struct.Info], ptr @_ZZ4mainE3seg, i64 0, i64 %34
  store i32 %28, ptr %35, align 4, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %35, i64 4
  store i32 %28, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %35, i64 8
  store i32 1, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !5
  br label %44

36:                                               ; preds = %.lr.ph50.peel.next
  %37 = add nsw i32 %.03947, -1
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [200001 x %struct.Info], ptr @_ZZ4mainE3seg, i64 0, i64 %38
  %40 = getelementptr inbounds i8, ptr %39, i64 4
  store i32 %28, ptr %40, align 4, !tbaa !11
  %41 = getelementptr inbounds i8, ptr %39, i64 8
  %42 = load i32, ptr %41, align 4, !tbaa !13
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %41, align 4, !tbaa !13
  br label %44

44:                                               ; preds = %32, %36
  %.140 = phi i32 [ %33, %32 ], [ %.03947, %36 ]
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge51, label %.lr.ph50.peel.next, !llvm.loop !14

._crit_edge67:                                    ; preds = %.critedge, %._crit_edge51.thread89, %._crit_edge51
  %45 = phi i32 [ %11, %._crit_edge51 ], [ %11, %._crit_edge51.thread89 ], [ %75, %.critedge ]
  %46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %45)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  %47 = add nuw nsw i32 %.03769, 1
  %48 = load i32, ptr %1, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.03769, %48
  br i1 %.not.not, label %.lr.ph71, label %._crit_edge72, !llvm.loop !16

.lr.ph66:                                         ; preds = %.lr.ph66.preheader, %.critedge
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %.critedge ], [ 0, %.lr.ph66.preheader ]
  %49 = phi i32 [ %79, %.critedge ], [ %11, %.lr.ph66.preheader ]
  %.064 = phi i32 [ %.2.lcssa, %.critedge ], [ 0, %.lr.ph66.preheader ]
  %.03462 = phi i32 [ %78, %.critedge ], [ 0, %.lr.ph66.preheader ]
  %50 = zext i32 %.064 to i64
  %51 = icmp eq i64 %indvars.iv83, %50
  br i1 %51, label %52, label %58

52:                                               ; preds = %.lr.ph66
  %53 = add nsw i32 %.064, 1
  %54 = sext i32 %.064 to i64
  %55 = getelementptr inbounds [200001 x %struct.Info], ptr @_ZZ4mainE3seg, i64 0, i64 %54, i32 2
  %56 = load i32, ptr %55, align 4, !tbaa !13
  %57 = add nsw i32 %56, %.03462
  br label %58

58:                                               ; preds = %52, %.lr.ph66
  %.135 = phi i32 [ %57, %52 ], [ %.03462, %.lr.ph66 ]
  %.1 = phi i32 [ %53, %52 ], [ %.064, %.lr.ph66 ]
  %59 = icmp slt i32 %.1, %49
  br i1 %59, label %.lr.ph56.preheader, label %.critedge

.lr.ph56.preheader:                               ; preds = %58
  %60 = sext i32 %.1 to i64
  %61 = sext i32 %49 to i64
  br label %.lr.ph56

.lr.ph56:                                         ; preds = %.lr.ph56.preheader, %68
  %indvars.iv79 = phi i64 [ %60, %.lr.ph56.preheader ], [ %indvars.iv.next80, %68 ]
  %.23653 = phi i32 [ %.135, %.lr.ph56.preheader ], [ %71, %68 ]
  %62 = add nsw i64 %indvars.iv79, -1
  %63 = getelementptr inbounds [200001 x %struct.Info], ptr @_ZZ4mainE3seg, i64 0, i64 %62, i32 1
  %64 = load i32, ptr %63, align 4, !tbaa !11
  %65 = getelementptr inbounds [200001 x %struct.Info], ptr @_ZZ4mainE3seg, i64 0, i64 %indvars.iv79
  %66 = load i32, ptr %65, align 4, !tbaa !17
  %67 = icmp slt i32 %64, %66
  br i1 %67, label %68, label %.critedge.loopexit.split.loop.exit91

68:                                               ; preds = %.lr.ph56
  %indvars.iv.next80 = add nsw i64 %indvars.iv79, 1
  %69 = getelementptr inbounds i8, ptr %65, i64 8
  %70 = load i32, ptr %69, align 4, !tbaa !13
  %71 = add nsw i32 %70, %.23653
  %exitcond82.not = icmp eq i64 %indvars.iv.next80, %61
  br i1 %exitcond82.not, label %.critedge, label %.lr.ph56, !llvm.loop !18

.critedge.loopexit.split.loop.exit91:             ; preds = %.lr.ph56
  %72 = trunc nsw i64 %indvars.iv79 to i32
  br label %.critedge

.critedge:                                        ; preds = %68, %.critedge.loopexit.split.loop.exit91, %58
  %.236.lcssa = phi i32 [ %.135, %58 ], [ %.23653, %.critedge.loopexit.split.loop.exit91 ], [ %71, %68 ]
  %.2.lcssa = phi i32 [ %.1, %58 ], [ %72, %.critedge.loopexit.split.loop.exit91 ], [ %49, %68 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %73 = sub nsw i32 %49, %.236.lcssa
  store i32 %73, ptr %4, align 4, !tbaa !5
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %75 = load i32, ptr %74, align 4, !tbaa !5
  store i32 %75, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  %76 = getelementptr inbounds [200001 x %struct.Info], ptr @_ZZ4mainE3seg, i64 0, i64 %indvars.iv83, i32 2
  %77 = load i32, ptr %76, align 4, !tbaa !13
  %78 = sub nsw i32 %.236.lcssa, %77
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %79 = load i32, ptr %2, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = icmp slt i64 %indvars.iv.next84, %80
  br i1 %81, label %.lr.ph66, label %._crit_edge67, !llvm.loop !19
}

; 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 @"_ZSt4sortIPiZ4mainE3$_0EvT_S2_T0_"(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = { 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 = { 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 #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 = !{!12, !6, i64 4}
!12 = !{!"_ZTS4Info", !6, i64 0, !6, i64 4, !6, i64 8}
!13 = !{!12, !6, i64 8}
!14 = distinct !{!14, !10, !15}
!15 = !{!"llvm.loop.peeled.count", i32 1}
!16 = distinct !{!16, !10}
!17 = !{!12, !6, i64 0}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass