; LLVM IR from EbTech/Elo-MMR :: deprecated/cpp/trueskill/src (trueskill)

; 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.Variable = type { ptr, %"class.std::map" }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<Factor, std::pair<const Factor, Gaussian *>, std::_Select1st<std::pair<const Factor, Gaussian *>>, FactorKeyMapper>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<Factor, std::pair<const Factor, Gaussian *>, std::_Select1st<std::pair<const Factor, Gaussian *>>, FactorKeyMapper>::_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 }

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8Variable14update_messageEP6FactorP8Gaussian(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef %1, ptr noundef %2) #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, 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
  %10 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %11 = getelementptr inbounds %class.Variable, ptr %10, i32 0, i32 1
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapI6FactorP8Gaussian15FactorKeyMapperSaISt4pairIKS0_S2_EEEixERS5_(ptr noundef nonnull align 8 dereferenceable(48) %11, ptr noundef nonnull align 8 dereferenceable(12) %12)
  %14 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %14, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %15 = getelementptr inbounds %class.Variable, ptr %10, i32 0, i32 0
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = load ptr, ptr %7, align 8, !tbaa !5
  %18 = call noundef ptr @_ZN8GaussiandvEPS_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef %17)
  store ptr %18, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %19 = load ptr, ptr %8, align 8, !tbaa !5
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = call noundef ptr @_ZN8GaussianmlEPS_(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef %20)
  store ptr %21, ptr %9, align 8, !tbaa !5
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  %23 = icmp eq ptr %22, null
  br i1 %23, label %25, label %24

24:                                               ; preds = %3
  call void @_ZdlPvm(ptr noundef %22, i64 noundef 16) #4
  br label %25

25:                                               ; preds = %24, %3
  %26 = getelementptr inbounds %class.Variable, ptr %10, i32 0, i32 0
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = icmp eq ptr %27, null
  br i1 %28, label %30, label %29

29:                                               ; preds = %25
  call void @_ZdlPvm(ptr noundef %27, i64 noundef 16) #4
  br label %30

30:                                               ; preds = %29, %25
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = getelementptr inbounds %class.Variable, ptr %10, i32 0, i32 0
  store ptr %31, ptr %32, align 8, !tbaa !9
  %33 = getelementptr inbounds %class.Variable, ptr %10, i32 0, i32 1
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapI6FactorP8Gaussian15FactorKeyMapperSaISt4pairIKS0_S2_EEEixERS5_(ptr noundef nonnull align 8 dereferenceable(48) %33, ptr noundef nonnull align 8 dereferenceable(12) %34)
  %36 = load ptr, ptr %35, align 8, !tbaa !5
  %37 = icmp eq ptr %36, null
  br i1 %37, label %39, label %38

38:                                               ; preds = %30
  call void @_ZdlPvm(ptr noundef %36, i64 noundef 16) #4
  br label %39

39:                                               ; preds = %38, %30
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %class.Variable, ptr %10, i32 0, i32 1
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapI6FactorP8Gaussian15FactorKeyMapperSaISt4pairIKS0_S2_EEEixERS5_(ptr noundef nonnull align 8 dereferenceable(48) %41, ptr noundef nonnull align 8 dereferenceable(12) %42)
  store ptr %40, ptr %43, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret void
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin 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 #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 = { nounwind }
attributes #4 = { builtin 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, !6, i64 0}
!10 = !{!"_ZTS8Variable", !6, i64 0, !11, i64 8}
!11 = !{!"_ZTSSt3mapI6FactorP8Gaussian15FactorKeyMapperSaISt4pairIKS0_S2_EEE", !12, i64 0}
!12 = !{!"_ZTSSt8_Rb_treeI6FactorSt4pairIKS0_P8GaussianESt10_Select1stIS5_E15FactorKeyMapperSaIS5_EE", !13, i64 0}
!13 = !{!"_ZTSNSt8_Rb_treeI6FactorSt4pairIKS0_P8GaussianESt10_Select1stIS5_E15FactorKeyMapperSaIS5_EE13_Rb_tree_implIS8_Lb1EEE", !14, i64 0, !16, i64 8}
!14 = !{!"_ZTSSt20_Rb_tree_key_compareI15FactorKeyMapperE", !15, i64 0}
!15 = !{!"_ZTS15FactorKeyMapper"}
!16 = !{!"_ZTSSt15_Rb_tree_header", !17, i64 0, !19, i64 32}
!17 = !{!"_ZTSSt18_Rb_tree_node_base", !18, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!18 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!19 = !{!"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"

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8Variable14update_messageEP6FactorP8Gaussian(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull %1, ptr noundef %2) local_unnamed_addr #1 align 2 {
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapI6FactorP8Gaussian15FactorKeyMapperSaISt4pairIKS0_S2_EEEixERS5_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(12) %1)
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = load ptr, ptr %0, align 8, !tbaa !9
  %8 = tail call noundef ptr @_ZN8GaussiandvEPS_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef %6)
  %9 = tail call noundef ptr @_ZN8GaussianmlEPS_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef %2)
  tail call void @_ZdlPvm(ptr noundef %8, i64 noundef 16) #2
  %10 = load ptr, ptr %0, align 8, !tbaa !9
  %11 = icmp eq ptr %10, null
  br i1 %11, label %13, label %12

12:                                               ; preds = %3
  tail call void @_ZdlPvm(ptr noundef nonnull %10, i64 noundef 16) #2
  br label %13

13:                                               ; preds = %12, %3
  store ptr %9, ptr %0, align 8, !tbaa !9
  %14 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapI6FactorP8Gaussian15FactorKeyMapperSaISt4pairIKS0_S2_EEEixERS5_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(12) %1)
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  %16 = icmp eq ptr %15, null
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  tail call void @_ZdlPvm(ptr noundef nonnull %15, i64 noundef 16) #2
  br label %18

18:                                               ; preds = %17, %13
  %19 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapI6FactorP8Gaussian15FactorKeyMapperSaISt4pairIKS0_S2_EEEixERS5_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(12) %1)
  store ptr %2, ptr %19, align 8, !tbaa !5
  ret void
}

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

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

attributes #0 = { nobuiltin 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 #1 = { 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 #2 = { builtin 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, !6, i64 0}
!10 = !{!"_ZTS8Variable", !6, i64 0, !11, i64 8}
!11 = !{!"_ZTSSt3mapI6FactorP8Gaussian15FactorKeyMapperSaISt4pairIKS0_S2_EEE", !12, i64 0}
!12 = !{!"_ZTSSt8_Rb_treeI6FactorSt4pairIKS0_P8GaussianESt10_Select1stIS5_E15FactorKeyMapperSaIS5_EE", !13, i64 0}
!13 = !{!"_ZTSNSt8_Rb_treeI6FactorSt4pairIKS0_P8GaussianESt10_Select1stIS5_E15FactorKeyMapperSaIS5_EE13_Rb_tree_implIS8_Lb1EEE", !14, i64 0, !16, i64 8}
!14 = !{!"_ZTSSt20_Rb_tree_key_compareI15FactorKeyMapperE", !15, i64 0}
!15 = !{!"_ZTS15FactorKeyMapper"}
!16 = !{!"_ZTSSt15_Rb_tree_header", !17, i64 0, !19, i64 32}
!17 = !{!"_ZTSSt18_Rb_tree_node_base", !18, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!18 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!19 = !{!"long", !7, i64 0}


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