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

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

23:                                               ; preds = %92, %6
  %24 = load i32, ptr %15, align 4, !tbaa !9
  %25 = icmp slt i32 %24, 2
  br i1 %25, label %27, label %26

26:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %95

27:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %28 = getelementptr inbounds %"class.sim::BufferInterface", ptr %17, i32 0, i32 1
  %29 = load ptr, ptr %28, align 8, !tbaa !17
  %30 = load i32, ptr %13, align 4, !tbaa !9
  %31 = load i32, ptr %15, align 4, !tbaa !9
  %32 = add nsw i32 %30, %31
  %33 = sext i32 %32 to i64
  %34 = call noundef nonnull align 8 dereferenceable(144) ptr @_ZNSt6vectorIN3sim15TriangleGraphicESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %33)
  store ptr %34, ptr %16, align 8, !tbaa !5
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  %36 = load double, ptr %35, align 8, !tbaa !15
  %37 = load ptr, ptr %16, 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 2
  store double %36, ptr %39, align 8, !tbaa !37
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  %41 = load double, ptr %40, align 8, !tbaa !15
  %42 = load ptr, ptr %16, 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 3
  store double %41, ptr %44, align 8, !tbaa !40
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm2EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  %46 = load double, ptr %45, align 8, !tbaa !15
  %47 = load ptr, ptr %16, align 8, !tbaa !5
  %48 = getelementptr inbounds %"struct.sim::TriangleGraphic", ptr %47, i32 0, i32 0
  %49 = getelementptr inbounds %"struct.sim::VertexGraphic", ptr %48, i32 0, i32 4
  store double %46, ptr %49, align 8, !tbaa !41
  %50 = load double, ptr %12, align 8, !tbaa !15
  %51 = load ptr, ptr %16, align 8, !tbaa !5
  %52 = getelementptr inbounds %"struct.sim::TriangleGraphic", ptr %51, i32 0, i32 0
  %53 = getelementptr inbounds %"struct.sim::VertexGraphic", ptr %52, i32 0, i32 5
  store double %50, ptr %53, align 8, !tbaa !42
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  %55 = load double, ptr %54, align 8, !tbaa !15
  %56 = load ptr, ptr %16, align 8, !tbaa !5
  %57 = getelementptr inbounds %"struct.sim::TriangleGraphic", ptr %56, i32 0, i32 1
  %58 = getelementptr inbounds %"struct.sim::VertexGraphic", ptr %57, i32 0, i32 2
  store double %55, ptr %58, align 8, !tbaa !43
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  %60 = load double, ptr %59, align 8, !tbaa !15
  %61 = load ptr, ptr %16, align 8, !tbaa !5
  %62 = getelementptr inbounds %"struct.sim::TriangleGraphic", ptr %61, i32 0, i32 1
  %63 = getelementptr inbounds %"struct.sim::VertexGraphic", ptr %62, i32 0, i32 3
  store double %60, ptr %63, align 8, !tbaa !44
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm2EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  %65 = load double, ptr %64, align 8, !tbaa !15
  %66 = load ptr, ptr %16, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.sim::TriangleGraphic", ptr %66, i32 0, i32 1
  %68 = getelementptr inbounds %"struct.sim::VertexGraphic", ptr %67, i32 0, i32 4
  store double %65, ptr %68, align 8, !tbaa !45
  %69 = load double, ptr %12, align 8, !tbaa !15
  %70 = load ptr, ptr %16, align 8, !tbaa !5
  %71 = getelementptr inbounds %"struct.sim::TriangleGraphic", ptr %70, i32 0, i32 1
  %72 = getelementptr inbounds %"struct.sim::VertexGraphic", ptr %71, i32 0, i32 5
  store double %69, ptr %72, align 8, !tbaa !46
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  %74 = load double, ptr %73, align 8, !tbaa !15
  %75 = load ptr, ptr %16, align 8, !tbaa !5
  %76 = getelementptr inbounds %"struct.sim::TriangleGraphic", ptr %75, i32 0, i32 2
  %77 = getelementptr inbounds %"struct.sim::VertexGraphic", ptr %76, i32 0, i32 2
  store double %74, ptr %77, align 8, !tbaa !47
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  %79 = load double, ptr %78, align 8, !tbaa !15
  %80 = load ptr, ptr %16, align 8, !tbaa !5
  %81 = getelementptr inbounds %"struct.sim::TriangleGraphic", ptr %80, i32 0, i32 2
  %82 = getelementptr inbounds %"struct.sim::VertexGraphic", ptr %81, i32 0, i32 3
  store double %79, ptr %82, align 8, !tbaa !48
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm2EJdddEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  %84 = load double, ptr %83, align 8, !tbaa !15
  %85 = load ptr, ptr %16, align 8, !tbaa !5
  %86 = getelementptr inbounds %"struct.sim::TriangleGraphic", ptr %85, i32 0, i32 2
  %87 = getelementptr inbounds %"struct.sim::VertexGraphic", ptr %86, i32 0, i32 4
  store double %84, ptr %87, align 8, !tbaa !49
  %88 = load double, ptr %12, align 8, !tbaa !15
  %89 = load ptr, ptr %16, align 8, !tbaa !5
  %90 = getelementptr inbounds %"struct.sim::TriangleGraphic", ptr %89, i32 0, i32 2
  %91 = getelementptr inbounds %"struct.sim::VertexGraphic", ptr %90, i32 0, i32 5
  store double %88, ptr %91, align 8, !tbaa !50
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %92

92:                                               ; preds = %27
  %93 = load i32, ptr %15, align 4, !tbaa !9
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %15, align 4, !tbaa !9
  br label %23, !llvm.loop !51

95:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3sim15BufferInterface31getTileGraphicWallStartingIndexEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160), i32 noundef, i32 noundef, i32 noundef) #2 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 = { 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 = !{!"_ZTSN3sim9DirectionE", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_ZTSN3sim5ColorE", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!18, !6, i64 8}
!18 = !{!"_ZTSN3sim15BufferInterfaceE", !19, i64 0, !6, i64 8, !6, i64 16, !20, i64 24}
!19 = !{!"_ZTSSt4pairIiiE", !10, i64 0, !10, i64 4}
!20 = !{!"_ZTSN3sim20TileGraphicTextCacheE", !21, i64 0, !21, i64 16, !19, i64 32, !23, i64 40, !32, i64 88}
!21 = !{!"_ZTSN3sim6MetersE", !22, i64 0}
!22 = !{!"_ZTSN3sim8DistanceE", !16, i64 8}
!23 = !{!"_ZTSSt3mapIcSt4pairIddESt4lessIcESaIS0_IKcS1_EEE", !24, i64 0}
!24 = !{!"_ZTSSt8_Rb_treeIcSt4pairIKcS0_IddEESt10_Select1stIS3_ESt4lessIcESaIS3_EE", !25, i64 0}
!25 = !{!"_ZTSNSt8_Rb_treeIcSt4pairIKcS0_IddEESt10_Select1stIS3_ESt4lessIcESaIS3_EE13_Rb_tree_implIS7_Lb1EEE", !26, i64 0, !28, i64 8}
!26 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIcEE", !27, i64 0}
!27 = !{!"_ZTSSt4lessIcE"}
!28 = !{!"_ZTSSt15_Rb_tree_header", !29, i64 0, !31, i64 32}
!29 = !{!"_ZTSSt18_Rb_tree_node_base", !30, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!30 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!31 = !{!"long", !7, i64 0}
!32 = !{!"_ZTSSt3mapISt4pairIS0_IiiES1_ES0_IN3sim9CartesianES4_ESt4lessIS2_ESaIS0_IKS2_S5_EEE", !33, i64 0}
!33 = !{!"_ZTSSt8_Rb_treeISt4pairIS0_IiiES1_ES0_IKS2_S0_IN3sim9CartesianES5_EESt10_Select1stIS7_ESt4lessIS2_ESaIS7_EE", !34, i64 0}
!34 = !{!"_ZTSNSt8_Rb_treeISt4pairIS0_IiiES1_ES0_IKS2_S0_IN3sim9CartesianES5_EESt10_Select1stIS7_ESt4lessIS2_ESaIS7_EE13_Rb_tree_implISB_Lb1EEE", !35, i64 0, !28, i64 8}
!35 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessISt4pairIS1_IiiES2_EEE", !36, i64 0}
!36 = !{!"_ZTSSt4lessISt4pairIS0_IiiES1_EE"}
!37 = !{!38, !16, i64 16}
!38 = !{!"_ZTSN3sim15TriangleGraphicE", !39, i64 0, !39, i64 48, !39, i64 96}
!39 = !{!"_ZTSN3sim13VertexGraphicE", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40}
!40 = !{!38, !16, i64 24}
!41 = !{!38, !16, i64 32}
!42 = !{!38, !16, i64 40}
!43 = !{!38, !16, i64 64}
!44 = !{!38, !16, i64 72}
!45 = !{!38, !16, i64 80}
!46 = !{!38, !16, i64 88}
!47 = !{!38, !16, i64 112}
!48 = !{!38, !16, i64 120}
!49 = !{!38, !16, i64 128}
!50 = !{!38, !16, i64 136}
!51 = distinct !{!51, !52}
!52 = !{!"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
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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3sim15BufferInterface31getTileGraphicWallStartingIndexEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2 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 = { 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 40}
!39 = !{!34, !17, i64 64}
!40 = !{!34, !17, i64 72}
!41 = !{!34, !17, i64 80}
!42 = !{!34, !17, i64 88}
!43 = !{!34, !17, i64 112}
!44 = !{!34, !17, i64 120}
!45 = !{!34, !17, i64 128}
!46 = !{!34, !17, i64 136}


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