; LLVM IR from mackorone/mms :: old/v2/src/sim/MouseInterface.ll (ZN3sim14MouseInterface12setTileColorEiic)

; 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.std::map.57" = type { %"class.std::_Rb_tree.58" }
%"class.std::_Rb_tree.58" = type { %"struct.std::_Rb_tree<char, std::pair<const char, sim::Color>, std::_Select1st<std::pair<const char, sim::Color>>, std::less<char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<char, std::pair<const char, sim::Color>, std::_Select1st<std::pair<const char, sim::Color>>, std::less<char>>::_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.sim::MouseInterface" = type { ptr, ptr, ptr, ptr, %"class.std::set.221", %"struct.sim::StaticMouseAlgorithmOptions", i8, %"class.std::set.226", %"class.std::set.226" }
%"class.std::set.221" = type { %"class.std::_Rb_tree.222" }
%"class.std::_Rb_tree.222" = type { %"struct.std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.sim::StaticMouseAlgorithmOptions" = type { %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i32, i32, double }
%"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::set.226" = type { %"class.std::_Rb_tree.227" }
%"class.std::_Rb_tree.227" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }

@_ZN3simL13CHAR_TO_COLORE = external hidden global %"class.std::map.57", align 8
@.str.72 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [87 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3sim14MouseInterface12setTileColorEiic(ptr noundef nonnull align 8 dereferenceable(296) %0, i32 noundef %1, i32 noundef %2, i8 noundef signext %3) #0 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i8 %3, ptr %8, align 1, !tbaa !11
  %9 = load ptr, ptr %5, align 8
  %10 = getelementptr inbounds %"class.sim::MouseInterface", ptr %9, i32 0, i32 0
  %11 = load ptr, ptr %10, align 8, !tbaa !12
  %12 = load i32, ptr %6, align 4, !tbaa !9
  %13 = load i32, ptr %7, align 4, !tbaa !9
  %14 = call noundef zeroext i1 @_ZNK3sim4Maze10withinMazeEii(ptr noundef nonnull align 8 dereferenceable(26) %11, i32 noundef %12, i32 noundef %13)
  br i1 %14, label %17, label %15

15:                                               ; preds = %4
  %16 = call noundef ptr @_ZN3sim1LEv()
  call void @_ZN2el6Logger4warnIiJiEEEvPKcRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728) %16, ptr noundef @.str.72, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  br label %26

17:                                               ; preds = %4
  %18 = load i8, ptr %8, align 1, !tbaa !11
  %19 = call noundef zeroext i1 @_ZN3sim18ContainerUtilities11mapContainsIcNS_5ColorEEEbRKSt3mapIT_T0_St4lessIS4_ESaISt4pairIKS4_S5_EEES4_(ptr noundef nonnull align 8 dereferenceable(48) @_ZN3simL13CHAR_TO_COLORE, i8 noundef signext %18)
  br i1 %19, label %22, label %20

20:                                               ; preds = %17
  %21 = call noundef ptr @_ZN3sim1LEv()
  call void @_ZN2el6Logger4warnIiJiccEEEvPKcRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728) %21, ptr noundef @.str.73, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 1 dereferenceable(1) %8, ptr noundef nonnull align 1 dereferenceable(1) %8)
  br label %26

22:                                               ; preds = %17
  %23 = load i32, ptr %6, align 4, !tbaa !9
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = load i8, ptr %8, align 1, !tbaa !11
  call void @_ZN3sim14MouseInterface16setTileColorImplEiic(ptr noundef nonnull align 8 dereferenceable(296) %9, i32 noundef %23, i32 noundef %24, i8 noundef signext %25)
  br label %26

26:                                               ; preds = %22, %20, %15
  ret void
}

declare noundef zeroext i1 @_ZNK3sim4Maze10withinMazeEii(ptr noundef nonnull align 8 dereferenceable(26), i32 noundef, i32 noundef) #1

declare noundef ptr @_ZN3sim1LEv() #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3sim18ContainerUtilities11mapContainsIcNS_5ColorEEEbRKSt3mapIT_T0_St4lessIS4_ESaISt4pairIKS4_S5_EEES4_(ptr noundef nonnull align 8 dereferenceable(48), i8 noundef signext) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2el6Logger4warnIiJiccEEEvPKcRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728), ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3sim14MouseInterface16setTileColorImplEiic(ptr noundef nonnull align 8 dereferenceable(296), i32 noundef, i32 noundef, i8 noundef signext) #0 align 2

attributes #0 = { 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 #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!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 = !{!7, !7, i64 0}
!12 = !{!13, !6, i64 0}
!13 = !{!"_ZTSN3sim14MouseInterfaceE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !14, i64 32, !23, i64 80, !27, i64 192, !28, i64 200, !28, i64 248}
!14 = !{!"_ZTSSt3setIcSt4lessIcESaIcEE", !15, i64 0}
!15 = !{!"_ZTSSt8_Rb_treeIccSt9_IdentityIcESt4lessIcESaIcEE", !16, i64 0}
!16 = !{!"_ZTSNSt8_Rb_treeIccSt9_IdentityIcESt4lessIcESaIcEE13_Rb_tree_implIS3_Lb1EEE", !17, i64 0, !19, i64 8}
!17 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIcEE", !18, i64 0}
!18 = !{!"_ZTSSt4lessIcE"}
!19 = !{!"_ZTSSt15_Rb_tree_header", !20, i64 0, !22, i64 32}
!20 = !{!"_ZTSSt18_Rb_tree_node_base", !21, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!21 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!22 = !{!"long", !7, i64 0}
!23 = !{!"_ZTSN3sim27StaticMouseAlgorithmOptionsE", !24, i64 0, !24, i64 32, !24, i64 64, !10, i64 96, !10, i64 100, !26, i64 104}
!24 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !25, i64 0, !22, i64 8, !7, i64 16}
!25 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!26 = !{!"double", !7, i64 0}
!27 = !{!"bool", !7, i64 0}
!28 = !{!"_ZTSSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSSt8_Rb_treeISt4pairIiiES1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE", !30, i64 0}
!30 = !{!"_ZTSNSt8_Rb_treeISt4pairIiiES1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE13_Rb_tree_implIS5_Lb1EEE", !31, i64 0, !19, i64 8}
!31 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessISt4pairIiiEEE", !32, i64 0}
!32 = !{!"_ZTSSt4lessISt4pairIiiEE"}


; 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.std::map.57" = type { %"class.std::_Rb_tree.58" }
%"class.std::_Rb_tree.58" = type { %"struct.std::_Rb_tree<char, std::pair<const char, sim::Color>, std::_Select1st<std::pair<const char, sim::Color>>, std::less<char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<char, std::pair<const char, sim::Color>, std::_Select1st<std::pair<const char, sim::Color>>, std::less<char>>::_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 }

@_ZN3simL13CHAR_TO_COLORE = external hidden global %"class.std::map.57", align 8
@.str.72 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [87 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3sim14MouseInterface12setTileColorEiic(ptr noundef nonnull align 8 dereferenceable(296) %0, i32 noundef %1, i32 noundef %2, i8 noundef signext %3) local_unnamed_addr #0 align 2 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  store i32 %1, ptr %5, align 4, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !5
  store i8 %3, ptr %7, align 1, !tbaa !9
  %8 = load ptr, ptr %0, align 8, !tbaa !10
  %9 = tail call noundef zeroext i1 @_ZNK3sim4Maze10withinMazeEii(ptr noundef nonnull align 8 dereferenceable(26) %8, i32 noundef %1, i32 noundef %2)
  br i1 %9, label %12, label %10

10:                                               ; preds = %4
  %11 = tail call noundef ptr @_ZN3sim1LEv()
  call void @_ZN2el6Logger4warnIiJiEEEvPKcRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728) %11, ptr noundef nonnull @.str.72, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  br label %17

12:                                               ; preds = %4
  %13 = tail call noundef zeroext i1 @_ZN3sim18ContainerUtilities11mapContainsIcNS_5ColorEEEbRKSt3mapIT_T0_St4lessIS4_ESaISt4pairIKS4_S5_EEES4_(ptr noundef nonnull align 8 dereferenceable(48) @_ZN3simL13CHAR_TO_COLORE, i8 noundef signext %3)
  br i1 %13, label %16, label %14

14:                                               ; preds = %12
  %15 = tail call noundef ptr @_ZN3sim1LEv()
  call void @_ZN2el6Logger4warnIiJiccEEEvPKcRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728) %15, ptr noundef nonnull @.str.73, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 1 dereferenceable(1) %7, ptr noundef nonnull align 1 dereferenceable(1) %7)
  br label %17

16:                                               ; preds = %12
  tail call void @_ZN3sim14MouseInterface16setTileColorImplEiic(ptr noundef nonnull align 8 dereferenceable(296) %0, i32 noundef %1, i32 noundef %2, i8 noundef signext %3)
  br label %17

17:                                               ; preds = %16, %14, %10
  ret void
}

declare noundef zeroext i1 @_ZNK3sim4Maze10withinMazeEii(ptr noundef nonnull align 8 dereferenceable(26), i32 noundef, i32 noundef) local_unnamed_addr #1

declare noundef ptr @_ZN3sim1LEv() local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3sim18ContainerUtilities11mapContainsIcNS_5ColorEEEbRKSt3mapIT_T0_St4lessIS4_ESaISt4pairIKS4_S5_EEES4_(ptr noundef nonnull align 8 dereferenceable(48), i8 noundef signext) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2el6Logger4warnIiJiccEEEvPKcRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728), ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3sim14MouseInterface16setTileColorImplEiic(ptr noundef nonnull align 8 dereferenceable(296), i32 noundef, i32 noundef, i8 noundef signext) local_unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !12, i64 0}
!11 = !{!"_ZTSN3sim14MouseInterfaceE", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !13, i64 32, !22, i64 80, !26, i64 192, !27, i64 200, !27, i64 248}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"_ZTSSt3setIcSt4lessIcESaIcEE", !14, i64 0}
!14 = !{!"_ZTSSt8_Rb_treeIccSt9_IdentityIcESt4lessIcESaIcEE", !15, i64 0}
!15 = !{!"_ZTSNSt8_Rb_treeIccSt9_IdentityIcESt4lessIcESaIcEE13_Rb_tree_implIS3_Lb1EEE", !16, i64 0, !18, i64 8}
!16 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIcEE", !17, i64 0}
!17 = !{!"_ZTSSt4lessIcE"}
!18 = !{!"_ZTSSt15_Rb_tree_header", !19, i64 0, !21, i64 32}
!19 = !{!"_ZTSSt18_Rb_tree_node_base", !20, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!20 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTSN3sim27StaticMouseAlgorithmOptionsE", !23, i64 0, !23, i64 32, !23, i64 64, !6, i64 96, !6, i64 100, !25, i64 104}
!23 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !24, i64 0, !21, i64 8, !7, i64 16}
!24 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !12, i64 0}
!25 = !{!"double", !7, i64 0}
!26 = !{!"bool", !7, i64 0}
!27 = !{!"_ZTSSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE", !28, i64 0}
!28 = !{!"_ZTSSt8_Rb_treeISt4pairIiiES1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSNSt8_Rb_treeISt4pairIiiES1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE13_Rb_tree_implIS5_Lb1EEE", !30, i64 0, !18, i64 8}
!30 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessISt4pairIiiEEE", !31, i64 0}
!31 = !{!"_ZTSSt4lessISt4pairIiiEE"}


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