; LLVM IR from NervanaSystems/ngraph :: src/ngraph/op/topk.ll (ZN6ngraph2op2v04TopK5set_kEm)

; 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.ngraph::element::Type" = type { i32 }
%"class.std::shared_ptr.77" = type { %"class.std::__shared_ptr.78" }
%"class.std::__shared_ptr.78" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.ngraph::Output" = type { %"class.std::shared_ptr.74", i64 }
%"class.std::shared_ptr.74" = type { %"class.std::__shared_ptr.75" }
%"class.std::__shared_ptr.75" = type { ptr, %"class.std::__shared_count" }
%"class.ngraph::Shape" = type { %"class.std::vector.81" }
%"class.std::vector.81" = type { %"struct.std::_Vector_base.82" }
%"struct.std::_Vector_base.82" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::initializer_list.80" = type { ptr, i64 }
%"class.ngraph::Input" = type { ptr, i64 }

@_ZN6ngraph7element3i64E = external global %"class.ngraph::element::Type", align 4

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6ngraph2op2v08Constant6createImEESt10shared_ptrIS2_ERKNS_7element4TypeENS_5ShapeESt16initializer_listIT_E(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.77") align 8, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr, i64) #2 align 2

declare void @_ZN6ngraph5ShapeC1ERKSt16initializer_listImE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3

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

declare void @_ZN6ngraph4Node6outputEm(ptr dead_on_unwind writable sret(%"class.ngraph::Output") align 8, ptr noundef nonnull align 8 dereferenceable(680), i64 noundef) #3

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

; Function Attrs: nounwind
declare void @_ZN6ngraph5ShapeD1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5

declare void @_ZNK6ngraph4Node11input_valueEm(ptr dead_on_unwind writable sret(%"class.ngraph::Output") align 8, ptr noundef nonnull align 8 dereferenceable(680), i64 noundef) #3

declare void @_ZNK6ngraph6OutputINS_4NodeEE19get_node_shared_ptrEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.74") align 8, ptr noundef nonnull align 8 dereferenceable(24)) #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6ngraph2op2v04TopK5set_kEm(ptr noundef nonnull align 8 dereferenceable(692) %0, i64 noundef %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::shared_ptr.74", align 8
  %6 = alloca %"class.ngraph::Output", align 8
  %7 = alloca i1, align 1
  %8 = alloca i1, align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.ngraph::Output", align 8
  %12 = alloca %"class.std::shared_ptr.77", align 8
  %13 = alloca %"class.ngraph::Shape", align 8
  %14 = alloca %"class.std::initializer_list.80", align 8
  %15 = alloca [1 x i64], align 8
  %16 = alloca %"class.std::initializer_list.80", align 8
  %17 = alloca [1 x i64], align 8
  %18 = alloca %"class.ngraph::Input", align 8
  %19 = alloca %"class.std::shared_ptr.74", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  %20 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #6
  %21 = call noundef i64 @_ZNK6ngraph4Node14get_input_sizeEv(ptr noundef nonnull align 8 dereferenceable(680) %20)
  %22 = icmp eq i64 %21, 1
  store i1 false, ptr %7, align 1
  store i1 false, ptr %8, align 1
  br i1 %22, label %23, label %24

23:                                               ; preds = %2
  call void @_ZNSt10shared_ptrIN6ngraph4NodeEEC2EDn(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr null) #6
  br label %26

24:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #6
  store i1 true, ptr %7, align 1
  call void @_ZNK6ngraph4Node11input_valueEm(ptr dead_on_unwind writable sret(%"class.ngraph::Output") align 8 %6, ptr noundef nonnull align 8 dereferenceable(680) %20, i64 noundef 1)
  store i1 true, ptr %8, align 1
  invoke void @_ZNK6ngraph6OutputINS_4NodeEE19get_node_shared_ptrEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.74") align 8 %5, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %25 unwind label %55

25:                                               ; preds = %24
  br label %26

26:                                               ; preds = %25, %23
  %27 = load i1, ptr %8, align 1
  br i1 %27, label %28, label %29

28:                                               ; preds = %26
  call void @_ZN6ngraph6OutputINS_4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  br label %29

29:                                               ; preds = %28, %26
  %30 = load i1, ptr %7, align 1
  br i1 %30, label %31, label %32

31:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #6
  br label %32

32:                                               ; preds = %31, %29
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 1, ptr %15, align 8, !tbaa !9
  %33 = getelementptr inbounds %"class.std::initializer_list.80", ptr %14, i32 0, i32 0
  store ptr %15, ptr %33, align 8, !tbaa !11
  %34 = getelementptr inbounds %"class.std::initializer_list.80", ptr %14, i32 0, i32 1
  store i64 1, ptr %34, align 8, !tbaa !13
  invoke void @_ZN6ngraph5ShapeC1ERKSt16initializer_listImE(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %35 unwind label %65

35:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %36 = load i64, ptr %4, align 8, !tbaa !9
  store i64 %36, ptr %17, align 8, !tbaa !9
  %37 = getelementptr inbounds %"class.std::initializer_list.80", ptr %16, i32 0, i32 0
  store ptr %17, ptr %37, align 8, !tbaa !11
  %38 = getelementptr inbounds %"class.std::initializer_list.80", ptr %16, i32 0, i32 1
  store i64 1, ptr %38, align 8, !tbaa !13
  %39 = getelementptr inbounds { ptr, i64 }, ptr %16, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8
  %41 = getelementptr inbounds { ptr, i64 }, ptr %16, i32 0, i32 1
  %42 = load i64, ptr %41, align 8
  invoke void @_ZN6ngraph2op2v08Constant6createImEESt10shared_ptrIS2_ERKNS_7element4TypeENS_5ShapeESt16initializer_listIT_E(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.77") align 8 %12, ptr noundef nonnull align 4 dereferenceable(4) @_ZN6ngraph7element3i64E, ptr noundef %13, ptr %40, i64 %42)
          to label %43 unwind label %69

43:                                               ; preds = %35
  %44 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN6ngraph2op2v08ConstantELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  invoke void @_ZN6ngraph4Node6outputEm(ptr dead_on_unwind writable sret(%"class.ngraph::Output") align 8 %11, ptr noundef nonnull align 8 dereferenceable(680) %44, i64 noundef 0)
          to label %45 unwind label %73

45:                                               ; preds = %43
  call void @_ZNSt12__shared_ptrIN6ngraph2op2v08ConstantELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @_ZN6ngraph5ShapeD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  %46 = invoke { ptr, i64 } @_ZN6ngraph4Node5inputEm(ptr noundef nonnull align 8 dereferenceable(680) %20, i64 noundef 1)
          to label %47 unwind label %79

47:                                               ; preds = %45
  %48 = getelementptr inbounds { ptr, i64 }, ptr %18, i32 0, i32 0
  %49 = extractvalue { ptr, i64 } %46, 0
  store ptr %49, ptr %48, align 8
  %50 = getelementptr inbounds { ptr, i64 }, ptr %18, i32 0, i32 1
  %51 = extractvalue { ptr, i64 } %46, 1
  store i64 %51, ptr %50, align 8
  invoke void @_ZNK6ngraph5InputINS_4NodeEE21replace_source_outputERKNS_6OutputIS1_EE(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %52 unwind label %79

52:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #6
  invoke void @_ZNK6ngraph6OutputINS_4NodeEE19get_node_shared_ptrEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.74") align 8 %19, ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %53 unwind label %83

53:                                               ; preds = %52
  invoke void @_ZN6ngraph4Node31replace_provenance_group_memberERKSt10shared_ptrIS0_ES4_(ptr noundef nonnull align 8 dereferenceable(680) %20, ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %19)
          to label %54 unwind label %87

54:                                               ; preds = %53
  call void @_ZNSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  call void @_ZN6ngraph6OutputINS_4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #6
  call void @_ZNSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #6
  ret void

55:                                               ; preds = %24
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %9, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %10, align 4
  %59 = load i1, ptr %8, align 1
  br i1 %59, label %60, label %61

60:                                               ; preds = %55
  call void @_ZN6ngraph6OutputINS_4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  br label %61

61:                                               ; preds = %60, %55
  %62 = load i1, ptr %7, align 1
  br i1 %62, label %63, label %64

63:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #6
  br label %64

64:                                               ; preds = %63, %61
  br label %94

65:                                               ; preds = %32
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %9, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %10, align 4
  br label %78

69:                                               ; preds = %35
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %9, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %10, align 4
  br label %77

73:                                               ; preds = %43
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %9, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %10, align 4
  call void @_ZNSt12__shared_ptrIN6ngraph2op2v08ConstantELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #6
  br label %77

77:                                               ; preds = %73, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @_ZN6ngraph5ShapeD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  br label %78

78:                                               ; preds = %77, %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  br label %93

79:                                               ; preds = %47, %45
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %9, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  br label %92

83:                                               ; preds = %52
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %9, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %10, align 4
  br label %91

87:                                               ; preds = %53
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %9, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %10, align 4
  call void @_ZNSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #6
  br label %91

91:                                               ; preds = %87, %83
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  br label %92

92:                                               ; preds = %91, %79
  call void @_ZN6ngraph6OutputINS_4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  br label %93

93:                                               ; preds = %92, %78
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #6
  call void @_ZNSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  br label %94

94:                                               ; preds = %93, %64
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #6
  br label %95

95:                                               ; preds = %94
  %96 = load ptr, ptr %9, align 8
  %97 = load i32, ptr %10, align 4
  %98 = insertvalue { ptr, i32 } poison, ptr %96, 0
  %99 = insertvalue { ptr, i32 } %98, i32 %97, 1
  resume { ptr, i32 } %99
}

declare noundef i64 @_ZNK6ngraph4Node14get_input_sizeEv(ptr noundef nonnull align 8 dereferenceable(680)) #3

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

declare { ptr, i64 } @_ZN6ngraph4Node5inputEm(ptr noundef nonnull align 8 dereferenceable(680), i64 noundef) #3

declare void @_ZNK6ngraph5InputINS_4NodeEE21replace_source_outputERKNS_6OutputIS1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(24)) #3

declare void @_ZN6ngraph4Node31replace_provenance_group_memberERKSt10shared_ptrIS0_ES4_(ptr noundef nonnull align 8 dereferenceable(680), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #3

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 = { 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 = { "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 "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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSSt16initializer_listImE", !6, i64 0, !10, i64 8}
!13 = !{!12, !10, i64 8}


; 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.ngraph::element::Type" = type { i32 }
%"class.std::shared_ptr.77" = type { %"class.std::__shared_ptr.78" }
%"class.std::__shared_ptr.78" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.ngraph::Output" = type { %"class.std::shared_ptr.74", i64 }
%"class.std::shared_ptr.74" = type { %"class.std::__shared_ptr.75" }
%"class.std::__shared_ptr.75" = type { ptr, %"class.std::__shared_count" }
%"class.ngraph::Shape" = type { %"class.std::vector.81" }
%"class.std::vector.81" = type { %"struct.std::_Vector_base.82" }
%"struct.std::_Vector_base.82" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::initializer_list.80" = type { ptr, i64 }
%"class.ngraph::Input" = type { ptr, i64 }

@_ZN6ngraph7element3i64E = external global %"class.ngraph::element::Type", align 4

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6ngraph2op2v08Constant6createImEESt10shared_ptrIS2_ERKNS_7element4TypeENS_5ShapeESt16initializer_listIT_E(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.77") align 8, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr, i64) local_unnamed_addr #2 align 2

declare void @_ZN6ngraph5ShapeC1ERKSt16initializer_listImE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3

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

declare void @_ZN6ngraph4Node6outputEm(ptr dead_on_unwind writable sret(%"class.ngraph::Output") align 8, ptr noundef nonnull align 8 dereferenceable(680), i64 noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind
declare void @_ZN6ngraph5ShapeD1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5

declare void @_ZNK6ngraph4Node11input_valueEm(ptr dead_on_unwind writable sret(%"class.ngraph::Output") align 8, ptr noundef nonnull align 8 dereferenceable(680), i64 noundef) local_unnamed_addr #3

declare void @_ZNK6ngraph6OutputINS_4NodeEE19get_node_shared_ptrEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.74") align 8, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6ngraph2op2v04TopK5set_kEm(ptr noundef nonnull align 8 dereferenceable(692) %0, i64 noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::shared_ptr.74", align 8
  %4 = alloca %"class.ngraph::Output", align 8
  %5 = alloca %"class.ngraph::Output", align 8
  %6 = alloca %"class.std::shared_ptr.77", align 8
  %7 = alloca %"class.ngraph::Shape", align 8
  %8 = alloca %"class.std::initializer_list.80", align 8
  %9 = alloca [1 x i64], align 8
  %10 = alloca [1 x i64], align 8
  %11 = alloca %"class.ngraph::Input", align 8
  %12 = alloca %"class.std::shared_ptr.74", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #6
  %13 = tail call noundef i64 @_ZNK6ngraph4Node14get_input_sizeEv(ptr noundef nonnull align 8 dereferenceable(680) %0)
  %.not = icmp eq i64 %13, 1
  br i1 %.not, label %.thread, label %14

.thread:                                          ; preds = %2
  call void @_ZNSt10shared_ptrIN6ngraph4NodeEEC2EDn(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr null) #6
  br label %.critedge

14:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  call void @_ZNK6ngraph4Node11input_valueEm(ptr dead_on_unwind nonnull writable sret(%"class.ngraph::Output") align 8 %4, ptr noundef nonnull align 8 dereferenceable(680) %0, i64 noundef 1)
  invoke void @_ZNK6ngraph6OutputINS_4NodeEE19get_node_shared_ptrEv(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.74") align 8 %3, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %15 unwind label %29

15:                                               ; preds = %14
  call void @_ZN6ngraph6OutputINS_4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  br label %.critedge

.critedge:                                        ; preds = %.thread, %15
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  store i64 1, ptr %9, align 8, !tbaa !5
  store ptr %9, ptr %8, align 8, !tbaa !9
  %16 = getelementptr inbounds i8, ptr %8, i64 8
  store i64 1, ptr %16, align 8, !tbaa !12
  invoke void @_ZN6ngraph5ShapeC1ERKSt16initializer_listImE(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %17 unwind label %31

17:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  store i64 %1, ptr %10, align 8, !tbaa !5
  invoke void @_ZN6ngraph2op2v08Constant6createImEESt10shared_ptrIS2_ERKNS_7element4TypeENS_5ShapeESt16initializer_listIT_E(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.77") align 8 %6, ptr noundef nonnull align 4 dereferenceable(4) @_ZN6ngraph7element3i64E, ptr noundef nonnull %7, ptr nonnull %10, i64 1)
          to label %18 unwind label %33

18:                                               ; preds = %17
  %19 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN6ngraph2op2v08ConstantELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  invoke void @_ZN6ngraph4Node6outputEm(ptr dead_on_unwind nonnull writable sret(%"class.ngraph::Output") align 8 %5, ptr noundef nonnull align 8 dereferenceable(680) %19, i64 noundef 0)
          to label %20 unwind label %35

20:                                               ; preds = %18
  call void @_ZNSt12__shared_ptrIN6ngraph2op2v08ConstantELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @_ZN6ngraph5ShapeD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #6
  %21 = invoke { ptr, i64 } @_ZN6ngraph4Node5inputEm(ptr noundef nonnull align 8 dereferenceable(680) %0, i64 noundef 1)
          to label %22 unwind label %39

22:                                               ; preds = %20
  %23 = extractvalue { ptr, i64 } %21, 0
  store ptr %23, ptr %11, align 8
  %24 = getelementptr inbounds i8, ptr %11, i64 8
  %25 = extractvalue { ptr, i64 } %21, 1
  store i64 %25, ptr %24, align 8
  invoke void @_ZNK6ngraph5InputINS_4NodeEE21replace_source_outputERKNS_6OutputIS1_EE(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %26 unwind label %39

26:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #6
  invoke void @_ZNK6ngraph6OutputINS_4NodeEE19get_node_shared_ptrEv(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.74") align 8 %12, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %27 unwind label %41

27:                                               ; preds = %26
  invoke void @_ZN6ngraph4Node31replace_provenance_group_memberERKSt10shared_ptrIS0_ES4_(ptr noundef nonnull align 8 dereferenceable(680) %0, ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %28 unwind label %43

28:                                               ; preds = %27
  call void @_ZNSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  call void @_ZN6ngraph6OutputINS_4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @_ZNSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  ret void

29:                                               ; preds = %14
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6ngraph6OutputINS_4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  br label %48

31:                                               ; preds = %.critedge
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %38

33:                                               ; preds = %17
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %37

35:                                               ; preds = %18
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN6ngraph2op2v08ConstantELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  br label %37

37:                                               ; preds = %35, %33
  %.pn = phi { ptr, i32 } [ %36, %35 ], [ %34, %33 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @_ZN6ngraph5ShapeD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  br label %38

38:                                               ; preds = %37, %31
  %.pn.pn = phi { ptr, i32 } [ %.pn, %37 ], [ %32, %31 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  br label %47

39:                                               ; preds = %22, %20
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  br label %46

41:                                               ; preds = %26
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %45

43:                                               ; preds = %27
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #6
  br label %45

45:                                               ; preds = %43, %41
  %.pn17 = phi { ptr, i32 } [ %44, %43 ], [ %42, %41 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  br label %46

46:                                               ; preds = %45, %39
  %.pn17.pn = phi { ptr, i32 } [ %.pn17, %45 ], [ %40, %39 ]
  call void @_ZN6ngraph6OutputINS_4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  br label %47

47:                                               ; preds = %46, %38
  %.pn17.pn.pn = phi { ptr, i32 } [ %.pn17.pn, %46 ], [ %.pn.pn, %38 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @_ZNSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #6
  br label %48

48:                                               ; preds = %29, %47
  %.pn17.pn.pn.pn = phi { ptr, i32 } [ %.pn17.pn.pn, %47 ], [ %30, %29 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn17.pn.pn.pn
}

declare noundef i64 @_ZNK6ngraph4Node14get_input_sizeEv(ptr noundef nonnull align 8 dereferenceable(680)) local_unnamed_addr #3

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

declare { ptr, i64 } @_ZN6ngraph4Node5inputEm(ptr noundef nonnull align 8 dereferenceable(680), i64 noundef) local_unnamed_addr #3

declare void @_ZNK6ngraph5InputINS_4NodeEE21replace_source_outputERKNS_6OutputIS1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

declare void @_ZN6ngraph4Node31replace_provenance_group_memberERKSt10shared_ptrIS0_ES4_(ptr noundef nonnull align 8 dereferenceable(680), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3

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 = { 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 = { "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 "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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTSSt16initializer_listImE", !11, i64 0, !6, i64 8}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!10, !6, i64 8}


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