; LLVM IR from napulen/justkeydding :: src/keyprofile.ll (ZN12justkeydding10KeyProfile16getKeyProfileMapEv)

; 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::array" = type { [12 x double] }
%"class.std::map.3" = type { %"class.std::_Rb_tree.4" }
%"class.std::_Rb_tree.4" = type { %"struct.std::_Rb_tree<justkeydding::Key, std::pair<const justkeydding::Key, std::map<justkeydding::PitchClass, double>>, std::_Select1st<std::pair<const justkeydding::Key, std::map<justkeydding::PitchClass, double>>>, std::less<justkeydding::Key>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<justkeydding::Key, std::pair<const justkeydding::Key, std::map<justkeydding::PitchClass, double>>, std::_Select1st<std::pair<const justkeydding::Key, std::map<justkeydding::PitchClass, double>>>, std::less<justkeydding::Key>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<justkeydding::Key, std::allocator<justkeydding::Key>>::_Vector_impl" }
%"struct.std::_Vector_base<justkeydding::Key, std::allocator<justkeydding::Key>>::_Vector_impl" = type { %"struct.std::_Vector_base<justkeydding::Key, std::allocator<justkeydding::Key>>::_Vector_impl_data" }
%"struct.std::_Vector_base<justkeydding::Key, std::allocator<justkeydding::Key>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.12" = type { %"struct.std::_Vector_base.13" }
%"struct.std::_Vector_base.13" = type { %"struct.std::_Vector_base<justkeydding::PitchClass, std::allocator<justkeydding::PitchClass>>::_Vector_impl" }
%"struct.std::_Vector_base<justkeydding::PitchClass, std::allocator<justkeydding::PitchClass>>::_Vector_impl" = type { %"struct.std::_Vector_base<justkeydding::PitchClass, std::allocator<justkeydding::PitchClass>>::_Vector_impl_data" }
%"struct.std::_Vector_base<justkeydding::PitchClass, std::allocator<justkeydding::PitchClass>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.17" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.23" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.24" = type { ptr }

; 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12justkeydding10KeyProfile18getMajorKeyProfileEv(ptr dead_on_unwind noalias writable sret(%"struct.std::array") align 8, ptr noundef nonnull align 8 dereferenceable(160)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12justkeydding10KeyProfile18getMinorKeyProfileEv(ptr dead_on_unwind noalias writable sret(%"struct.std::array") align 8, ptr noundef nonnull align 8 dereferenceable(160)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12justkeydding10KeyProfile16getKeyProfileMapEv(ptr dead_on_unwind noalias writable sret(%"class.std::map.3") align 8 %0, ptr noundef nonnull align 8 dereferenceable(160) %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca %"class.std::vector.12", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::array", align 8
  %10 = alloca i1, align 1
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator.17", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator.17", align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::array", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator.23", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator.24", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator.24", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator.23", align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  %23 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #8
  call void @_ZN12justkeydding3Key16getAllKeysVectorEv(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %5)
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #8
  invoke void @_ZN12justkeydding10PitchClass24getAllPitchClassesVectorEv(ptr dead_on_unwind writable sret(%"class.std::vector.12") align 8 %6)
          to label %24 unwind label %32

24:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 96, ptr %9) #8
  store i1 false, ptr %10, align 1
  call void @_ZNSt3mapIN12justkeydding3KeyES_INS0_10PitchClassEdSt4lessIS2_ESaISt4pairIKS2_dEEES3_IS1_ESaIS5_IKS1_S9_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %25 = call ptr @_ZNSt6vectorIN12justkeydding3KeyESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #8
  %26 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.17", ptr %12, i32 0, i32 0
  store ptr %25, ptr %26, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKN12justkeydding3KeyESt6vectorIS2_SaIS2_EEEC2IPS2_vEERKNS0_IT_S7_EE(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %27

27:                                               ; preds = %100, %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %28 = call ptr @_ZNSt6vectorIN12justkeydding3KeyESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #8
  %29 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.17", ptr %13, i32 0, i32 0
  store ptr %28, ptr %29, align 8
  %30 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN12justkeydding3KeyEPS2_St6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T1_EERKNS9_IT0_SB_EE(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br i1 %30, label %36, label %31

31:                                               ; preds = %27
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %105

32:                                               ; preds = %2
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %7, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %8, align 4
  br label %109

36:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %37 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN12justkeydding3KeyESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  %38 = invoke noundef i32 @_ZNK12justkeydding3Key6getIntEv(ptr noundef nonnull align 8 dereferenceable(856) %37)
          to label %39 unwind label %66

39:                                               ; preds = %36
  %40 = srem i32 %38, 12
  store i32 %40, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %41 = load i32, ptr %15, align 4, !tbaa !9
  %42 = sub nsw i32 12, %41
  store i32 %42, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 96, ptr %17) #8
  %43 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN12justkeydding3KeyESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  %44 = invoke noundef zeroext i1 @_ZNK12justkeydding3Key10isMajorKeyEv(ptr noundef nonnull align 8 dereferenceable(856) %43)
          to label %45 unwind label %70

45:                                               ; preds = %39
  br i1 %44, label %46, label %48

46:                                               ; preds = %45
  invoke void @_ZN12justkeydding10KeyProfile18getMajorKeyProfileEv(ptr dead_on_unwind writable sret(%"struct.std::array") align 8 %17, ptr noundef nonnull align 8 dereferenceable(160) %23)
          to label %47 unwind label %70

47:                                               ; preds = %46
  br label %50

48:                                               ; preds = %45
  invoke void @_ZN12justkeydding10KeyProfile18getMinorKeyProfileEv(ptr dead_on_unwind writable sret(%"struct.std::array") align 8 %17, ptr noundef nonnull align 8 dereferenceable(160) %23)
          to label %49 unwind label %70

49:                                               ; preds = %48
  br label %50

50:                                               ; preds = %49, %47
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %17, i64 96, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 96, ptr %17) #8
  %51 = call noundef ptr @_ZNSt5arrayIdLm12EE5beginEv(ptr noundef nonnull align 8 dereferenceable(96) %9) #9
  %52 = call noundef ptr @_ZNSt5arrayIdLm12EE5beginEv(ptr noundef nonnull align 8 dereferenceable(96) %9) #9
  %53 = load i32, ptr %16, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds double, ptr %52, i64 %54
  %56 = call noundef ptr @_ZNSt5arrayIdLm12EE3endEv(ptr noundef nonnull align 8 dereferenceable(96) %9) #9
  %57 = invoke noundef ptr @_ZNSt3_V26rotateIPdEET_S2_S2_S2_(ptr noundef %51, ptr noundef %55, ptr noundef %56)
          to label %58 unwind label %74

58:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %59 = call ptr @_ZNSt6vectorIN12justkeydding10PitchClassESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  %60 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.24", ptr %19, i32 0, i32 0
  store ptr %59, ptr %60, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKN12justkeydding10PitchClassESt6vectorIS2_SaIS2_EEEC2IPS2_vEERKNS0_IT_S7_EE(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %61

61:                                               ; preds = %92, %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %62 = call ptr @_ZNSt6vectorIN12justkeydding10PitchClassESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  %63 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.24", ptr %20, i32 0, i32 0
  store ptr %62, ptr %63, align 8
  %64 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN12justkeydding10PitchClassEPS2_St6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T1_EERKNS9_IT0_SB_EE(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br i1 %64, label %78, label %65

65:                                               ; preds = %61
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %99

66:                                               ; preds = %36
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %7, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %8, align 4
  br label %104

70:                                               ; preds = %48, %46, %39
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %7, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 96, ptr %17) #8
  br label %103

74:                                               ; preds = %50
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %7, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %8, align 4
  br label %103

78:                                               ; preds = %61
  %79 = call noundef ptr @_ZNSt5arrayIdLm12EE5beginEv(ptr noundef nonnull align 8 dereferenceable(96) %9) #9
  %80 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN12justkeydding10PitchClassESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  %81 = invoke noundef i32 @_ZNK12justkeydding10PitchClass6getIntEv(ptr noundef nonnull align 8 dereferenceable(472) %80)
          to label %82 unwind label %95

82:                                               ; preds = %78
  %83 = sext i32 %81 to i64
  %84 = getelementptr inbounds double, ptr %79, i64 %83
  %85 = load double, ptr %84, align 8, !tbaa !13
  %86 = call noundef nonnull align 8 dereferenceable(856) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN12justkeydding3KeyESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  %87 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIN12justkeydding3KeyES_INS0_10PitchClassEdSt4lessIS2_ESaISt4pairIKS2_dEEES3_IS1_ESaIS5_IKS1_S9_EEEixERSB_(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(856) %86)
          to label %88 unwind label %95

88:                                               ; preds = %82
  %89 = call noundef nonnull align 8 dereferenceable(472) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN12justkeydding10PitchClassESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  %90 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIN12justkeydding10PitchClassEdSt4lessIS1_ESaISt4pairIKS1_dEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(48) %87, ptr noundef nonnull align 8 dereferenceable(472) %89)
          to label %91 unwind label %95

91:                                               ; preds = %88
  store double %85, ptr %90, align 8, !tbaa !13
  br label %92

92:                                               ; preds = %91
  %93 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN12justkeydding10PitchClassESt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %18, i32 noundef 0) #8
  %94 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.23", ptr %21, i32 0, i32 0
  store ptr %93, ptr %94, align 8
  br label %61, !llvm.loop !15

95:                                               ; preds = %88, %82, %78
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %7, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %103

99:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %100

100:                                              ; preds = %99
  %101 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN12justkeydding3KeyESt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %11, i32 noundef 0) #8
  %102 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  store ptr %101, ptr %102, align 8
  br label %27, !llvm.loop !17

103:                                              ; preds = %95, %74, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %104

104:                                              ; preds = %103, %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @_ZNSt3mapIN12justkeydding3KeyES_INS0_10PitchClassEdSt4lessIS2_ESaISt4pairIKS2_dEEES3_IS1_ESaIS5_IKS1_S9_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #8
  call void @llvm.lifetime.end.p0(i64 96, ptr %9) #8
  call void @_ZNSt6vectorIN12justkeydding10PitchClassESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  br label %109

105:                                              ; preds = %31
  store i1 true, ptr %10, align 1
  store i32 1, ptr %14, align 4
  %106 = load i1, ptr %10, align 1
  br i1 %106, label %108, label %107

107:                                              ; preds = %105
  call void @_ZNSt3mapIN12justkeydding3KeyES_INS0_10PitchClassEdSt4lessIS2_ESaISt4pairIKS2_dEEES3_IS1_ESaIS5_IKS1_S9_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #8
  br label %108

108:                                              ; preds = %107, %105
  call void @llvm.lifetime.end.p0(i64 96, ptr %9) #8
  call void @_ZNSt6vectorIN12justkeydding10PitchClassESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #8
  call void @_ZNSt6vectorIN12justkeydding3KeyESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #8
  ret void

109:                                              ; preds = %104, %32
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #8
  call void @_ZNSt6vectorIN12justkeydding3KeyESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #8
  br label %110

110:                                              ; preds = %109
  %111 = load ptr, ptr %7, align 8
  %112 = load i32, ptr %8, align 4
  %113 = insertvalue { ptr, i32 } poison, ptr %111, 0
  %114 = insertvalue { ptr, i32 } %113, i32 %112, 1
  resume { ptr, i32 } %114
}

declare void @_ZN12justkeydding3Key16getAllKeysVectorEv(ptr dead_on_unwind writable sret(%"class.std::vector") align 8) #3

declare void @_ZN12justkeydding10PitchClass24getAllPitchClassesVectorEv(ptr dead_on_unwind writable sret(%"class.std::vector.12") align 8) #3

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKN12justkeydding3KeyEPS2_St6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T1_EERKNS9_IT0_SB_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

declare noundef i32 @_ZNK12justkeydding3Key6getIntEv(ptr noundef nonnull align 8 dereferenceable(856)) #3

declare noundef zeroext i1 @_ZNK12justkeydding3Key10isMajorKeyEv(ptr noundef nonnull align 8 dereferenceable(856)) #3

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

; Function Attrs: mustprogress nounwind willreturn memory(none) uwtable
declare dso_local noundef ptr @_ZNSt5arrayIdLm12EE5beginEv(ptr noundef nonnull align 8 dereferenceable(96)) #7 align 2

; Function Attrs: mustprogress nounwind willreturn memory(none) uwtable
declare dso_local noundef ptr @_ZNSt5arrayIdLm12EE3endEv(ptr noundef nonnull align 8 dereferenceable(96)) #7 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKN12justkeydding10PitchClassEPS2_St6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T1_EERKNS9_IT0_SB_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

declare noundef i32 @_ZNK12justkeydding10PitchClass6getIntEv(ptr noundef nonnull align 8 dereferenceable(472)) #3

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

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

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

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

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #6 = { 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 #7 = { mustprogress nounwind willreturn memory(none) 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 #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(none) }

!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 = !{i64 0, i64 96, !12}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.std::array" = type { [12 x double] }
%"class.std::map.3" = type { %"class.std::_Rb_tree.4" }
%"class.std::_Rb_tree.4" = type { %"struct.std::_Rb_tree<justkeydding::Key, std::pair<const justkeydding::Key, std::map<justkeydding::PitchClass, double>>, std::_Select1st<std::pair<const justkeydding::Key, std::map<justkeydding::PitchClass, double>>>, std::less<justkeydding::Key>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<justkeydding::Key, std::pair<const justkeydding::Key, std::map<justkeydding::PitchClass, double>>, std::_Select1st<std::pair<const justkeydding::Key, std::map<justkeydding::PitchClass, double>>>, std::less<justkeydding::Key>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<justkeydding::Key, std::allocator<justkeydding::Key>>::_Vector_impl" }
%"struct.std::_Vector_base<justkeydding::Key, std::allocator<justkeydding::Key>>::_Vector_impl" = type { %"struct.std::_Vector_base<justkeydding::Key, std::allocator<justkeydding::Key>>::_Vector_impl_data" }
%"struct.std::_Vector_base<justkeydding::Key, std::allocator<justkeydding::Key>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.12" = type { %"struct.std::_Vector_base.13" }
%"struct.std::_Vector_base.13" = type { %"struct.std::_Vector_base<justkeydding::PitchClass, std::allocator<justkeydding::PitchClass>>::_Vector_impl" }
%"struct.std::_Vector_base<justkeydding::PitchClass, std::allocator<justkeydding::PitchClass>>::_Vector_impl" = type { %"struct.std::_Vector_base<justkeydding::PitchClass, std::allocator<justkeydding::PitchClass>>::_Vector_impl_data" }
%"struct.std::_Vector_base<justkeydding::PitchClass, std::allocator<justkeydding::PitchClass>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.17" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.23" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.24" = type { ptr }

; 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 nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12justkeydding10KeyProfile18getMajorKeyProfileEv(ptr dead_on_unwind noalias writable sret(%"struct.std::array") align 8, ptr noundef nonnull align 8 dereferenceable(160)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12justkeydding10KeyProfile18getMinorKeyProfileEv(ptr dead_on_unwind noalias writable sret(%"struct.std::array") align 8, ptr noundef nonnull align 8 dereferenceable(160)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12justkeydding10KeyProfile16getKeyProfileMapEv(ptr dead_on_unwind noalias writable sret(%"class.std::map.3") align 8 %0, ptr noundef nonnull align 8 dereferenceable(160) %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::vector.12", align 8
  %5 = alloca %"struct.std::array", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator.17", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.17", align 8
  %9 = alloca %"struct.std::array", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.23", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator.24", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator.24", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #8
  call void @_ZN12justkeydding3Key16getAllKeysVectorEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #8
  invoke void @_ZN12justkeydding10PitchClass24getAllPitchClassesVectorEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.12") align 8 %4)
          to label %13 unwind label %17

13:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %5) #8
  call void @_ZNSt3mapIN12justkeydding3KeyES_INS0_10PitchClassEdSt4lessIS2_ESaISt4pairIKS2_dEEES3_IS1_ESaIS5_IKS1_S9_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  %14 = call ptr @_ZNSt6vectorIN12justkeydding3KeyESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  store ptr %14, ptr %7, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKN12justkeydding3KeyESt6vectorIS2_SaIS2_EEEC2IPS2_vEERKNS0_IT_S7_EE(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  %15 = call ptr @_ZNSt6vectorIN12justkeydding3KeyESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  store ptr %15, ptr %8, align 8
  %16 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN12justkeydding3KeyEPS2_St6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T1_EERKNS9_IT0_SB_EE(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  br i1 %16, label %.lr.ph13, label %._crit_edge14

._crit_edge14:                                    ; preds = %._crit_edge, %13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %5) #8
  call void @_ZNSt6vectorIN12justkeydding10PitchClassESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #8
  call void @_ZNSt6vectorIN12justkeydding3KeyESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #8
  ret void

17:                                               ; preds = %2
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %66

.lr.ph13:                                         ; preds = %13, %._crit_edge
  %19 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN12justkeydding3KeyESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  %20 = invoke noundef i32 @_ZNK12justkeydding3Key6getIntEv(ptr noundef nonnull align 8 dereferenceable(856) %19)
          to label %21 unwind label %42

21:                                               ; preds = %.lr.ph13
  %22 = srem i32 %20, 12
  %23 = sub nsw i32 12, %22
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %9) #8
  %24 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN12justkeydding3KeyESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  %25 = invoke noundef zeroext i1 @_ZNK12justkeydding3Key10isMajorKeyEv(ptr noundef nonnull align 8 dereferenceable(856) %24)
          to label %26 unwind label %44

26:                                               ; preds = %21
  br i1 %25, label %27, label %28

27:                                               ; preds = %26
  invoke void @_ZN12justkeydding10KeyProfile18getMajorKeyProfileEv(ptr dead_on_unwind nonnull writable sret(%"struct.std::array") align 8 %9, ptr noundef nonnull align 8 dereferenceable(160) %1)
          to label %29 unwind label %44

28:                                               ; preds = %26
  invoke void @_ZN12justkeydding10KeyProfile18getMinorKeyProfileEv(ptr dead_on_unwind nonnull writable sret(%"struct.std::array") align 8 %9, ptr noundef nonnull align 8 dereferenceable(160) %1)
          to label %29 unwind label %44

29:                                               ; preds = %28, %27
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(96) %5, ptr noundef nonnull align 8 dereferenceable(96) %9, i64 96, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %9) #8
  %30 = call noundef ptr @_ZNSt5arrayIdLm12EE5beginEv(ptr noundef nonnull align 8 dereferenceable(96) %5) #9
  %31 = zext nneg i32 %23 to i64
  %32 = getelementptr inbounds double, ptr %30, i64 %31
  %33 = call noundef ptr @_ZNSt5arrayIdLm12EE3endEv(ptr noundef nonnull align 8 dereferenceable(96) %5) #9
  %34 = invoke noundef ptr @_ZNSt3_V26rotateIPdEET_S2_S2_S2_(ptr noundef %30, ptr noundef %32, ptr noundef %33)
          to label %35 unwind label %46

35:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #8
  %36 = call ptr @_ZNSt6vectorIN12justkeydding10PitchClassESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  store ptr %36, ptr %11, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKN12justkeydding10PitchClassESt6vectorIS2_SaIS2_EEEC2IPS2_vEERKNS0_IT_S7_EE(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #8
  %37 = call ptr @_ZNSt6vectorIN12justkeydding10PitchClassESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  store ptr %37, ptr %12, align 8
  %38 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN12justkeydding10PitchClassEPS2_St6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T1_EERKNS9_IT0_SB_EE(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  br i1 %38, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %59, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  %39 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN12justkeydding3KeyESt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %6, i32 noundef 0) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  %40 = call ptr @_ZNSt6vectorIN12justkeydding3KeyESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  store ptr %40, ptr %8, align 8
  %41 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN12justkeydding3KeyEPS2_St6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T1_EERKNS9_IT0_SB_EE(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  br i1 %41, label %.lr.ph13, label %._crit_edge14, !llvm.loop !9

42:                                               ; preds = %.lr.ph13
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %65

44:                                               ; preds = %28, %27, %21
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %9) #8
  br label %65

46:                                               ; preds = %29
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %65

.lr.ph:                                           ; preds = %35, %59
  %48 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN12justkeydding10PitchClassESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  %49 = invoke noundef i32 @_ZNK12justkeydding10PitchClass6getIntEv(ptr noundef nonnull align 8 dereferenceable(472) %48)
          to label %50 unwind label %63

50:                                               ; preds = %.lr.ph
  %51 = sext i32 %49 to i64
  %52 = getelementptr inbounds double, ptr %30, i64 %51
  %53 = load double, ptr %52, align 8, !tbaa !11
  %54 = call noundef nonnull align 8 dereferenceable(856) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN12justkeydding3KeyESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  %55 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIN12justkeydding3KeyES_INS0_10PitchClassEdSt4lessIS2_ESaISt4pairIKS2_dEEES3_IS1_ESaIS5_IKS1_S9_EEEixERSB_(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(856) %54)
          to label %56 unwind label %63

56:                                               ; preds = %50
  %57 = call noundef nonnull align 8 dereferenceable(472) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN12justkeydding10PitchClassESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  %58 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIN12justkeydding10PitchClassEdSt4lessIS1_ESaISt4pairIKS1_dEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(48) %55, ptr noundef nonnull align 8 dereferenceable(472) %57)
          to label %59 unwind label %63

59:                                               ; preds = %56
  store double %53, ptr %58, align 8, !tbaa !11
  %60 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN12justkeydding10PitchClassESt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %10, i32 noundef 0) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #8
  %61 = call ptr @_ZNSt6vectorIN12justkeydding10PitchClassESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  store ptr %61, ptr %12, align 8
  %62 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN12justkeydding10PitchClassEPS2_St6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T1_EERKNS9_IT0_SB_EE(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  br i1 %62, label %.lr.ph, label %._crit_edge, !llvm.loop !13

63:                                               ; preds = %56, %50, %.lr.ph
  %64 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  br label %65

65:                                               ; preds = %44, %46, %63, %42
  %.pn.pn = phi { ptr, i32 } [ %43, %42 ], [ %64, %63 ], [ %47, %46 ], [ %45, %44 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @_ZNSt3mapIN12justkeydding3KeyES_INS0_10PitchClassEdSt4lessIS2_ESaISt4pairIKS2_dEEES3_IS1_ESaIS5_IKS1_S9_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #8
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %5) #8
  call void @_ZNSt6vectorIN12justkeydding10PitchClassESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  br label %66

66:                                               ; preds = %65, %17
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %65 ], [ %18, %17 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #8
  call void @_ZNSt6vectorIN12justkeydding3KeyESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #8
  resume { ptr, i32 } %.pn.pn.pn
}

declare void @_ZN12justkeydding3Key16getAllKeysVectorEv(ptr dead_on_unwind writable sret(%"class.std::vector") align 8) local_unnamed_addr #3

declare void @_ZN12justkeydding10PitchClass24getAllPitchClassesVectorEv(ptr dead_on_unwind writable sret(%"class.std::vector.12") align 8) local_unnamed_addr #3

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKN12justkeydding3KeyEPS2_St6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T1_EERKNS9_IT0_SB_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

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

declare noundef i32 @_ZNK12justkeydding3Key6getIntEv(ptr noundef nonnull align 8 dereferenceable(856)) local_unnamed_addr #3

declare noundef zeroext i1 @_ZNK12justkeydding3Key10isMajorKeyEv(ptr noundef nonnull align 8 dereferenceable(856)) local_unnamed_addr #3

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

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
declare dso_local noundef ptr @_ZNSt5arrayIdLm12EE5beginEv(ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #7 align 2

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
declare dso_local noundef ptr @_ZNSt5arrayIdLm12EE3endEv(ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #7 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKN12justkeydding10PitchClassEPS2_St6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T1_EERKNS9_IT0_SB_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

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

declare noundef i32 @_ZNK12justkeydding10PitchClass6getIntEv(ptr noundef nonnull align 8 dereferenceable(472)) local_unnamed_addr #3

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

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

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

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

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

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #6 = { 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 #7 = { mustprogress nofree nosync nounwind willreturn memory(none) 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 #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(none) }

!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 = !{i64 0, i64 96, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !10}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass