; LLVM IR from upupming/algorithm :: acwing/算法竞赛进阶指南/0x17-二叉堆/147. 数据备份 (main)

; 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.LNode = type { i32, i32, i32 }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<HNode, std::allocator<HNode>>::_Vector_impl" }
%"struct.std::_Vector_base<HNode, std::allocator<HNode>>::_Vector_impl" = type { %"struct.std::_Vector_base<HNode, std::allocator<HNode>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HNode, std::allocator<HNode>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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" }
%struct.HNode = type { i32 }

@l = external dso_local global [200020 x %struct.LNode], align 16
@n = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@s = external dso_local global [200020 x i32], align 16
@del = external dso_local global [200020 x i32], align 16
@pq = external dso_local global %"class.std::priority_queue", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %struct.HNode, align 4
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.HNode, align 4
  store i32 0, ptr %1, align 4
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) @k)
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds [200020 x %struct.LNode], ptr @l, i64 0, i64 %13
  %15 = getelementptr inbounds %struct.LNode, ptr %14, i32 0, i32 0
  store i32 1061109567, ptr %15, align 4, !tbaa !9
  store i32 1061109567, ptr @l, align 16, !tbaa !9
  store i32 1, ptr getelementptr inbounds (%struct.LNode, ptr @l, i32 0, i32 2), align 8, !tbaa !11
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = sub nsw i32 %16, 1
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [200020 x %struct.LNode], ptr @l, i64 0, i64 %19
  %21 = getelementptr inbounds %struct.LNode, ptr %20, i32 0, i32 1
  store i32 %17, ptr %21, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %64, %0
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %67

27:                                               ; preds = %22
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [200020 x i32], ptr @s, i64 0, i64 %29
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %30)
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = icmp sge i32 %32, 1
  br i1 %33, label %34, label %63

34:                                               ; preds = %27
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [200020 x i32], ptr @s, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sub nsw i32 %39, 1
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [200020 x i32], ptr @s, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = sub nsw i32 %38, %43
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [200020 x %struct.LNode], ptr @l, i64 0, i64 %46
  %48 = getelementptr inbounds %struct.LNode, ptr %47, i32 0, i32 0
  store i32 %44, ptr %48, align 4, !tbaa !9
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = sub nsw i32 %49, 1
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [200020 x %struct.LNode], ptr @l, i64 0, i64 %52
  %54 = getelementptr inbounds %struct.LNode, ptr %53, i32 0, i32 1
  store i32 %50, ptr %54, align 4, !tbaa !12
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [200020 x %struct.LNode], ptr @l, i64 0, i64 %58
  %60 = getelementptr inbounds %struct.LNode, ptr %59, i32 0, i32 2
  store i32 %56, ptr %60, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = getelementptr inbounds %struct.HNode, ptr %3, i32 0, i32 0
  store i32 %61, ptr %62, align 4, !tbaa !13
  call void @_ZNSt14priority_queueI5HNodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(25) @pq, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %63

63:                                               ; preds = %34, %27
  br label %64

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

67:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 0, ptr %4, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %136, %67
  %69 = load i32, ptr %5, align 4, !tbaa !5
  %70 = load i32, ptr @k, align 4, !tbaa !5
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %73, label %72

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

73:                                               ; preds = %68
  br label %74

74:                                               ; preds = %82, %73
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueI5HNodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @pq)
  %76 = getelementptr inbounds %struct.HNode, ptr %75, i32 0, i32 0
  %77 = load i32, ptr %76, align 4, !tbaa !13
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [200020 x i32], ptr @del, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %83

82:                                               ; preds = %74
  call void @_ZNSt14priority_queueI5HNodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @pq)
  br label %74, !llvm.loop !19

83:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %84 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueI5HNodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @pq)
  %85 = getelementptr inbounds %struct.HNode, ptr %84, i32 0, i32 0
  %86 = load i32, ptr %85, align 4, !tbaa !13
  store i32 %86, ptr %6, align 4, !tbaa !5
  call void @_ZNSt14priority_queueI5HNodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @pq)
  %87 = load i32, ptr %6, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [200020 x %struct.LNode], ptr @l, i64 0, i64 %88
  %90 = getelementptr inbounds %struct.LNode, ptr %89, i32 0, i32 0
  %91 = load i32, ptr %90, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = load i64, ptr %4, align 8, !tbaa !17
  %94 = add nsw i64 %93, %92
  store i64 %94, ptr %4, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [200020 x %struct.LNode], ptr @l, i64 0, i64 %96
  %98 = getelementptr inbounds %struct.LNode, ptr %97, i32 0, i32 1
  %99 = load i32, ptr %98, align 4, !tbaa !12
  store i32 %99, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [200020 x %struct.LNode], ptr @l, i64 0, i64 %101
  %103 = getelementptr inbounds %struct.LNode, ptr %102, i32 0, i32 2
  %104 = load i32, ptr %103, align 4, !tbaa !11
  store i32 %104, ptr %8, align 4, !tbaa !5
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [200020 x %struct.LNode], ptr @l, i64 0, i64 %106
  %108 = getelementptr inbounds %struct.LNode, ptr %107, i32 0, i32 0
  %109 = load i32, ptr %108, align 4, !tbaa !9
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [200020 x %struct.LNode], ptr @l, i64 0, i64 %111
  %113 = getelementptr inbounds %struct.LNode, ptr %112, i32 0, i32 0
  %114 = load i32, ptr %113, align 4, !tbaa !9
  %115 = add nsw i32 %109, %114
  %116 = load i32, ptr %6, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [200020 x %struct.LNode], ptr @l, i64 0, i64 %117
  %119 = getelementptr inbounds %struct.LNode, ptr %118, i32 0, i32 0
  %120 = load i32, ptr %119, align 4, !tbaa !9
  %121 = sub nsw i32 %115, %120
  %122 = load i32, ptr %6, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [200020 x %struct.LNode], ptr @l, i64 0, i64 %123
  %125 = getelementptr inbounds %struct.LNode, ptr %124, i32 0, i32 0
  store i32 %121, ptr %125, align 4, !tbaa !9
  %126 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z10deleteNodei(i32 noundef %126)
  %127 = load i32, ptr %8, align 4, !tbaa !5
  call void @_Z10deleteNodei(i32 noundef %127)
  %128 = load i32, ptr %8, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [200020 x i32], ptr @del, i64 0, i64 %129
  store i32 1, ptr %130, align 4, !tbaa !5
  %131 = load i32, ptr %7, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [200020 x i32], ptr @del, i64 0, i64 %132
  store i32 1, ptr %133, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %134 = load i32, ptr %6, align 4, !tbaa !5
  %135 = getelementptr inbounds %struct.HNode, ptr %9, i32 0, i32 0
  store i32 %134, ptr %135, align 4, !tbaa !13
  call void @_ZNSt14priority_queueI5HNodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(25) @pq, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %136

136:                                              ; preds = %83
  %137 = load i32, ptr %5, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %5, align 4, !tbaa !5
  br label %68, !llvm.loop !20

139:                                              ; preds = %72
  %140 = load i64, ptr %4, align 8, !tbaa !17
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %140)
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %141, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueI5HNodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(4)) #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueI5HNodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueI5HNodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) #4 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

attributes #0 = { 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 #1 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { 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 = { 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 = !{!10, !6, i64 0}
!10 = !{!"_ZTS5LNode", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = !{!10, !6, i64 4}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS5HNode", !6, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !18, i64 0}
!18 = !{!"long long", !7, i64 0}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}


; 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.LNode = type { i32, i32, i32 }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<HNode, std::allocator<HNode>>::_Vector_impl" }
%"struct.std::_Vector_base<HNode, std::allocator<HNode>>::_Vector_impl" = type { %"struct.std::_Vector_base<HNode, std::allocator<HNode>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HNode, std::allocator<HNode>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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" }
%struct.HNode = type { i32 }

@l = external dso_local local_unnamed_addr global [200020 x %struct.LNode], align 16
@n = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@s = external dso_local global [200020 x i32], align 16
@del = external dso_local local_unnamed_addr global [200020 x i32], align 16
@pq = external dso_local global %"class.std::priority_queue", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca %struct.HNode, align 4
  %2 = alloca %struct.HNode, align 4
  %3 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %4 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) @k)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = sext i32 %5 to i64
  %7 = getelementptr inbounds [200020 x %struct.LNode], ptr @l, i64 0, i64 %6
  store i32 1061109567, ptr %7, align 4, !tbaa !9
  store i32 1061109567, ptr @l, align 16, !tbaa !9
  store i32 1, ptr getelementptr inbounds (i8, ptr @l, i64 8), align 8, !tbaa !11
  %8 = add nsw i32 %5, -1
  %9 = getelementptr inbounds [200020 x %struct.LNode], ptr @l, i64 0, i64 %6, i32 1
  store i32 %8, ptr %9, align 4, !tbaa !12
  %10 = icmp sgt i32 %5, 0
  br i1 %10, label %11, label %.preheader31

11:                                               ; preds = %0
  %12 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @s)
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  %13 = icmp sgt i32 %.pre, 1
  br i1 %13, label %.lr.ph.peel.next, label %.preheader31

.preheader31:                                     ; preds = %.lr.ph.peel.next, %11, %0
  %14 = load i32, ptr @k, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.preheader, label %._crit_edge37

.lr.ph.peel.next:                                 ; preds = %11, %.lr.ph.peel.next
  %indvars.iv = phi i64 [ %26, %.lr.ph.peel.next ], [ 1, %11 ]
  %16 = getelementptr inbounds [200020 x i32], ptr @s, i64 0, i64 %indvars.iv
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %18 = load i32, ptr %16, align 4, !tbaa !5
  %19 = add nsw i64 %indvars.iv, -1
  %20 = getelementptr inbounds [200020 x i32], ptr @s, i64 0, i64 %19
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = sub nsw i32 %18, %21
  %23 = getelementptr inbounds [200020 x %struct.LNode], ptr @l, i64 0, i64 %indvars.iv
  store i32 %22, ptr %23, align 4, !tbaa !9
  %24 = getelementptr inbounds i8, ptr %23, i64 4
  %25 = trunc nsw i64 %19 to i32
  store i32 %25, ptr %24, align 4, !tbaa !12
  %26 = add nuw nsw i64 %indvars.iv, 1
  %27 = getelementptr inbounds i8, ptr %23, i64 8
  %28 = trunc nuw nsw i64 %26 to i32
  store i32 %28, ptr %27, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %29 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %29, ptr %1, align 4, !tbaa !13
  call void @_ZNSt14priority_queueI5HNodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(25) @pq, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = icmp slt i64 %26, %31
  br i1 %32, label %.lr.ph.peel.next, label %.preheader31, !llvm.loop !15

.preheader:                                       ; preds = %.preheader31, %._crit_edge
  %.02836 = phi i64 [ %51, %._crit_edge ], [ 0, %.preheader31 ]
  %.02935 = phi i32 [ %66, %._crit_edge ], [ 0, %.preheader31 ]
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueI5HNodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @pq)
  %34 = load i32, ptr %33, align 4, !tbaa !13
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [200020 x i32], ptr @del, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %.not33 = icmp eq i32 %37, 0
  br i1 %.not33, label %._crit_edge, label %.lr.ph34

._crit_edge37:                                    ; preds = %._crit_edge, %.preheader31
  %.028.lcssa = phi i64 [ 0, %.preheader31 ], [ %51, %._crit_edge ]
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.028.lcssa)
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.lr.ph34:                                         ; preds = %.preheader, %.lr.ph34
  call void @_ZNSt14priority_queueI5HNodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @pq)
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueI5HNodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @pq)
  %41 = load i32, ptr %40, align 4, !tbaa !13
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [200020 x i32], ptr @del, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %.not = icmp eq i32 %44, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph34, !llvm.loop !18

._crit_edge:                                      ; preds = %.lr.ph34, %.preheader
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueI5HNodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @pq)
  %46 = load i32, ptr %45, align 4, !tbaa !13
  call void @_ZNSt14priority_queueI5HNodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @pq)
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [200020 x %struct.LNode], ptr @l, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = add nsw i64 %.02836, %50
  %52 = getelementptr inbounds i8, ptr %48, i64 4
  %53 = load i32, ptr %52, align 4, !tbaa !12
  %54 = getelementptr inbounds i8, ptr %48, i64 8
  %55 = load i32, ptr %54, align 4, !tbaa !11
  %56 = sext i32 %53 to i64
  %57 = getelementptr inbounds [200020 x %struct.LNode], ptr @l, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !9
  %59 = sext i32 %55 to i64
  %60 = getelementptr inbounds [200020 x %struct.LNode], ptr @l, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !9
  %62 = sub i32 %58, %49
  %63 = add i32 %62, %61
  store i32 %63, ptr %48, align 4, !tbaa !9
  call void @_Z10deleteNodei(i32 noundef %53)
  call void @_Z10deleteNodei(i32 noundef %55)
  %64 = getelementptr inbounds [200020 x i32], ptr @del, i64 0, i64 %59
  store i32 1, ptr %64, align 4, !tbaa !5
  %65 = getelementptr inbounds [200020 x i32], ptr @del, i64 0, i64 %56
  store i32 1, ptr %65, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 %46, ptr %2, align 4, !tbaa !13
  call void @_ZNSt14priority_queueI5HNodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(25) @pq, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %66 = add nuw nsw i32 %.02935, 1
  %67 = load i32, ptr @k, align 4, !tbaa !5
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %.preheader, label %._crit_edge37, !llvm.loop !19
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueI5HNodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueI5HNodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueI5HNodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #4 align 2

; 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 #4 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

attributes #0 = { 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 #1 = { 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 #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { 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 = { 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 = !{!10, !6, i64 0}
!10 = !{!"_ZTS5LNode", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = !{!10, !6, i64 4}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS5HNode", !6, i64 0}
!15 = distinct !{!15, !16, !17}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!"llvm.loop.peeled.count", i32 1}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}


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