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

; 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.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.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"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" }

@.str.80 = external hidden unnamed_addr constant [78 x i8], align 1

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

declare noundef ptr @_ZN3sim1LEv() #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3sim14MouseInterface16setTileFogginessEiib(ptr noundef nonnull align 8 dereferenceable(296) %0, i32 noundef %1, i32 noundef %2, i1 noundef zeroext %3) #2 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
  %9 = zext i1 %3 to i8
  store i8 %9, ptr %8, align 1, !tbaa !11
  %10 = load ptr, ptr %5, align 8
  %11 = getelementptr inbounds %"class.sim::MouseInterface", ptr %10, i32 0, i32 0
  %12 = load ptr, ptr %11, align 8, !tbaa !13
  %13 = load i32, ptr %6, align 4, !tbaa !9
  %14 = load i32, ptr %7, align 4, !tbaa !9
  %15 = call noundef zeroext i1 @_ZNK3sim4Maze10withinMazeEii(ptr noundef nonnull align 8 dereferenceable(26) %12, i32 noundef %13, i32 noundef %14)
  br i1 %15, label %18, label %16

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

18:                                               ; preds = %4
  %19 = getelementptr inbounds %"class.sim::MouseInterface", ptr %10, i32 0, i32 2
  %20 = load ptr, ptr %19, align 8, !tbaa !33
  %21 = load i32, ptr %6, align 4, !tbaa !9
  %22 = load i32, ptr %7, align 4, !tbaa !9
  %23 = load i8, ptr %8, align 1, !tbaa !11, !range !34, !noundef !35
  %24 = trunc i8 %23 to i1
  call void @_ZN3sim11MazeGraphic16setTileFogginessEiib(ptr noundef nonnull align 8 dereferenceable(24) %20, i32 noundef %21, i32 noundef %22, i1 noundef zeroext %24)
  br label %25

25:                                               ; preds = %18, %16
  ret void
}

declare void @_ZN3sim11MazeGraphic16setTileFogginessEiib(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, i1 noundef zeroext) #0

attributes #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 = { 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 #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" }

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


; 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"

@.str.80 = external hidden unnamed_addr constant [78 x i8], align 1

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

declare noundef ptr @_ZN3sim1LEv() local_unnamed_addr #0

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

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

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

11:                                               ; preds = %4
  %12 = getelementptr inbounds i8, ptr %0, i64 16
  %13 = load ptr, ptr %12, align 8, !tbaa !31
  tail call void @_ZN3sim11MazeGraphic16setTileFogginessEiib(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef %1, i32 noundef %2, i1 noundef zeroext %3)
  br label %14

14:                                               ; preds = %11, %9
  ret void
}

declare void @_ZN3sim11MazeGraphic16setTileFogginessEiib(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #0

attributes #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 = { 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 #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" }

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


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