; LLVM IR from eyangch/competitive-programming :: Codeforces/1712 (d)

; 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_istream" = type { ptr, i64, %"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%class.anon = type { i8 }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@A = external dso_local global [100000 x i64], align 16
@B = external dso_local global [100000 x i64], align 16
@I = external dso_local global [100000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_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 i64, align 8
  %3 = alloca %class.anon, align 1
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %10 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %12
  %14 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  %15 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  br label %17

17:                                               ; preds = %99, %0
  %18 = load i64, ptr @T, align 8, !tbaa !8
  %19 = add nsw i64 %18, -1
  store i64 %19, ptr @T, align 8, !tbaa !8
  %20 = icmp ne i64 %18, 0
  br i1 %20, label %21, label %111

21:                                               ; preds = %17
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(8) @K)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %24

24:                                               ; preds = %41, %21
  %25 = load i64, ptr %2, align 8, !tbaa !8
  %26 = load i64, ptr @N, align 8, !tbaa !8
  %27 = icmp slt i64 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %44

29:                                               ; preds = %24
  %30 = load i64, ptr %2, align 8, !tbaa !8
  %31 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %30
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %31)
  %33 = load i64, ptr %2, align 8, !tbaa !8
  %34 = load i64, ptr %2, align 8, !tbaa !8
  %35 = getelementptr inbounds [100000 x i64], ptr @I, i64 0, i64 %34
  store i64 %33, ptr %35, align 8, !tbaa !8
  %36 = load i64, ptr %2, align 8, !tbaa !8
  %37 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %36
  %38 = load i64, ptr %37, align 8, !tbaa !8
  %39 = load i64, ptr %2, align 8, !tbaa !8
  %40 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %39
  store i64 %38, ptr %40, align 8, !tbaa !8
  br label %41

41:                                               ; preds = %29
  %42 = load i64, ptr %2, align 8, !tbaa !8
  %43 = add nsw i64 %42, 1
  store i64 %43, ptr %2, align 8, !tbaa !8
  br label %24, !llvm.loop !11

44:                                               ; preds = %28
  %45 = load i64, ptr @N, align 8, !tbaa !8
  %46 = getelementptr inbounds i64, ptr @I, i64 %45
  call void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef @I, ptr noundef %46)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 1000000000, ptr %4, align 8, !tbaa !8
  %47 = load i64, ptr @K, align 8, !tbaa !8
  %48 = icmp eq i64 %47, 1
  br i1 %48, label %49, label %54

49:                                               ; preds = %44
  %50 = load i64, ptr @N, align 8, !tbaa !8
  %51 = getelementptr inbounds i64, ptr @A, i64 %50
  %52 = call noundef ptr @_ZSt11max_elementIPxET_S1_S1_(ptr noundef @A, ptr noundef %51)
  %53 = load i64, ptr %52, align 8, !tbaa !8
  store i64 %53, ptr %4, align 8, !tbaa !8
  br label %54

54:                                               ; preds = %49, %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i64 0, ptr %5, align 8, !tbaa !8
  br label %55

55:                                               ; preds = %66, %54
  %56 = load i64, ptr %5, align 8, !tbaa !8
  %57 = load i64, ptr @K, align 8, !tbaa !8
  %58 = sub nsw i64 %57, 1
  %59 = icmp slt i64 %56, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %69

61:                                               ; preds = %55
  %62 = load i64, ptr %5, align 8, !tbaa !8
  %63 = getelementptr inbounds [100000 x i64], ptr @I, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !8
  %65 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %64
  store i64 1000000000, ptr %65, align 8, !tbaa !8
  br label %66

66:                                               ; preds = %61
  %67 = load i64, ptr %5, align 8, !tbaa !8
  %68 = add nsw i64 %67, 1
  store i64 %68, ptr %5, align 8, !tbaa !8
  br label %55, !llvm.loop !13

69:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %70 = load i64, ptr @N, align 8, !tbaa !8
  %71 = getelementptr inbounds i64, ptr @A, i64 %70
  %72 = call noundef ptr @_ZSt11min_elementIPxET_S1_S1_(ptr noundef @A, ptr noundef %71)
  %73 = load i64, ptr %72, align 8, !tbaa !8
  %74 = mul nsw i64 %73, 2
  store i64 %74, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %76 = load i64, ptr %75, align 8, !tbaa !8
  store i64 %76, ptr %7, align 8, !tbaa !8
  %77 = load i64, ptr @K, align 8, !tbaa !8
  %78 = sub nsw i64 %77, 1
  %79 = getelementptr inbounds [100000 x i64], ptr @I, i64 0, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !8
  %81 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %80
  store i64 1000000000, ptr %81, align 8, !tbaa !8
  store i64 0, ptr %4, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 1, ptr %8, align 8, !tbaa !8
  br label %82

82:                                               ; preds = %96, %69
  %83 = load i64, ptr %8, align 8, !tbaa !8
  %84 = load i64, ptr @N, align 8, !tbaa !8
  %85 = icmp slt i64 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %99

87:                                               ; preds = %82
  %88 = load i64, ptr %8, align 8, !tbaa !8
  %89 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %88
  %90 = load i64, ptr %8, align 8, !tbaa !8
  %91 = sub nsw i64 %90, 1
  %92 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %91
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %89, ptr noundef nonnull align 8 dereferenceable(8) %92)
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %93)
  %95 = load i64, ptr %94, align 8, !tbaa !8
  store i64 %95, ptr %4, align 8, !tbaa !8
  br label %96

96:                                               ; preds = %87
  %97 = load i64, ptr %8, align 8, !tbaa !8
  %98 = add nsw i64 %97, 1
  store i64 %98, ptr %8, align 8, !tbaa !8
  br label %82, !llvm.loop !14

99:                                               ; preds = %86
  %100 = load i64, ptr @N, align 8, !tbaa !8
  %101 = getelementptr inbounds i64, ptr @A, i64 %100
  %102 = call noundef ptr @_ZSt11min_elementIPxET_S1_S1_(ptr noundef @A, ptr noundef %101)
  %103 = load i64, ptr %102, align 8, !tbaa !8
  %104 = mul nsw i64 %103, 2
  store i64 %104, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %106 = load i64, ptr %105, align 8, !tbaa !8
  store i64 %106, ptr %9, align 8, !tbaa !8
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %108 = load i64, ptr %107, align 8, !tbaa !8
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %108)
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %109, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %17, !llvm.loop !15

111:                                              ; preds = %17
  %112 = load i32, ptr %1, align 4
  ret i32 %112
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef, ptr noundef) #5

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #6

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 align 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 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 #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 = { 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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { 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 #7 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


; 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_istream" = type { ptr, i64, %"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@A = external dso_local global [100000 x i64], align 16
@B = external dso_local local_unnamed_addr global [100000 x i64], align 16
@I = external dso_local global [100000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_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 i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  %10 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  %12 = load i64, ptr @T, align 8, !tbaa !8
  %13 = add nsw i64 %12, -1
  store i64 %13, ptr @T, align 8, !tbaa !8
  %.not30 = icmp eq i64 %12, 0
  br i1 %.not30, label %._crit_edge33, label %.lr.ph32

.lr.ph32:                                         ; preds = %0, %._crit_edge28
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %16 = load i64, ptr @N, align 8, !tbaa !8
  %17 = icmp sgt i64 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph32
  %.lcssa = phi i64 [ %16, %.lr.ph32 ], [ %27, %.lr.ph ]
  %18 = getelementptr inbounds i64, ptr @I, i64 %.lcssa
  call void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef nonnull @I, ptr noundef nonnull %18)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  store i64 1000000000, ptr %1, align 8, !tbaa !8
  %19 = load i64, ptr @K, align 8, !tbaa !8
  %20 = icmp eq i64 %19, 1
  br i1 %20, label %29, label %34

.lr.ph:                                           ; preds = %.lr.ph32, %.lr.ph
  %.01620 = phi i64 [ %26, %.lr.ph ], [ 0, %.lr.ph32 ]
  %21 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %.01620
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %21)
  %23 = getelementptr inbounds [100000 x i64], ptr @I, i64 0, i64 %.01620
  store i64 %.01620, ptr %23, align 8, !tbaa !8
  %24 = load i64, ptr %21, align 8, !tbaa !8
  %25 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %.01620
  store i64 %24, ptr %25, align 8, !tbaa !8
  %26 = add nuw nsw i64 %.01620, 1
  %27 = load i64, ptr @N, align 8, !tbaa !8
  %28 = icmp slt i64 %26, %27
  br i1 %28, label %.lr.ph, label %._crit_edge, !llvm.loop !11

29:                                               ; preds = %._crit_edge
  %30 = load i64, ptr @N, align 8, !tbaa !8
  %31 = getelementptr inbounds i64, ptr @A, i64 %30
  %32 = call noundef ptr @_ZSt11max_elementIPxET_S1_S1_(ptr noundef nonnull @A, ptr noundef nonnull %31)
  %33 = load i64, ptr %32, align 8, !tbaa !8
  store i64 %33, ptr %1, align 8, !tbaa !8
  %.pre = load i64, ptr @K, align 8, !tbaa !8
  br label %34

34:                                               ; preds = %29, %._crit_edge
  %35 = phi i64 [ %.pre, %29 ], [ %19, %._crit_edge ]
  %36 = icmp sgt i64 %35, 1
  br i1 %36, label %.lr.ph23.preheader, label %._crit_edge24

.lr.ph23.preheader:                               ; preds = %34
  %37 = add nsw i64 %35, -2
  %38 = add nsw i64 %35, -1
  %xtraiter = and i64 %38, 3
  %39 = icmp ult i64 %37, 3
  br i1 %39, label %._crit_edge24.loopexit.unr-lcssa, label %.lr.ph23.preheader.new

.lr.ph23.preheader.new:                           ; preds = %.lr.ph23.preheader
  %unroll_iter = and i64 %38, -4
  br label %.lr.ph23

._crit_edge24.loopexit.unr-lcssa:                 ; preds = %.lr.ph23, %.lr.ph23.preheader
  %.01521.unr = phi i64 [ 0, %.lr.ph23.preheader ], [ %73, %.lr.ph23 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge24, label %.lr.ph23.epil

.lr.ph23.epil:                                    ; preds = %._crit_edge24.loopexit.unr-lcssa, %.lr.ph23.epil
  %.01521.epil = phi i64 [ %43, %.lr.ph23.epil ], [ %.01521.unr, %._crit_edge24.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph23.epil ], [ 0, %._crit_edge24.loopexit.unr-lcssa ]
  %40 = getelementptr inbounds [100000 x i64], ptr @I, i64 0, i64 %.01521.epil
  %41 = load i64, ptr %40, align 8, !tbaa !8
  %42 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %41
  store i64 1000000000, ptr %42, align 8, !tbaa !8
  %43 = add nuw nsw i64 %.01521.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge24, label %.lr.ph23.epil, !llvm.loop !13

._crit_edge24:                                    ; preds = %._crit_edge24.loopexit.unr-lcssa, %.lr.ph23.epil, %34
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %44 = load i64, ptr @N, align 8, !tbaa !8
  %45 = getelementptr inbounds i64, ptr @A, i64 %44
  %46 = call noundef ptr @_ZSt11min_elementIPxET_S1_S1_(ptr noundef nonnull @A, ptr noundef nonnull %45)
  %47 = load i64, ptr %46, align 8, !tbaa !8
  %48 = shl nsw i64 %47, 1
  store i64 %48, ptr %2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %50 = load i64, ptr %49, align 8, !tbaa !8
  store i64 %50, ptr %3, align 8, !tbaa !8
  %51 = load i64, ptr @K, align 8, !tbaa !8
  %52 = add nsw i64 %51, -1
  %53 = getelementptr inbounds [100000 x i64], ptr @I, i64 0, i64 %52
  %54 = load i64, ptr %53, align 8, !tbaa !8
  %55 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %54
  store i64 1000000000, ptr %55, align 8, !tbaa !8
  store i64 0, ptr %1, align 8, !tbaa !8
  %56 = load i64, ptr @N, align 8, !tbaa !8
  %57 = icmp sgt i64 %56, 1
  br i1 %57, label %.lr.ph27, label %._crit_edge28

.lr.ph23:                                         ; preds = %.lr.ph23, %.lr.ph23.preheader.new
  %.01521 = phi i64 [ 0, %.lr.ph23.preheader.new ], [ %73, %.lr.ph23 ]
  %niter = phi i64 [ 0, %.lr.ph23.preheader.new ], [ %niter.next.3, %.lr.ph23 ]
  %58 = getelementptr inbounds [100000 x i64], ptr @I, i64 0, i64 %.01521
  %59 = load i64, ptr %58, align 16, !tbaa !8
  %60 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %59
  store i64 1000000000, ptr %60, align 8, !tbaa !8
  %61 = or disjoint i64 %.01521, 1
  %62 = getelementptr inbounds [100000 x i64], ptr @I, i64 0, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !8
  %64 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %63
  store i64 1000000000, ptr %64, align 8, !tbaa !8
  %65 = or disjoint i64 %.01521, 2
  %66 = getelementptr inbounds [100000 x i64], ptr @I, i64 0, i64 %65
  %67 = load i64, ptr %66, align 16, !tbaa !8
  %68 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %67
  store i64 1000000000, ptr %68, align 8, !tbaa !8
  %69 = or disjoint i64 %.01521, 3
  %70 = getelementptr inbounds [100000 x i64], ptr @I, i64 0, i64 %69
  %71 = load i64, ptr %70, align 8, !tbaa !8
  %72 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %71
  store i64 1000000000, ptr %72, align 8, !tbaa !8
  %73 = add nuw nsw i64 %.01521, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge24.loopexit.unr-lcssa, label %.lr.ph23, !llvm.loop !15

._crit_edge28:                                    ; preds = %.lr.ph27, %._crit_edge24
  %.lcssa19 = phi i64 [ %56, %._crit_edge24 ], [ %93, %.lr.ph27 ]
  %74 = getelementptr inbounds i64, ptr @A, i64 %.lcssa19
  %75 = call noundef ptr @_ZSt11min_elementIPxET_S1_S1_(ptr noundef nonnull @A, ptr noundef nonnull %74)
  %76 = load i64, ptr %75, align 8, !tbaa !8
  %77 = shl nsw i64 %76, 1
  store i64 %77, ptr %2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %79 = load i64, ptr %78, align 8, !tbaa !8
  store i64 %79, ptr %4, align 8, !tbaa !8
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %81 = load i64, ptr %80, align 8, !tbaa !8
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %81)
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %82, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  %84 = load i64, ptr @T, align 8, !tbaa !8
  %85 = add nsw i64 %84, -1
  store i64 %85, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %84, 0
  br i1 %.not, label %._crit_edge33, label %.lr.ph32, !llvm.loop !16

.lr.ph27:                                         ; preds = %._crit_edge24, %.lr.ph27
  %.025 = phi i64 [ %92, %.lr.ph27 ], [ 1, %._crit_edge24 ]
  %86 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %.025
  %87 = add nsw i64 %.025, -1
  %88 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %87
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %86, ptr noundef nonnull align 8 dereferenceable(8) %88)
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %89)
  %91 = load i64, ptr %90, align 8, !tbaa !8
  store i64 %91, ptr %1, align 8, !tbaa !8
  %92 = add nuw nsw i64 %.025, 1
  %93 = load i64, ptr @N, align 8, !tbaa !8
  %94 = icmp slt i64 %92, %93
  br i1 %94, label %.lr.ph27, label %._crit_edge28, !llvm.loop !17

._crit_edge33:                                    ; preds = %._crit_edge28, %0
  ret i32 0
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef, ptr noundef) local_unnamed_addr #5

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #3 align 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 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 #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 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { 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 #7 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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