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

; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::__cxx11::basic_stringstream" = type { %"class.std::basic_iostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_iostream.base" = type { %"class.std::basic_istream.base", %"class.std::basic_ostream.base" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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 }
%"struct.ngraph::CheckLocInfo" = type { ptr, i32, ptr }
%"class.std::shared_ptr.74" = type { %"class.std::__shared_ptr.75" }
%"class.std::__shared_ptr.75" = type { ptr, %"class.std::__shared_count" }

@_ZN6ngraph7element3i64E = external global %"class.ngraph::element::Type", align 4
@.str.1 = external hidden unnamed_addr constant [78 x i8], align 1
@_ZTIN6ngraph21NodeValidationFailureE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZN6ngraph7element3i32E = external global %"class.ngraph::element::Type", align 4
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZN6ngraph7element2i8E = external global %"class.ngraph::element::Type", align 4
@.str.35 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [98 x i8], align 1

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrIN6ngraph2op2v08ConstantELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #2 align 2

declare ptr @__cxa_allocate_exception(i64)

; Function Attrs: mustprogress uwtable
declare void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(128)) #2 align 2

declare void @__cxa_throw(ptr, ptr, ptr)

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

declare void @__cxa_free_exception(ptr)

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

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

declare noundef zeroext i1 @_ZNK6ngraph7element4TypeeqERKS1_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZNK6ngraph2op2v14TopK25read_k_from_constant_nodeERKSt10shared_ptrINS_4NodeEERKNS_7element4TypeE(ptr noundef nonnull align 8 dereferenceable(708) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) %2) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.std::__cxx11::basic_stringstream", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.ngraph::CheckLocInfo", align 8
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca i1, align 1
  %13 = alloca %"class.std::shared_ptr.77", align 8
  %14 = alloca %"class.std::shared_ptr.74", align 8
  %15 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %16 = load ptr, ptr %4, align 8
  br label %17

17:                                               ; preds = %3
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = call noundef zeroext i1 @_ZNK6ngraph7element4TypeeqERKS1_(ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) @_ZN6ngraph7element2i8E)
  br i1 %19, label %54, label %20

20:                                               ; preds = %17
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = call noundef zeroext i1 @_ZNK6ngraph7element4TypeeqERKS1_(ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) @_ZN6ngraph7element3i32E)
  br i1 %22, label %54, label %23

23:                                               ; preds = %20
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = call noundef zeroext i1 @_ZNK6ngraph7element4TypeeqERKS1_(ptr noundef nonnull align 4 dereferenceable(4) %24, ptr noundef nonnull align 4 dereferenceable(4) @_ZN6ngraph7element3i64E)
  br i1 %25, label %54, label %26

26:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 392, ptr %7) #6
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %7)
  %27 = getelementptr inbounds i8, ptr %7, i64 16
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6ngraphL19write_all_to_streamIA50_cJRKNS_7element4TypeERA3_KcEEERSoS9_RKT_DpOT0_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 1 dereferenceable(50) @.str.35, ptr noundef nonnull align 4 dereferenceable(4) %28, ptr noundef nonnull align 1 dereferenceable(3) @.str.7)
          to label %30 unwind label %37

30:                                               ; preds = %26
  store i1 true, ptr %12, align 1
  %31 = call ptr @__cxa_allocate_exception(i64 16) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #6
  %32 = getelementptr inbounds %"struct.ngraph::CheckLocInfo", ptr %10, i32 0, i32 0
  store ptr @.str.1, ptr %32, align 8, !tbaa !9
  %33 = getelementptr inbounds %"struct.ngraph::CheckLocInfo", ptr %10, i32 0, i32 1
  store i32 600, ptr %33, align 8, !tbaa !12
  %34 = getelementptr inbounds %"struct.ngraph::CheckLocInfo", ptr %10, i32 0, i32 2
  store ptr @.str.36, ptr %34, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #6
  invoke void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %11, ptr noundef nonnull align 8 dereferenceable(128) %7)
          to label %35 unwind label %41

35:                                               ; preds = %30
  invoke void @_ZN6ngraph21NodeValidationFailureC2ERKNS_12CheckLocInfoEPKNS_4NodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef %16, ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %36 unwind label %45

36:                                               ; preds = %35
  store i1 false, ptr %12, align 1
  invoke void @__cxa_throw(ptr %31, ptr @_ZTIN6ngraph21NodeValidationFailureE, ptr @_ZNSt13runtime_errorD2Ev) #7
          to label %87 unwind label %45

37:                                               ; preds = %26
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %8, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %9, align 4
  br label %53

41:                                               ; preds = %30
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %8, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %9, align 4
  br label %49

45:                                               ; preds = %36, %35
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %8, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %9, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  br label %49

49:                                               ; preds = %45, %41
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  %50 = load i1, ptr %12, align 1
  br i1 %50, label %51, label %52

51:                                               ; preds = %49
  call void @__cxa_free_exception(ptr %31) #6
  br label %52

52:                                               ; preds = %51, %49
  br label %53

53:                                               ; preds = %52, %37
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %7) #6
  call void @llvm.lifetime.end.p0(i64 392, ptr %7) #6
  br label %82

54:                                               ; preds = %23, %20, %17
  br label %55

55:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #6
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNSt10shared_ptrIN6ngraph4NodeEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %56) #6
  invoke void @_ZN6ngraph11as_type_ptrINS_2op2v08ConstantESt10shared_ptrINS_4NodeEEEENSt9enable_ifIXsr3std14is_convertibleIDTclsr3stdE19static_pointer_castIT_Eclsr3stdE7declvalIT0_EEEES4_IS8_EEE5valueESB_E4typeES9_(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.77") align 8 %13, ptr noundef %14)
          to label %57 unwind label %61

57:                                               ; preds = %55
  call void @_ZNSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 0, ptr %15, align 8, !tbaa !14
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = invoke noundef i32 @_ZNK6ngraph7element4TypecvNS0_6Type_tEEv(ptr noundef nonnull align 4 dereferenceable(4) %58)
          to label %60 unwind label %65

60:                                               ; preds = %57
  switch i32 %59, label %78 [
    i32 7, label %69
    i32 9, label %72
    i32 10, label %75
  ]

61:                                               ; preds = %55
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %8, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %9, align 4
  call void @_ZNSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #6
  br label %81

65:                                               ; preds = %75, %72, %69, %57
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %8, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @_ZNSt12__shared_ptrIN6ngraph2op2v08ConstantELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #6
  br label %81

69:                                               ; preds = %60
  %70 = invoke noundef i64 @_ZNK6ngraph2op2v14TopK18validate_and_get_kIaEEmRKSt10shared_ptrINS0_2v08ConstantEE(ptr noundef nonnull align 8 dereferenceable(708) %16, ptr noundef nonnull align 8 dereferenceable(16) %13)
          to label %71 unwind label %65

71:                                               ; preds = %69
  store i64 %70, ptr %15, align 8, !tbaa !14
  br label %79

72:                                               ; preds = %60
  %73 = invoke noundef i64 @_ZNK6ngraph2op2v14TopK18validate_and_get_kIiEEmRKSt10shared_ptrINS0_2v08ConstantEE(ptr noundef nonnull align 8 dereferenceable(708) %16, ptr noundef nonnull align 8 dereferenceable(16) %13)
          to label %74 unwind label %65

74:                                               ; preds = %72
  store i64 %73, ptr %15, align 8, !tbaa !14
  br label %79

75:                                               ; preds = %60
  %76 = invoke noundef i64 @_ZNK6ngraph2op2v14TopK18validate_and_get_kIlEEmRKSt10shared_ptrINS0_2v08ConstantEE(ptr noundef nonnull align 8 dereferenceable(708) %16, ptr noundef nonnull align 8 dereferenceable(16) %13)
          to label %77 unwind label %65

77:                                               ; preds = %75
  store i64 %76, ptr %15, align 8, !tbaa !14
  br label %79

78:                                               ; preds = %60
  br label %79

79:                                               ; preds = %78, %77, %74, %71
  %80 = load i64, ptr %15, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @_ZNSt12__shared_ptrIN6ngraph2op2v08ConstantELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  ret i64 %80

81:                                               ; preds = %65, %61
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  br label %82

82:                                               ; preds = %81, %53
  %83 = load ptr, ptr %8, align 8
  %84 = load i32, ptr %9, align 4
  %85 = insertvalue { ptr, i32 } poison, ptr %83, 0
  %86 = insertvalue { ptr, i32 } %85, i32 %84, 1
  resume { ptr, i32 } %86

87:                                               ; preds = %36
  unreachable
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef nonnull align 8 dereferenceable(8) ptr @_ZN6ngraphL19write_all_to_streamIA50_cJRKNS_7element4TypeERA3_KcEEERSoS9_RKT_DpOT0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(50), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(3)) #5

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK6ngraph2op2v14TopK18validate_and_get_kIaEEmRKSt10shared_ptrINS0_2v08ConstantEE(ptr noundef nonnull align 8 dereferenceable(708), ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK6ngraph2op2v14TopK18validate_and_get_kIiEEmRKSt10shared_ptrINS0_2v08ConstantEE(ptr noundef nonnull align 8 dereferenceable(708), ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK6ngraph2op2v14TopK18validate_and_get_kIlEEmRKSt10shared_ptrINS0_2v08ConstantEE(ptr noundef nonnull align 8 dereferenceable(708), ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 #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 }
attributes #7 = { noreturn }

!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, !6, i64 0}
!10 = !{!"_ZTSN6ngraph12CheckLocInfoE", !6, i64 0, !11, i64 8, !6, i64 16}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 8}
!13 = !{!10, !6, i64 16}
!14 = !{!15, !15, i64 0}
!15 = !{!"long", !7, 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"

%"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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::__cxx11::basic_stringstream" = type { %"class.std::basic_iostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_iostream.base" = type { %"class.std::basic_istream.base", %"class.std::basic_ostream.base" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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 }
%"struct.ngraph::CheckLocInfo" = type { ptr, i32, ptr }
%"class.std::shared_ptr.74" = type { %"class.std::__shared_ptr.75" }
%"class.std::__shared_ptr.75" = type { ptr, %"class.std::__shared_count" }

@_ZN6ngraph7element3i64E = external global %"class.ngraph::element::Type", align 4
@.str.1 = external hidden unnamed_addr constant [78 x i8], align 1
@_ZTIN6ngraph21NodeValidationFailureE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZN6ngraph7element3i32E = external global %"class.ngraph::element::Type", align 4
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZN6ngraph7element2i8E = external global %"class.ngraph::element::Type", align 4
@.str.35 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [98 x i8], align 1

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrIN6ngraph2op2v08ConstantELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #2 align 2

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

; Function Attrs: mustprogress uwtable
declare void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #2 align 2

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

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

declare void @__cxa_free_exception(ptr) local_unnamed_addr

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

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

declare noundef zeroext i1 @_ZNK6ngraph7element4TypeeqERKS1_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZNK6ngraph2op2v14TopK25read_k_from_constant_nodeERKSt10shared_ptrINS_4NodeEERKNS_7element4TypeE(ptr noundef nonnull align 8 dereferenceable(708) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) %2) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::__cxx11::basic_stringstream", align 8
  %5 = alloca %"struct.ngraph::CheckLocInfo", align 8
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::shared_ptr.77", align 8
  %8 = alloca %"class.std::shared_ptr.74", align 8
  %9 = tail call noundef zeroext i1 @_ZNK6ngraph7element4TypeeqERKS1_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) @_ZN6ngraph7element2i8E)
  br i1 %9, label %31, label %10

10:                                               ; preds = %3
  %11 = tail call noundef zeroext i1 @_ZNK6ngraph7element4TypeeqERKS1_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) @_ZN6ngraph7element3i32E)
  br i1 %11, label %31, label %12

12:                                               ; preds = %10
  %13 = tail call noundef zeroext i1 @_ZNK6ngraph7element4TypeeqERKS1_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) @_ZN6ngraph7element3i64E)
  br i1 %13, label %31, label %14

14:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 392, ptr nonnull %4) #6
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %4)
  %15 = getelementptr inbounds i8, ptr %4, i64 16
  %16 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6ngraphL19write_all_to_streamIA50_cJRKNS_7element4TypeERA3_KcEEERSoS9_RKT_DpOT0_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 1 dereferenceable(50) @.str.35, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 1 dereferenceable(3) @.str.7)
          to label %17 unwind label %24

17:                                               ; preds = %14
  %18 = call ptr @__cxa_allocate_exception(i64 16) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  store ptr @.str.1, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %5, i64 8
  store i32 600, ptr %19, align 8, !tbaa !11
  %20 = getelementptr inbounds i8, ptr %5, i64 16
  store ptr @.str.36, ptr %20, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #6
  invoke void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %6, ptr noundef nonnull align 8 dereferenceable(128) %4)
          to label %21 unwind label %.thread

21:                                               ; preds = %17
  invoke void @_ZN6ngraph21NodeValidationFailureC2ERKNS_12CheckLocInfoEPKNS_4NodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull %0, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %23 unwind label %.thread25

.thread25:                                        ; preds = %21
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  br label %29

23:                                               ; preds = %21
  invoke void @__cxa_throw(ptr nonnull %18, ptr nonnull @_ZTIN6ngraph21NodeValidationFailureE, ptr nonnull @_ZNSt13runtime_errorD2Ev) #7
          to label %47 unwind label %27

24:                                               ; preds = %14
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %30

.thread:                                          ; preds = %17
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  br label %29

27:                                               ; preds = %23
  %28 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  br label %30

29:                                               ; preds = %.thread25, %.thread
  %.pn24 = phi { ptr, i32 } [ %26, %.thread ], [ %22, %.thread25 ]
  call void @__cxa_free_exception(ptr %18) #6
  br label %30

30:                                               ; preds = %27, %29, %24
  %.pn.pn = phi { ptr, i32 } [ %.pn24, %29 ], [ %28, %27 ], [ %25, %24 ]
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %4) #6
  call void @llvm.lifetime.end.p0(i64 392, ptr nonnull %4) #6
  br label %46

31:                                               ; preds = %3, %10, %12
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  call void @_ZNSt10shared_ptrIN6ngraph4NodeEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %1) #6
  invoke void @_ZN6ngraph11as_type_ptrINS_2op2v08ConstantESt10shared_ptrINS_4NodeEEEENSt9enable_ifIXsr3std14is_convertibleIDTclsr3stdE19static_pointer_castIT_Eclsr3stdE7declvalIT0_EEEES4_IS8_EEE5valueESB_E4typeES9_(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.77") align 8 %7, ptr noundef nonnull %8)
          to label %32 unwind label %34

32:                                               ; preds = %31
  call void @_ZNSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  %33 = call noundef i32 @_ZNK6ngraph7element4TypecvNS0_6Type_tEEv(ptr noundef nonnull align 4 dereferenceable(4) %2)
  switch i32 %33, label %44 [
    i32 7, label %38
    i32 9, label %40
    i32 10, label %42
  ]

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

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

38:                                               ; preds = %32
  %39 = invoke noundef i64 @_ZNK6ngraph2op2v14TopK18validate_and_get_kIaEEmRKSt10shared_ptrINS0_2v08ConstantEE(ptr noundef nonnull align 8 dereferenceable(708) %0, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %44 unwind label %36

40:                                               ; preds = %32
  %41 = invoke noundef i64 @_ZNK6ngraph2op2v14TopK18validate_and_get_kIiEEmRKSt10shared_ptrINS0_2v08ConstantEE(ptr noundef nonnull align 8 dereferenceable(708) %0, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %44 unwind label %36

42:                                               ; preds = %32
  %43 = invoke noundef i64 @_ZNK6ngraph2op2v14TopK18validate_and_get_kIlEEmRKSt10shared_ptrINS0_2v08ConstantEE(ptr noundef nonnull align 8 dereferenceable(708) %0, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %44 unwind label %36

44:                                               ; preds = %42, %40, %38, %32
  %.0 = phi i64 [ 0, %32 ], [ %39, %38 ], [ %41, %40 ], [ %43, %42 ]
  call void @_ZNSt12__shared_ptrIN6ngraph2op2v08ConstantELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  ret i64 %.0

45:                                               ; preds = %36, %34
  %.pn19 = phi { ptr, i32 } [ %37, %36 ], [ %35, %34 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  br label %46

46:                                               ; preds = %45, %30
  %.pn19.pn = phi { ptr, i32 } [ %.pn19, %45 ], [ %.pn.pn, %30 ]
  resume { ptr, i32 } %.pn19.pn

47:                                               ; preds = %23
  unreachable
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef nonnull align 8 dereferenceable(8) ptr @_ZN6ngraphL19write_all_to_streamIA50_cJRKNS_7element4TypeERA3_KcEEERSoS9_RKT_DpOT0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(50), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(3)) local_unnamed_addr #5

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK6ngraph2op2v14TopK18validate_and_get_kIaEEmRKSt10shared_ptrINS0_2v08ConstantEE(ptr noundef nonnull align 8 dereferenceable(708), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK6ngraph2op2v14TopK18validate_and_get_kIiEEmRKSt10shared_ptrINS0_2v08ConstantEE(ptr noundef nonnull align 8 dereferenceable(708), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK6ngraph2op2v14TopK18validate_and_get_kIlEEmRKSt10shared_ptrINS0_2v08ConstantEE(ptr noundef nonnull align 8 dereferenceable(708), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 #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 }
attributes #7 = { noreturn }

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


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