; LLVM IR from lzyrapx/Competitive-Programming :: HDUOJ (5748)

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

@n = external dso_local global i32, align 4
@a = external dso_local global [1000010 x i32], align 16
@b = external dso_local global [1000010 x i32], align 16
@cnt = external dso_local global i32, align 4
@s = external dso_local global [1000010 x i32], align 16
@f = external dso_local global [1000010 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5queryi(i32 noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3updii(i32 noundef, i32 noundef) #0

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

8:                                                ; preds = %126, %0
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = add nsw i32 %9, -1
  store i32 %10, ptr %2, align 4, !tbaa !5
  %11 = icmp ne i32 %9, 0
  br i1 %11, label %12, label %127

12:                                               ; preds = %8
  store i32 0, ptr @cnt, align 4, !tbaa !5
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %32, %12
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %16 = load i32, ptr @n, 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) #5
  br label %35

19:                                               ; preds = %14
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [1000010 x i32], ptr @a, i64 0, i64 %21
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %22)
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [1000010 x i32], ptr @a, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = load i32, ptr @cnt, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr @cnt, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [1000010 x i32], ptr @b, i64 0, i64 %30
  store i32 %27, ptr %31, align 4, !tbaa !5
  br label %32

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

35:                                               ; preds = %18
  %36 = load i32, ptr @cnt, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds i32, ptr @b, i64 %37
  %39 = getelementptr inbounds i32, ptr %38, i64 1
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef getelementptr inbounds (i32, ptr @b, i64 1), ptr noundef %39)
  %40 = load i32, ptr @cnt, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds i32, ptr @b, i64 %41
  %43 = getelementptr inbounds i32, ptr %42, i64 1
  %44 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef getelementptr inbounds (i32, ptr @b, i64 1), ptr noundef %43)
  %45 = ptrtoint ptr %44 to i64
  %46 = sub i64 %45, ptrtoint (ptr @b to i64)
  %47 = sdiv exact i64 %46, 4
  %48 = sub nsw i64 %47, 1
  %49 = trunc i64 %48 to i32
  store i32 %49, ptr @cnt, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %71, %35
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = load i32, ptr @n, align 4, !tbaa !5
  %53 = icmp sle i32 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %74

55:                                               ; preds = %50
  %56 = load i32, ptr @cnt, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds i32, ptr @b, i64 %57
  %59 = getelementptr inbounds i32, ptr %58, i64 1
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [1000010 x i32], ptr @a, i64 0, i64 %61
  %63 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef getelementptr inbounds (i32, ptr @b, i64 1), ptr noundef %59, ptr noundef nonnull align 4 dereferenceable(4) %62)
  %64 = ptrtoint ptr %63 to i64
  %65 = sub i64 %64, ptrtoint (ptr @b to i64)
  %66 = sdiv exact i64 %65, 4
  %67 = trunc i64 %66 to i32
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [1000010 x i32], ptr @a, i64 0, i64 %69
  store i32 %67, ptr %70, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %55
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %4, align 4, !tbaa !5
  br label %50, !llvm.loop !11

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

75:                                               ; preds = %84, %74
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = load i32, ptr @cnt, align 4, !tbaa !5
  %78 = icmp sle i32 %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %87

80:                                               ; preds = %75
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [1000010 x i32], ptr @s, i64 0, i64 %82
  store i32 0, ptr %83, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %80
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %5, align 4, !tbaa !5
  br label %75, !llvm.loop !12

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

88:                                               ; preds = %123, %87
  %89 = load i32, ptr %6, align 4, !tbaa !5
  %90 = load i32, ptr @n, align 4, !tbaa !5
  %91 = icmp sle i32 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %126

93:                                               ; preds = %88
  %94 = load i32, ptr %6, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [1000010 x i32], ptr @a, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = sub nsw i32 %97, 1
  %99 = call noundef i32 @_Z5queryi(i32 noundef %98)
  %100 = add nsw i32 %99, 1
  %101 = load i32, ptr %6, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [1000010 x i32], ptr @f, i64 0, i64 %102
  store i32 %100, ptr %103, align 4, !tbaa !5
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [1000010 x i32], ptr @a, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = load i32, ptr %6, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [1000010 x i32], ptr @f, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  call void @_Z3updii(i32 noundef %107, i32 noundef %111)
  %112 = load i32, ptr %6, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [1000010 x i32], ptr @f, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = load i32, ptr %6, align 4, !tbaa !5
  %117 = load i32, ptr @n, align 4, !tbaa !5
  %118 = icmp eq i32 %116, %117
  %119 = zext i1 %118 to i64
  %120 = select i1 %118, i8 10, i8 32
  %121 = sext i8 %120 to i32
  %122 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %115, i32 noundef %121)
  br label %123

123:                                              ; preds = %93
  %124 = load i32, ptr %6, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %6, align 4, !tbaa !5
  br label %88, !llvm.loop !13

126:                                              ; preds = %92
  br label %8, !llvm.loop !14

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef, ptr noundef) #4

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

declare i32 @printf(ptr noundef, ...) #3

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 = { 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 #3 = { "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 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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !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"

@n = external dso_local global i32, align 4
@a = external dso_local global [1000010 x i32], align 16
@b = external dso_local global [1000010 x i32], align 16
@cnt = external dso_local local_unnamed_addr global i32, align 4
@s = external dso_local local_unnamed_addr global [1000010 x i32], align 16
@f = external dso_local local_unnamed_addr global [1000010 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5queryi(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3updii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %3 = load i32, ptr %1, align 4, !tbaa !5
  %4 = add nsw i32 %3, -1
  store i32 %4, ptr %1, align 4, !tbaa !5
  %.not41 = icmp eq i32 %3, 0
  br i1 %.not41, label %._crit_edge44, label %.lr.ph43

.loopexit:                                        ; preds = %.lr.ph38, %.preheader
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = add nsw i32 %5, -1
  store i32 %6, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %._crit_edge44, label %.lr.ph43, !llvm.loop !9

.lr.ph43:                                         ; preds = %0, %.loopexit
  store i32 0, ptr @cnt, align 4, !tbaa !5
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %.not2227 = icmp slt i32 %8, 1
  br i1 %.not2227, label %.lr.ph43.._crit_edge_crit_edge, label %.lr.ph

.lr.ph43.._crit_edge_crit_edge:                   ; preds = %.lr.ph43
  %.pre = load i32, ptr @cnt, align 4, !tbaa !5
  %.pre56 = sext i32 %.pre to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph43.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre56, %.lr.ph43.._crit_edge_crit_edge ], [ %23, %.lr.ph ]
  %gep39 = getelementptr i32, ptr getelementptr inbounds (i8, ptr @b, i64 4), i64 %.pre-phi
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull getelementptr inbounds (i8, ptr @b, i64 4), ptr noundef nonnull %gep39)
  %9 = load i32, ptr @cnt, align 4, !tbaa !5
  %10 = sext i32 %9 to i64
  %gep40 = getelementptr i32, ptr getelementptr inbounds (i8, ptr @b, i64 4), i64 %10
  %11 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef nonnull getelementptr inbounds (i8, ptr @b, i64 4), ptr noundef nonnull %gep40)
  %12 = ptrtoint ptr %11 to i64
  %13 = sub i64 %12, ptrtoint (ptr @b to i64)
  %14 = lshr exact i64 %13, 2
  %15 = trunc i64 %14 to i32
  %16 = add i32 %15, -1
  store i32 %16, ptr @cnt, align 4, !tbaa !5
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %.not2329 = icmp slt i32 %17, 1
  br i1 %.not2329, label %.preheader26, label %.lr.ph32

.lr.ph:                                           ; preds = %.lr.ph43, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.lr.ph43 ]
  %18 = getelementptr inbounds [1000010 x i32], ptr @a, i64 0, i64 %indvars.iv
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %18)
  %20 = load i32, ptr %18, align 4, !tbaa !5
  %21 = load i32, ptr @cnt, align 4, !tbaa !5
  %22 = add nsw i32 %21, 1
  store i32 %22, ptr @cnt, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [1000010 x i32], ptr @b, i64 0, i64 %23
  store i32 %20, ptr %24, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %.not22.not = icmp slt i64 %indvars.iv, %26
  br i1 %.not22.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.preheader26.loopexit:                            ; preds = %.lr.ph32
  %.pre55 = load i32, ptr @cnt, align 4, !tbaa !5
  br label %.preheader26

.preheader26:                                     ; preds = %.preheader26.loopexit, %._crit_edge
  %27 = phi i32 [ %39, %.preheader26.loopexit ], [ %17, %._crit_edge ]
  %28 = phi i32 [ %.pre55, %.preheader26.loopexit ], [ %16, %._crit_edge ]
  %.not2433 = icmp slt i32 %28, 1
  br i1 %.not2433, label %.preheader, label %.lr.ph35.preheader

.lr.ph35.preheader:                               ; preds = %.preheader26
  %29 = zext nneg i32 %28 to i64
  %30 = shl nuw nsw i64 %29, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @s, i64 4), i8 0, i64 %30, i1 false), !tbaa !5
  br label %.preheader

.lr.ph32:                                         ; preds = %._crit_edge, %.lr.ph32
  %indvars.iv46 = phi i64 [ %indvars.iv.next47, %.lr.ph32 ], [ 1, %._crit_edge ]
  %31 = load i32, ptr @cnt, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %gep = getelementptr i32, ptr getelementptr inbounds (i8, ptr @b, i64 4), i64 %32
  %33 = getelementptr inbounds [1000010 x i32], ptr @a, i64 0, i64 %indvars.iv46
  %34 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @b, i64 4), ptr noundef nonnull %gep, ptr noundef nonnull align 4 dereferenceable(4) %33)
  %35 = ptrtoint ptr %34 to i64
  %36 = sub i64 %35, ptrtoint (ptr @b to i64)
  %37 = lshr exact i64 %36, 2
  %38 = trunc i64 %37 to i32
  store i32 %38, ptr %33, align 4, !tbaa !5
  %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %.not23.not = icmp slt i64 %indvars.iv46, %40
  br i1 %.not23.not, label %.lr.ph32, label %.preheader26.loopexit, !llvm.loop !12

.preheader:                                       ; preds = %.lr.ph35.preheader, %.preheader26
  %.not2536 = icmp slt i32 %27, 1
  br i1 %.not2536, label %.loopexit, label %.lr.ph38

.lr.ph38:                                         ; preds = %.preheader, %.lr.ph38
  %indvars.iv52 = phi i64 [ %indvars.iv.next53, %.lr.ph38 ], [ 1, %.preheader ]
  %41 = getelementptr inbounds [1000010 x i32], ptr @a, i64 0, i64 %indvars.iv52
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = add nsw i32 %42, -1
  %44 = call noundef i32 @_Z5queryi(i32 noundef %43)
  %45 = add nsw i32 %44, 1
  %46 = getelementptr inbounds [1000010 x i32], ptr @f, i64 0, i64 %indvars.iv52
  store i32 %45, ptr %46, align 4, !tbaa !5
  %47 = load i32, ptr %41, align 4, !tbaa !5
  call void @_Z3updii(i32 noundef %47, i32 noundef %45)
  %48 = load i32, ptr %46, align 4, !tbaa !5
  %49 = load i32, ptr @n, align 4, !tbaa !5
  %50 = zext i32 %49 to i64
  %51 = icmp eq i64 %indvars.iv52, %50
  %52 = select i1 %51, i32 10, i32 32
  %53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %48, i32 noundef %52)
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %.not25.not = icmp slt i64 %indvars.iv52, %55
  br i1 %.not25.not, label %.lr.ph38, label %.loopexit, !llvm.loop !13

._crit_edge44:                                    ; preds = %.loopexit, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef, ptr noundef, 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 #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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 = { 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 #3 = { 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 #4 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


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