; LLVM IR from mackorone/mms :: old/v2/src/sim (BufferInterface)

; 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" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<sim::Color, std::pair<const sim::Color, std::tuple<double, double, double>>, std::_Select1st<std::pair<const sim::Color, std::tuple<double, double, double>>>, std::less<sim::Color>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<sim::Color, std::pair<const sim::Color, std::tuple<double, double, double>>, std::_Select1st<std::pair<const sim::Color, std::tuple<double, double, double>>>, std::less<sim::Color>>::_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::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.3" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Tuple_impl.1", %"struct.std::_Head_base.2" }
%"struct.std::_Tuple_impl.1" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { double }
%"struct.std::_Head_base.2" = type { double }
%"struct.std::_Head_base.3" = type { double }
%"class.sim::BufferInterface" = type { %"struct.std::pair.133", ptr, ptr, %"class.sim::TileGraphicTextCache" }
%"struct.std::pair.133" = type { i32, i32 }
%"class.sim::TileGraphicTextCache" = type { %"class.sim::Meters", %"class.sim::Meters", %"struct.std::pair.133", %"class.std::map.135", %"class.std::map.140" }
%"class.sim::Meters" = type { %"class.sim::Distance" }
%"class.sim::Distance" = type { ptr, double }
%"class.std::map.135" = type { %"class.std::_Rb_tree.136" }
%"class.std::_Rb_tree.136" = type { %"struct.std::_Rb_tree<char, std::pair<const char, std::pair<double, double>>, std::_Select1st<std::pair<const char, std::pair<double, double>>>, std::less<char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<char, std::pair<const char, std::pair<double, double>>, std::_Select1st<std::pair<const char, std::pair<double, double>>>, std::less<char>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::map.140" = type { %"class.std::_Rb_tree.141" }
%"class.std::_Rb_tree.141" = type { %"struct.std::_Rb_tree<std::pair<std::pair<int, int>, std::pair<int, int>>, std::pair<const std::pair<std::pair<int, int>, std::pair<int, int>>, std::pair<sim::Cartesian, sim::Cartesian>>, std::_Select1st<std::pair<const std::pair<std::pair<int, int>, std::pair<int, int>>, std::pair<sim::Cartesian, sim::Cartesian>>>, std::less<std::pair<std::pair<int, int>, std::pair<int, int>>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<std::pair<int, int>, std::pair<int, int>>, std::pair<const std::pair<std::pair<int, int>, std::pair<int, int>>, std::pair<sim::Cartesian, sim::Cartesian>>, std::_Select1st<std::pair<const std::pair<std::pair<int, int>, std::pair<int, int>>, std::pair<sim::Cartesian, sim::Cartesian>>>, std::less<std::pair<std::pair<int, int>, std::pair<int, int>>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.sim::TriangleGraphic" = type { %"struct.sim::VertexGraphic", %"struct.sim::VertexGraphic", %"struct.sim::VertexGraphic" }
%"struct.sim::VertexGraphic" = type { double, double, double, double, double, double }

@_ZN3simL12COLOR_TO_RGBE = external hidden global %"class.std::map", align 8

; 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: 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 noundef nonnull align 8 dereferenceable(144) ptr @_ZNSt6vectorIN3sim15TriangleGraphicESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3sim15BufferInterface26updateTileGraphicBaseColorEiiNS_5ColorE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #2 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.std::tuple", align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  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 i32 %3, ptr %8, align 4, !tbaa !11
  %13 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %14 = load i32, ptr %6, align 4, !tbaa !9
  %15 = load i32, ptr %7, align 4, !tbaa !9
  %16 = call noundef i32 @_ZN3sim15BufferInterface31getTileGraphicBaseStartingIndexEii(ptr noundef nonnull align 8 dereferenceable(160) %13, i32 noundef %14, i32 noundef %15)
  store i32 %16, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #4
  %17 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt3mapIN3sim5ColorESt5tupleIJdddEESt4lessIS1_ESaISt4pairIKS1_S3_EEE2atERS7_(ptr noundef nonnull align 8 dereferenceable(48) @_ZN3simL12COLOR_TO_RGBE, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %17, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %18

18:                                               ; preds = %75, %4
  %19 = load i32, ptr %11, align 4, !tbaa !9
  %20 = icmp slt i32 %19, 2
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %78

22:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %23 = getelementptr inbounds %"class.sim::BufferInterface", ptr %13, i32 0, i32 1
  %24 = load ptr, ptr %23, align 8, !tbaa !13
  %25 = load i32, ptr %9, align 4, !tbaa !9
  %26 = load i32, ptr %11, align 4, !tbaa !9
  %27 = add nsw i32 %25, %26
  %28 = sext i32 %27 to i64
  %29 = call noundef nonnull align 8 dereferenceable(144) ptr @_ZNSt6vectorIN3sim15TriangleGraphicESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %28)
  store ptr %29, ptr %12, align 8, !tbaa !5
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  %31 = load double, ptr %30, align 8, !tbaa !34
  %32 = load ptr, ptr %12, align 8, !tbaa !5
  %33 = getelementptr inbounds %"struct.sim::TriangleGraphic", ptr %32, i32 0, i32 0
  %34 = getelementptr inbounds %"struct.sim::VertexGraphic", ptr %33, i32 0, i32 2
  store double %31, ptr %34, align 8, !tbaa !35
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  %36 = load double, ptr %35, align 8, !tbaa !34
  %37 = load ptr, ptr %12, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.sim::TriangleGraphic", ptr %37, i32 0, i32 0
  %39 = getelementptr inbounds %"struct.sim::VertexGraphic", ptr %38, i32 0, i32 3
  store double %36, ptr %39, align 8, !tbaa !38
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm2EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  %41 = load double, ptr %40, align 8, !tbaa !34
  %42 = load ptr, ptr %12, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.sim::TriangleGraphic", ptr %42, i32 0, i32 0
  %44 = getelementptr inbounds %"struct.sim::VertexGraphic", ptr %43, i32 0, i32 4
  store double %41, ptr %44, align 8, !tbaa !39
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  %46 = load double, ptr %45, align 8, !tbaa !34
  %47 = load ptr, ptr %12, align 8, !tbaa !5
  %48 = getelementptr inbounds %"struct.sim::TriangleGraphic", ptr %47, i32 0, i32 1
  %49 = getelementptr inbounds %"struct.sim::VertexGraphic", ptr %48, i32 0, i32 2
  store double %46, ptr %49, align 8, !tbaa !40
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  %51 = load double, ptr %50, align 8, !tbaa !34
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.sim::TriangleGraphic", ptr %52, i32 0, i32 1
  %54 = getelementptr inbounds %"struct.sim::VertexGraphic", ptr %53, i32 0, i32 3
  store double %51, ptr %54, align 8, !tbaa !41
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm2EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  %56 = load double, ptr %55, align 8, !tbaa !34
  %57 = load ptr, ptr %12, align 8, !tbaa !5
  %58 = getelementptr inbounds %"struct.sim::TriangleGraphic", ptr %57, i32 0, i32 1
  %59 = getelementptr inbounds %"struct.sim::VertexGraphic", ptr %58, i32 0, i32 4
  store double %56, ptr %59, align 8, !tbaa !42
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  %61 = load double, ptr %60, align 8, !tbaa !34
  %62 = load ptr, ptr %12, align 8, !tbaa !5
  %63 = getelementptr inbounds %"struct.sim::TriangleGraphic", ptr %62, i32 0, i32 2
  %64 = getelementptr inbounds %"struct.sim::VertexGraphic", ptr %63, i32 0, i32 2
  store double %61, ptr %64, align 8, !tbaa !43
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  %66 = load double, ptr %65, align 8, !tbaa !34
  %67 = load ptr, ptr %12, align 8, !tbaa !5
  %68 = getelementptr inbounds %"struct.sim::TriangleGraphic", ptr %67, i32 0, i32 2
  %69 = getelementptr inbounds %"struct.sim::VertexGraphic", ptr %68, i32 0, i32 3
  store double %66, ptr %69, align 8, !tbaa !44
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm2EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  %71 = load double, ptr %70, align 8, !tbaa !34
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = getelementptr inbounds %"struct.sim::TriangleGraphic", ptr %72, i32 0, i32 2
  %74 = getelementptr inbounds %"struct.sim::VertexGraphic", ptr %73, i32 0, i32 4
  store double %71, ptr %74, align 8, !tbaa !45
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %75

75:                                               ; preds = %22
  %76 = load i32, ptr %11, align 4, !tbaa !9
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %11, align 4, !tbaa !9
  br label %18, !llvm.loop !46

78:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  ret void
}

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

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

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

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

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

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 = { 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 #4 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTSN3sim5ColorE", !7, i64 0}
!13 = !{!14, !6, i64 8}
!14 = !{!"_ZTSN3sim15BufferInterfaceE", !15, i64 0, !6, i64 8, !6, i64 16, !16, i64 24}
!15 = !{!"_ZTSSt4pairIiiE", !10, i64 0, !10, i64 4}
!16 = !{!"_ZTSN3sim20TileGraphicTextCacheE", !17, i64 0, !17, i64 16, !15, i64 32, !20, i64 40, !29, i64 88}
!17 = !{!"_ZTSN3sim6MetersE", !18, i64 0}
!18 = !{!"_ZTSN3sim8DistanceE", !19, i64 8}
!19 = !{!"double", !7, i64 0}
!20 = !{!"_ZTSSt3mapIcSt4pairIddESt4lessIcESaIS0_IKcS1_EEE", !21, i64 0}
!21 = !{!"_ZTSSt8_Rb_treeIcSt4pairIKcS0_IddEESt10_Select1stIS3_ESt4lessIcESaIS3_EE", !22, i64 0}
!22 = !{!"_ZTSNSt8_Rb_treeIcSt4pairIKcS0_IddEESt10_Select1stIS3_ESt4lessIcESaIS3_EE13_Rb_tree_implIS7_Lb1EEE", !23, i64 0, !25, i64 8}
!23 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIcEE", !24, i64 0}
!24 = !{!"_ZTSSt4lessIcE"}
!25 = !{!"_ZTSSt15_Rb_tree_header", !26, i64 0, !28, i64 32}
!26 = !{!"_ZTSSt18_Rb_tree_node_base", !27, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!27 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!28 = !{!"long", !7, i64 0}
!29 = !{!"_ZTSSt3mapISt4pairIS0_IiiES1_ES0_IN3sim9CartesianES4_ESt4lessIS2_ESaIS0_IKS2_S5_EEE", !30, i64 0}
!30 = !{!"_ZTSSt8_Rb_treeISt4pairIS0_IiiES1_ES0_IKS2_S0_IN3sim9CartesianES5_EESt10_Select1stIS7_ESt4lessIS2_ESaIS7_EE", !31, i64 0}
!31 = !{!"_ZTSNSt8_Rb_treeISt4pairIS0_IiiES1_ES0_IKS2_S0_IN3sim9CartesianES5_EESt10_Select1stIS7_ESt4lessIS2_ESaIS7_EE13_Rb_tree_implISB_Lb1EEE", !32, i64 0, !25, i64 8}
!32 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessISt4pairIS1_IiiES2_EEE", !33, i64 0}
!33 = !{!"_ZTSSt4lessISt4pairIS0_IiiES1_EE"}
!34 = !{!19, !19, i64 0}
!35 = !{!36, !19, i64 16}
!36 = !{!"_ZTSN3sim15TriangleGraphicE", !37, i64 0, !37, i64 48, !37, i64 96}
!37 = !{!"_ZTSN3sim13VertexGraphicE", !19, i64 0, !19, i64 8, !19, i64 16, !19, i64 24, !19, i64 32, !19, i64 40}
!38 = !{!36, !19, i64 24}
!39 = !{!36, !19, i64 32}
!40 = !{!36, !19, i64 64}
!41 = !{!36, !19, i64 72}
!42 = !{!36, !19, i64 80}
!43 = !{!36, !19, i64 112}
!44 = !{!36, !19, i64 120}
!45 = !{!36, !19, i64 128}
!46 = distinct !{!46, !47}
!47 = !{!"llvm.loop.mustprogress"}


; 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" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<sim::Color, std::pair<const sim::Color, std::tuple<double, double, double>>, std::_Select1st<std::pair<const sim::Color, std::tuple<double, double, double>>>, std::less<sim::Color>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<sim::Color, std::pair<const sim::Color, std::tuple<double, double, double>>, std::_Select1st<std::pair<const sim::Color, std::tuple<double, double, double>>>, std::less<sim::Color>>::_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::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.3" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Tuple_impl.1", %"struct.std::_Head_base.2" }
%"struct.std::_Tuple_impl.1" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { double }
%"struct.std::_Head_base.2" = type { double }
%"struct.std::_Head_base.3" = type { double }

@_ZN3simL12COLOR_TO_RGBE = external hidden global %"class.std::map", align 8

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

; 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 noundef nonnull align 8 dereferenceable(144) ptr @_ZNSt6vectorIN3sim15TriangleGraphicESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3sim15BufferInterface26updateTileGraphicBaseColorEiiNS_5ColorE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #2 align 2 {
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::tuple", align 8
  store i32 %3, ptr %5, align 4, !tbaa !5
  %7 = tail call noundef i32 @_ZN3sim15BufferInterface31getTileGraphicBaseStartingIndexEii(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %1, i32 noundef %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #4
  %8 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt3mapIN3sim5ColorESt5tupleIJdddEESt4lessIS1_ESaISt4pairIKS1_S3_EEE2atERS7_(ptr noundef nonnull align 8 dereferenceable(48) @_ZN3simL12COLOR_TO_RGBE, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %8, i64 24, i1 false)
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = sext i32 %7 to i64
  %11 = load ptr, ptr %9, align 8, !tbaa !9
  %12 = call noundef nonnull align 8 dereferenceable(144) ptr @_ZNSt6vectorIN3sim15TriangleGraphicESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %10)
  %13 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %14 = load double, ptr %13, align 8, !tbaa !32
  %15 = getelementptr inbounds i8, ptr %12, i64 16
  store double %14, ptr %15, align 8, !tbaa !33
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %17 = load double, ptr %16, align 8, !tbaa !32
  %18 = getelementptr inbounds i8, ptr %12, i64 24
  store double %17, ptr %18, align 8, !tbaa !36
  %19 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm2EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %20 = load double, ptr %19, align 8, !tbaa !32
  %21 = getelementptr inbounds i8, ptr %12, i64 32
  store double %20, ptr %21, align 8, !tbaa !37
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %23 = load double, ptr %22, align 8, !tbaa !32
  %24 = getelementptr inbounds i8, ptr %12, i64 64
  store double %23, ptr %24, align 8, !tbaa !38
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %26 = load double, ptr %25, align 8, !tbaa !32
  %27 = getelementptr inbounds i8, ptr %12, i64 72
  store double %26, ptr %27, align 8, !tbaa !39
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm2EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %29 = load double, ptr %28, align 8, !tbaa !32
  %30 = getelementptr inbounds i8, ptr %12, i64 80
  store double %29, ptr %30, align 8, !tbaa !40
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %32 = load double, ptr %31, align 8, !tbaa !32
  %33 = getelementptr inbounds i8, ptr %12, i64 112
  store double %32, ptr %33, align 8, !tbaa !41
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %35 = load double, ptr %34, align 8, !tbaa !32
  %36 = getelementptr inbounds i8, ptr %12, i64 120
  store double %35, ptr %36, align 8, !tbaa !42
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm2EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %38 = load double, ptr %37, align 8, !tbaa !32
  %39 = getelementptr inbounds i8, ptr %12, i64 128
  store double %38, ptr %39, align 8, !tbaa !43
  %40 = load ptr, ptr %9, align 8, !tbaa !9
  %41 = add nsw i64 %10, 1
  %42 = call noundef nonnull align 8 dereferenceable(144) ptr @_ZNSt6vectorIN3sim15TriangleGraphicESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %40, i64 noundef %41)
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %44 = load double, ptr %43, align 8, !tbaa !32
  %45 = getelementptr inbounds i8, ptr %42, i64 16
  store double %44, ptr %45, align 8, !tbaa !33
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %47 = load double, ptr %46, align 8, !tbaa !32
  %48 = getelementptr inbounds i8, ptr %42, i64 24
  store double %47, ptr %48, align 8, !tbaa !36
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm2EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %50 = load double, ptr %49, align 8, !tbaa !32
  %51 = getelementptr inbounds i8, ptr %42, i64 32
  store double %50, ptr %51, align 8, !tbaa !37
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %53 = load double, ptr %52, align 8, !tbaa !32
  %54 = getelementptr inbounds i8, ptr %42, i64 64
  store double %53, ptr %54, align 8, !tbaa !38
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %56 = load double, ptr %55, align 8, !tbaa !32
  %57 = getelementptr inbounds i8, ptr %42, i64 72
  store double %56, ptr %57, align 8, !tbaa !39
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm2EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %59 = load double, ptr %58, align 8, !tbaa !32
  %60 = getelementptr inbounds i8, ptr %42, i64 80
  store double %59, ptr %60, align 8, !tbaa !40
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %62 = load double, ptr %61, align 8, !tbaa !32
  %63 = getelementptr inbounds i8, ptr %42, i64 112
  store double %62, ptr %63, align 8, !tbaa !41
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %65 = load double, ptr %64, align 8, !tbaa !32
  %66 = getelementptr inbounds i8, ptr %42, i64 120
  store double %65, ptr %66, align 8, !tbaa !42
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm2EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %68 = load double, ptr %67, align 8, !tbaa !32
  %69 = getelementptr inbounds i8, ptr %42, i64 128
  store double %68, ptr %69, align 8, !tbaa !43
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #4
  ret void
}

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

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

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

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

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

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 = { 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 #4 = { 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 = !{!"_ZTSN3sim5ColorE", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !13, i64 8}
!10 = !{!"_ZTSN3sim15BufferInterfaceE", !11, i64 0, !13, i64 8, !13, i64 16, !14, i64 24}
!11 = !{!"_ZTSSt4pairIiiE", !12, i64 0, !12, i64 4}
!12 = !{!"int", !7, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"_ZTSN3sim20TileGraphicTextCacheE", !15, i64 0, !15, i64 16, !11, i64 32, !18, i64 40, !27, i64 88}
!15 = !{!"_ZTSN3sim6MetersE", !16, i64 0}
!16 = !{!"_ZTSN3sim8DistanceE", !17, i64 8}
!17 = !{!"double", !7, i64 0}
!18 = !{!"_ZTSSt3mapIcSt4pairIddESt4lessIcESaIS0_IKcS1_EEE", !19, i64 0}
!19 = !{!"_ZTSSt8_Rb_treeIcSt4pairIKcS0_IddEESt10_Select1stIS3_ESt4lessIcESaIS3_EE", !20, i64 0}
!20 = !{!"_ZTSNSt8_Rb_treeIcSt4pairIKcS0_IddEESt10_Select1stIS3_ESt4lessIcESaIS3_EE13_Rb_tree_implIS7_Lb1EEE", !21, i64 0, !23, i64 8}
!21 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIcEE", !22, i64 0}
!22 = !{!"_ZTSSt4lessIcE"}
!23 = !{!"_ZTSSt15_Rb_tree_header", !24, i64 0, !26, i64 32}
!24 = !{!"_ZTSSt18_Rb_tree_node_base", !25, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!25 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!26 = !{!"long", !7, i64 0}
!27 = !{!"_ZTSSt3mapISt4pairIS0_IiiES1_ES0_IN3sim9CartesianES4_ESt4lessIS2_ESaIS0_IKS2_S5_EEE", !28, i64 0}
!28 = !{!"_ZTSSt8_Rb_treeISt4pairIS0_IiiES1_ES0_IKS2_S0_IN3sim9CartesianES5_EESt10_Select1stIS7_ESt4lessIS2_ESaIS7_EE", !29, i64 0}
!29 = !{!"_ZTSNSt8_Rb_treeISt4pairIS0_IiiES1_ES0_IKS2_S0_IN3sim9CartesianES5_EESt10_Select1stIS7_ESt4lessIS2_ESaIS7_EE13_Rb_tree_implISB_Lb1EEE", !30, i64 0, !23, i64 8}
!30 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessISt4pairIS1_IiiES2_EEE", !31, i64 0}
!31 = !{!"_ZTSSt4lessISt4pairIS0_IiiES1_EE"}
!32 = !{!17, !17, i64 0}
!33 = !{!34, !17, i64 16}
!34 = !{!"_ZTSN3sim15TriangleGraphicE", !35, i64 0, !35, i64 48, !35, i64 96}
!35 = !{!"_ZTSN3sim13VertexGraphicE", !17, i64 0, !17, i64 8, !17, i64 16, !17, i64 24, !17, i64 32, !17, i64 40}
!36 = !{!34, !17, i64 24}
!37 = !{!34, !17, i64 32}
!38 = !{!34, !17, i64 64}
!39 = !{!34, !17, i64 72}
!40 = !{!34, !17, i64 80}
!41 = !{!34, !17, i64 112}
!42 = !{!34, !17, i64 120}
!43 = !{!34, !17, i64 128}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass