; LLVM IR from sunkafei/xcpc-algorithm-templates :: 算法/数据结构/可持久化Treap.ll (ZN12shared_treap5splitEPNS_4nodeEi)

; 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.std::pair.4" = type { %"struct.shared_treap::pointer", %"struct.shared_treap::pointer" }
%"struct.shared_treap::pointer" = type { ptr }
%"struct.shared_treap::node" = type <{ %"struct.shared_treap::pointer", %"struct.shared_treap::pointer", i32, i32, i32, [4 x i8] }>

@_ZN12shared_treapL3nilE = external hidden constant ptr, align 8

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN12shared_treap7pointerC2EPNS_4nodeE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN12shared_treap7pointerD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN12shared_treap4copyEPNS_4nodeE(ptr noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK12shared_treap7pointercvPNS_4nodeEEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN12shared_treap4node2upEv(ptr noundef nonnull align 8 dereferenceable(28)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12shared_treap5splitEPNS_4nodeEi(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.4") align 8 %0, ptr noundef %1, i32 noundef %2) #3 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.shared_treap::pointer", align 8
  %8 = alloca %"struct.std::pair.4", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"struct.shared_treap::pointer", align 8
  %14 = alloca %"struct.std::pair.4", align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %17 = load i32, ptr %6, align 4, !tbaa !9
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %19, label %20

19:                                               ; preds = %3
  call void @_ZNSt4pairIN12shared_treap7pointerES1_EC2IRKPNS0_4nodeERS5_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairISA_SB_EEEbE4typeELb1EEEOSA_OSB_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(8) @_ZN12shared_treapL3nilE, ptr noundef nonnull align 8 dereferenceable(8) %5)
  br label %105

20:                                               ; preds = %3
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = getelementptr inbounds %"struct.shared_treap::node", ptr %21, i32 0, i32 3
  %23 = load i32, ptr %22, align 4, !tbaa !11
  %24 = load i32, ptr %6, align 4, !tbaa !9
  %25 = icmp sle i32 %23, %24
  br i1 %25, label %26, label %27

26:                                               ; preds = %20
  call void @_ZNSt4pairIN12shared_treap7pointerES1_EC2IRPNS0_4nodeERKS5_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairISA_SB_EEEbE4typeELb1EEEOSA_OSB_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) @_ZN12shared_treapL3nilE)
  br label %105

27:                                               ; preds = %20
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %"struct.shared_treap::node", ptr %28, i32 0, i32 0
  %30 = call noundef ptr @_ZN12shared_treap7pointerptEv(ptr noundef nonnull align 8 dereferenceable(8) %29)
  %31 = getelementptr inbounds %"struct.shared_treap::node", ptr %30, i32 0, i32 3
  %32 = load i32, ptr %31, align 4, !tbaa !11
  %33 = load i32, ptr %6, align 4, !tbaa !9
  %34 = icmp sge i32 %32, %33
  br i1 %34, label %35, label %66

35:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = call noundef ptr @_ZN12shared_treap4copyEPNS_4nodeE(ptr noundef %36)
  call void @_ZN12shared_treap7pointerC2EPNS_4nodeE(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef %37)
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #5
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %"struct.shared_treap::node", ptr %38, i32 0, i32 0
  %40 = invoke noundef ptr @_ZNK12shared_treap7pointercvPNS_4nodeEEv(ptr noundef nonnull align 8 dereferenceable(8) %39)
          to label %41 unwind label %57

41:                                               ; preds = %35
  %42 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @_ZN12shared_treap5splitEPNS_4nodeEi(ptr dead_on_unwind writable sret(%"struct.std::pair.4") align 8 %8, ptr noundef %40, i32 noundef %42)
          to label %43 unwind label %57

43:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EN12shared_treap7pointerES1_EONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS6_(ptr noundef nonnull align 8 dereferenceable(16) %8) #5
  store ptr %44, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EN12shared_treap7pointerES1_EONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS6_(ptr noundef nonnull align 8 dereferenceable(16) %8) #5
  store ptr %45, ptr %12, align 8, !tbaa !5
  %46 = load ptr, ptr %12, align 8, !tbaa !5
  %47 = invoke noundef ptr @_ZN12shared_treap7pointerptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %48 unwind label %61

48:                                               ; preds = %43
  %49 = getelementptr inbounds %"struct.shared_treap::node", ptr %47, i32 0, i32 0
  %50 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN12shared_treap7pointeraSERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef nonnull align 8 dereferenceable(8) %46)
          to label %51 unwind label %61

51:                                               ; preds = %48
  %52 = invoke noundef ptr @_ZN12shared_treap7pointerptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %53 unwind label %61

53:                                               ; preds = %51
  invoke void @_ZN12shared_treap4node2upEv(ptr noundef nonnull align 8 dereferenceable(28) %52)
          to label %54 unwind label %61

54:                                               ; preds = %53
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @_ZNSt4pairIN12shared_treap7pointerES1_EC2IRS1_S4_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS6_S7_EEEbE4typeELb1EEEOS6_OS7_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %56 unwind label %61

56:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @_ZNSt4pairIN12shared_treap7pointerES1_ED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #5
  call void @_ZN12shared_treap7pointerD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %105

57:                                               ; preds = %41, %35
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %9, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %10, align 4
  br label %65

61:                                               ; preds = %54, %53, %51, %48, %43
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %9, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @_ZNSt4pairIN12shared_treap7pointerES1_ED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #5
  br label %65

65:                                               ; preds = %61, %57
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #5
  call void @_ZN12shared_treap7pointerD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %106

66:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = call noundef ptr @_ZN12shared_treap4copyEPNS_4nodeE(ptr noundef %67)
  call void @_ZN12shared_treap7pointerC2EPNS_4nodeE(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef %68)
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #5
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.shared_treap::node", ptr %69, i32 0, i32 1
  %71 = invoke noundef ptr @_ZNK12shared_treap7pointercvPNS_4nodeEEv(ptr noundef nonnull align 8 dereferenceable(8) %70)
          to label %72 unwind label %96

72:                                               ; preds = %66
  %73 = load i32, ptr %6, align 4, !tbaa !9
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds %"struct.shared_treap::node", ptr %74, i32 0, i32 0
  %76 = invoke noundef ptr @_ZN12shared_treap7pointerptEv(ptr noundef nonnull align 8 dereferenceable(8) %75)
          to label %77 unwind label %96

77:                                               ; preds = %72
  %78 = getelementptr inbounds %"struct.shared_treap::node", ptr %76, i32 0, i32 3
  %79 = load i32, ptr %78, align 4, !tbaa !11
  %80 = sub nsw i32 %73, %79
  %81 = sub nsw i32 %80, 1
  invoke void @_ZN12shared_treap5splitEPNS_4nodeEi(ptr dead_on_unwind writable sret(%"struct.std::pair.4") align 8 %14, ptr noundef %71, i32 noundef %81)
          to label %82 unwind label %96

82:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EN12shared_treap7pointerES1_EONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS6_(ptr noundef nonnull align 8 dereferenceable(16) %14) #5
  store ptr %83, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EN12shared_treap7pointerES1_EONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS6_(ptr noundef nonnull align 8 dereferenceable(16) %14) #5
  store ptr %84, ptr %16, align 8, !tbaa !5
  %85 = load ptr, ptr %15, align 8, !tbaa !5
  %86 = invoke noundef ptr @_ZN12shared_treap7pointerptEv(ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %87 unwind label %100

87:                                               ; preds = %82
  %88 = getelementptr inbounds %"struct.shared_treap::node", ptr %86, i32 0, i32 1
  %89 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN12shared_treap7pointeraSERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %88, ptr noundef nonnull align 8 dereferenceable(8) %85)
          to label %90 unwind label %100

90:                                               ; preds = %87
  %91 = invoke noundef ptr @_ZN12shared_treap7pointerptEv(ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %92 unwind label %100

92:                                               ; preds = %90
  invoke void @_ZN12shared_treap4node2upEv(ptr noundef nonnull align 8 dereferenceable(28) %91)
          to label %93 unwind label %100

93:                                               ; preds = %92
  %94 = load ptr, ptr %16, align 8, !tbaa !5
  invoke void @_ZNSt4pairIN12shared_treap7pointerES1_EC2IRS1_S4_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS6_S7_EEEbE4typeELb1EEEOS6_OS7_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %94)
          to label %95 unwind label %100

95:                                               ; preds = %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @_ZNSt4pairIN12shared_treap7pointerES1_ED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #5
  call void @_ZN12shared_treap7pointerD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %105

96:                                               ; preds = %77, %72, %66
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %9, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %10, align 4
  br label %104

100:                                              ; preds = %93, %92, %90, %87, %82
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %9, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @_ZNSt4pairIN12shared_treap7pointerES1_ED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #5
  br label %104

104:                                              ; preds = %100, %96
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #5
  call void @_ZN12shared_treap7pointerD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %106

105:                                              ; preds = %95, %56, %26, %19
  ret void

106:                                              ; preds = %104, %65
  %107 = load ptr, ptr %9, align 8
  %108 = load i32, ptr %10, align 4
  %109 = insertvalue { ptr, i32 } poison, ptr %107, 0
  %110 = insertvalue { ptr, i32 } %109, i32 %108, 1
  resume { ptr, i32 } %110
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN12shared_treap7pointerptEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EN12shared_treap7pointerES1_EONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS6_(ptr noundef nonnull align 8 dereferenceable(16)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EN12shared_treap7pointerES1_EONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS6_(ptr noundef nonnull align 8 dereferenceable(16)) #4

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIN12shared_treap7pointerES1_ED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 20}
!12 = !{!"_ZTSN12shared_treap4nodeE", !13, i64 0, !13, i64 8, !10, i64 16, !10, i64 20, !10, i64 24}
!13 = !{!"_ZTSN12shared_treap7pointerE", !6, i64 0}


; 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.std::pair.4" = type { %"struct.shared_treap::pointer", %"struct.shared_treap::pointer" }
%"struct.shared_treap::pointer" = type { ptr }

@_ZN12shared_treapL3nilE = external hidden constant ptr, align 8

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN12shared_treap7pointerC2EPNS_4nodeE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN12shared_treap7pointerD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN12shared_treap4copyEPNS_4nodeE(ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK12shared_treap7pointercvPNS_4nodeEEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN12shared_treap4node2upEv(ptr noundef nonnull align 8 dereferenceable(28)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12shared_treap5splitEPNS_4nodeEi(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.4") align 8 %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca %"struct.shared_treap::pointer", align 8
  %6 = alloca %"struct.std::pair.4", align 8
  %7 = alloca %"struct.shared_treap::pointer", align 8
  %8 = alloca %"struct.std::pair.4", align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  %9 = icmp eq i32 %2, 0
  br i1 %9, label %10, label %11

10:                                               ; preds = %3
  call void @_ZNSt4pairIN12shared_treap7pointerES1_EC2IRKPNS0_4nodeERS5_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairISA_SB_EEEbE4typeELb1EEEOSA_OSB_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(8) @_ZN12shared_treapL3nilE, ptr noundef nonnull align 8 dereferenceable(8) %4)
  br label %63

11:                                               ; preds = %3
  %12 = getelementptr inbounds i8, ptr %1, i64 20
  %13 = load i32, ptr %12, align 4, !tbaa !9
  %.not = icmp sgt i32 %13, %2
  br i1 %.not, label %15, label %14

14:                                               ; preds = %11
  call void @_ZNSt4pairIN12shared_treap7pointerES1_EC2IRPNS0_4nodeERKS5_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairISA_SB_EEEbE4typeELb1EEEOSA_OSB_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) @_ZN12shared_treapL3nilE)
  br label %63

15:                                               ; preds = %11
  %16 = tail call noundef ptr @_ZN12shared_treap7pointerptEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %17 = getelementptr inbounds i8, ptr %16, i64 20
  %18 = load i32, ptr %17, align 4, !tbaa !9
  %.not14 = icmp slt i32 %18, %2
  br i1 %.not14, label %37, label %19

19:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %20 = tail call noundef ptr @_ZN12shared_treap4copyEPNS_4nodeE(ptr noundef nonnull %1)
  call void @_ZN12shared_treap7pointerC2EPNS_4nodeE(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef %20)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = call noundef ptr @_ZNK12shared_treap7pointercvPNS_4nodeEEv(ptr noundef nonnull align 8 dereferenceable(8) %21)
  invoke void @_ZN12shared_treap5splitEPNS_4nodeEi(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.4") align 8 %6, ptr noundef %22, i32 noundef %2)
          to label %23 unwind label %32

23:                                               ; preds = %19
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EN12shared_treap7pointerES1_EONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS6_(ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EN12shared_treap7pointerES1_EONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS6_(ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  %26 = call noundef ptr @_ZN12shared_treap7pointerptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %27 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN12shared_treap7pointeraSERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %25)
          to label %28 unwind label %34

28:                                               ; preds = %23
  %29 = call noundef ptr @_ZN12shared_treap7pointerptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  invoke void @_ZN12shared_treap4node2upEv(ptr noundef nonnull align 8 dereferenceable(28) %29)
          to label %30 unwind label %34

30:                                               ; preds = %28
  invoke void @_ZNSt4pairIN12shared_treap7pointerES1_EC2IRS1_S4_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS6_S7_EEEbE4typeELb1EEEOS6_OS7_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %31 unwind label %34

31:                                               ; preds = %30
  call void @_ZNSt4pairIN12shared_treap7pointerES1_ED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  call void @_ZN12shared_treap7pointerD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %63

32:                                               ; preds = %19
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %36

34:                                               ; preds = %30, %28, %23
  %35 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt4pairIN12shared_treap7pointerES1_ED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  br label %36

36:                                               ; preds = %34, %32
  %.pn16 = phi { ptr, i32 } [ %35, %34 ], [ %33, %32 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  call void @_ZN12shared_treap7pointerD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %64

37:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %38 = tail call noundef ptr @_ZN12shared_treap4copyEPNS_4nodeE(ptr noundef nonnull %1)
  call void @_ZN12shared_treap7pointerC2EPNS_4nodeE(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef %38)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #5
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %39, i64 8
  %41 = call noundef ptr @_ZNK12shared_treap7pointercvPNS_4nodeEEv(ptr noundef nonnull align 8 dereferenceable(8) %40)
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = call noundef ptr @_ZN12shared_treap7pointerptEv(ptr noundef nonnull align 8 dereferenceable(8) %42)
  %44 = getelementptr inbounds i8, ptr %43, i64 20
  %45 = load i32, ptr %44, align 4, !tbaa !9
  %46 = xor i32 %45, -1
  %47 = add i32 %46, %2
  invoke void @_ZN12shared_treap5splitEPNS_4nodeEi(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.4") align 8 %8, ptr noundef %41, i32 noundef %47)
          to label %48 unwind label %58

48:                                               ; preds = %37
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EN12shared_treap7pointerES1_EONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS6_(ptr noundef nonnull align 8 dereferenceable(16) %8) #5
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EN12shared_treap7pointerES1_EONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS6_(ptr noundef nonnull align 8 dereferenceable(16) %8) #5
  %51 = call noundef ptr @_ZN12shared_treap7pointerptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %52 = getelementptr inbounds i8, ptr %51, i64 8
  %53 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN12shared_treap7pointeraSERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef nonnull align 8 dereferenceable(8) %49)
          to label %54 unwind label %60

54:                                               ; preds = %48
  %55 = call noundef ptr @_ZN12shared_treap7pointerptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  invoke void @_ZN12shared_treap4node2upEv(ptr noundef nonnull align 8 dereferenceable(28) %55)
          to label %56 unwind label %60

56:                                               ; preds = %54
  invoke void @_ZNSt4pairIN12shared_treap7pointerES1_EC2IRS1_S4_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS6_S7_EEEbE4typeELb1EEEOS6_OS7_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %50)
          to label %57 unwind label %60

57:                                               ; preds = %56
  call void @_ZNSt4pairIN12shared_treap7pointerES1_ED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  call void @_ZN12shared_treap7pointerD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br label %63

58:                                               ; preds = %37
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %62

60:                                               ; preds = %56, %54, %48
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt4pairIN12shared_treap7pointerES1_ED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #5
  br label %62

62:                                               ; preds = %60, %58
  %.pn = phi { ptr, i32 } [ %61, %60 ], [ %59, %58 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  call void @_ZN12shared_treap7pointerD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br label %64

63:                                               ; preds = %57, %31, %14, %10
  ret void

64:                                               ; preds = %62, %36
  %.pn16.pn = phi { ptr, i32 } [ %.pn16, %36 ], [ %.pn, %62 ]
  resume { ptr, i32 } %.pn16.pn
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN12shared_treap7pointerptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EN12shared_treap7pointerES1_EONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS6_(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EN12shared_treap7pointerES1_EONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS6_(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIN12shared_treap7pointerES1_ED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 20}
!10 = !{!"_ZTSN12shared_treap4nodeE", !11, i64 0, !11, i64 8, !12, i64 16, !12, i64 20, !12, i64 24}
!11 = !{!"_ZTSN12shared_treap7pointerE", !6, i64 0}
!12 = !{!"int", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass