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

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

%"struct.std::pair.36" = type { %"class.sim::Cartesian", %"class.sim::Cartesian" }
%"class.sim::Cartesian" = type { %"class.sim::Coordinate" }
%"class.sim::Coordinate" = type { ptr, %"class.sim::Meters", %"class.sim::Meters" }
%"class.sim::Meters" = type { %"class.sim::Distance" }
%"class.sim::Distance" = type { ptr, double }
%"struct.std::pair.38" = type { %"struct.std::pair.20", %"struct.std::pair.20" }
%"struct.std::pair.20" = type { i32, i32 }
%"class.sim::TileGraphicTextCache" = type { %"class.sim::Meters", %"class.sim::Meters", %"struct.std::pair.20", %"class.std::map.22", %"class.std::map.28" }
%"class.std::map.22" = type { %"class.std::_Rb_tree.23" }
%"class.std::_Rb_tree.23" = 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" }
%"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::map.28" = type { %"class.std::_Rb_tree.29" }
%"class.std::_Rb_tree.29" = 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" }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nounwind
declare void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3sim20TileGraphicTextCache26getTileGraphicTextPositionEiiiiii(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.36") align 8 %0, ptr noundef nonnull align 8 dereferenceable(136) %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7) #2 align 2 personality ptr @__gxx_personality_v0 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::pair.36", align 8
  %18 = alloca %"struct.std::pair.38", align 4
  %19 = alloca %"struct.std::pair.20", align 4
  %20 = alloca %"struct.std::pair.20", align 4
  %21 = alloca %"class.sim::Meters", align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca %"class.sim::Cartesian", align 8
  %25 = alloca %"class.sim::Meters", align 8
  %26 = alloca %"class.sim::Meters", align 8
  %27 = alloca %"class.sim::Cartesian", align 8
  %28 = alloca %"class.sim::Cartesian", align 8
  store ptr %0, ptr %9, align 8
  store ptr %1, ptr %10, align 8, !tbaa !5
  store i32 %2, ptr %11, align 4, !tbaa !9
  store i32 %3, ptr %12, align 4, !tbaa !9
  store i32 %4, ptr %13, align 4, !tbaa !9
  store i32 %5, ptr %14, align 4, !tbaa !9
  store i32 %6, ptr %15, align 4, !tbaa !9
  store i32 %7, ptr %16, align 4, !tbaa !9
  %29 = load ptr, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 80, ptr %17) #6
  %30 = getelementptr inbounds %"class.sim::TileGraphicTextCache", ptr %29, i32 0, i32 4
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %31 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  store i64 %31, ptr %19, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %32 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16)
  store i64 %32, ptr %20, align 4
  %33 = call { i64, i64 } @_ZSt9make_pairISt4pairIiiES1_ES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %19, ptr noundef nonnull align 4 dereferenceable(8) %20)
  %34 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 0
  %35 = extractvalue { i64, i64 } %33, 0
  store i64 %35, ptr %34, align 4
  %36 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 1
  %37 = extractvalue { i64, i64 } %33, 1
  store i64 %37, ptr %36, align 4
  %38 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNKSt3mapISt4pairIS0_IiiES1_ES0_IN3sim9CartesianES4_ESt4lessIS2_ESaIS0_IKS2_S5_EEE2atERS8_(ptr noundef nonnull align 8 dereferenceable(48) %30, ptr noundef nonnull align 4 dereferenceable(16) %18)
  call void @_ZNSt4pairIN3sim9CartesianES1_EC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %17, ptr noundef nonnull align 8 dereferenceable(80) %38) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #6
  %39 = getelementptr inbounds %"class.sim::TileGraphicTextCache", ptr %29, i32 0, i32 0
  %40 = getelementptr inbounds %"class.sim::TileGraphicTextCache", ptr %29, i32 0, i32 1
  invoke void @_ZNK3sim6MetersplERKNS_8DistanceE(ptr dead_on_unwind writable sret(%"class.sim::Meters") align 8 %21, ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef nonnull align 8 dereferenceable(16) %40)
          to label %41 unwind label %54

41:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 40, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #6
  %42 = load i32, ptr %11, align 4, !tbaa !9
  %43 = sitofp i32 %42 to double
  invoke void @_ZNK3sim6MetersmlEd(ptr dead_on_unwind writable sret(%"class.sim::Meters") align 8 %25, ptr noundef nonnull align 8 dereferenceable(16) %21, double noundef %43)
          to label %44 unwind label %58

44:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #6
  %45 = load i32, ptr %12, align 4, !tbaa !9
  %46 = sitofp i32 %45 to double
  invoke void @_ZNK3sim6MetersmlEd(ptr dead_on_unwind writable sret(%"class.sim::Meters") align 8 %26, ptr noundef nonnull align 8 dereferenceable(16) %21, double noundef %46)
          to label %47 unwind label %62

47:                                               ; preds = %44
  invoke void @_ZN3sim9CartesianC1ERKNS_8DistanceES3_(ptr noundef nonnull align 8 dereferenceable(40) %24, ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(16) %26)
          to label %48 unwind label %66

48:                                               ; preds = %47
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %26) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #6
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %25) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr %27) #6
  %49 = getelementptr inbounds %"struct.std::pair.36", ptr %17, i32 0, i32 0
  invoke void @_ZNK3sim9CartesianplERKNS_10CoordinateE(ptr dead_on_unwind writable sret(%"class.sim::Cartesian") align 8 %27, ptr noundef nonnull align 8 dereferenceable(40) %49, ptr noundef nonnull align 8 dereferenceable(40) %24)
          to label %50 unwind label %72

50:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 40, ptr %28) #6
  %51 = getelementptr inbounds %"struct.std::pair.36", ptr %17, i32 0, i32 1
  invoke void @_ZNK3sim9CartesianplERKNS_10CoordinateE(ptr dead_on_unwind writable sret(%"class.sim::Cartesian") align 8 %28, ptr noundef nonnull align 8 dereferenceable(40) %51, ptr noundef nonnull align 8 dereferenceable(40) %24)
          to label %52 unwind label %76

52:                                               ; preds = %50
  invoke void @_ZSt9make_pairIRN3sim9CartesianES2_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr dead_on_unwind writable sret(%"struct.std::pair.36") align 8 %0, ptr noundef nonnull align 8 dereferenceable(40) %27, ptr noundef nonnull align 8 dereferenceable(40) %28)
          to label %53 unwind label %80

53:                                               ; preds = %52
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %28) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %28) #6
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %27) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %27) #6
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %24) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %24) #6
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #6
  call void @_ZNSt4pairIN3sim9CartesianES1_ED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %17) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %17) #6
  ret void

54:                                               ; preds = %8
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %22, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %23, align 4
  br label %87

58:                                               ; preds = %41
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %22, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %23, align 4
  br label %71

62:                                               ; preds = %44
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %22, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %23, align 4
  br label %70

66:                                               ; preds = %47
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %22, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %23, align 4
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %26) #6
  br label %70

70:                                               ; preds = %66, %62
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #6
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %25) #6
  br label %71

71:                                               ; preds = %70, %58
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #6
  br label %86

72:                                               ; preds = %48
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %22, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %23, align 4
  br label %85

76:                                               ; preds = %50
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %22, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %23, align 4
  br label %84

80:                                               ; preds = %52
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %22, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %23, align 4
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %28) #6
  br label %84

84:                                               ; preds = %80, %76
  call void @llvm.lifetime.end.p0(i64 40, ptr %28) #6
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %27) #6
  br label %85

85:                                               ; preds = %84, %72
  call void @llvm.lifetime.end.p0(i64 40, ptr %27) #6
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %24) #6
  br label %86

86:                                               ; preds = %85, %71
  call void @llvm.lifetime.end.p0(i64 40, ptr %24) #6
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #6
  br label %87

87:                                               ; preds = %86, %54
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #6
  call void @_ZNSt4pairIN3sim9CartesianES1_ED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %17) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %17) #6
  br label %88

88:                                               ; preds = %87
  %89 = load ptr, ptr %22, align 8
  %90 = load i32, ptr %23, align 4
  %91 = insertvalue { ptr, i32 } poison, ptr %89, 0
  %92 = insertvalue { ptr, i32 } %91, i32 %90, 1
  resume { ptr, i32 } %92
}

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairISt4pairIiiES1_ES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIN3sim9CartesianES1_EC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

declare void @_ZNK3sim6MetersplERKNS_8DistanceE(ptr dead_on_unwind writable sret(%"class.sim::Meters") align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #4

declare void @_ZNK3sim6MetersmlEd(ptr dead_on_unwind writable sret(%"class.sim::Meters") align 8, ptr noundef nonnull align 8 dereferenceable(16), double noundef) #4

declare void @_ZN3sim9CartesianC1ERKNS_8DistanceES3_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

declare void @_ZNK3sim9CartesianplERKNS_10CoordinateE(ptr dead_on_unwind writable sret(%"class.sim::Cartesian") align 8, ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt9make_pairIRN3sim9CartesianES2_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.36") align 8, ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) #2

; Function Attrs: nounwind
declare void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIN3sim9CartesianES1_ED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { "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 #5 = { inlinehint 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 #6 = { 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}


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

%"struct.std::pair.36" = type { %"class.sim::Cartesian", %"class.sim::Cartesian" }
%"class.sim::Cartesian" = type { %"class.sim::Coordinate" }
%"class.sim::Coordinate" = type { ptr, %"class.sim::Meters", %"class.sim::Meters" }
%"class.sim::Meters" = type { %"class.sim::Distance" }
%"class.sim::Distance" = type { ptr, double }
%"struct.std::pair.38" = type { %"struct.std::pair.20", %"struct.std::pair.20" }
%"struct.std::pair.20" = type { i32, i32 }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nounwind
declare void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3sim20TileGraphicTextCache26getTileGraphicTextPositionEiiiiii(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.36") align 8 %0, ptr noundef nonnull align 8 dereferenceable(136) %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair.36", align 8
  %14 = alloca %"struct.std::pair.38", align 8
  %15 = alloca %"struct.std::pair.20", align 8
  %16 = alloca %"struct.std::pair.20", align 8
  %17 = alloca %"class.sim::Meters", align 8
  %18 = alloca %"class.sim::Cartesian", align 8
  %19 = alloca %"class.sim::Meters", align 8
  %20 = alloca %"class.sim::Meters", align 8
  %21 = alloca %"class.sim::Cartesian", align 8
  %22 = alloca %"class.sim::Cartesian", align 8
  store i32 %4, ptr %9, align 4, !tbaa !5
  store i32 %5, ptr %10, align 4, !tbaa !5
  store i32 %6, ptr %11, align 4, !tbaa !5
  store i32 %7, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %13) #6
  %23 = getelementptr inbounds i8, ptr %1, i64 88
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #6
  %24 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  store i64 %24, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #6
  %25 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  store i64 %25, ptr %16, align 8
  %26 = call { i64, i64 } @_ZSt9make_pairISt4pairIiiES1_ES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(8) %16)
  %27 = extractvalue { i64, i64 } %26, 0
  store i64 %27, ptr %14, align 8
  %28 = getelementptr inbounds i8, ptr %14, i64 8
  %29 = extractvalue { i64, i64 } %26, 1
  store i64 %29, ptr %28, align 8
  %30 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNKSt3mapISt4pairIS0_IiiES1_ES0_IN3sim9CartesianES4_ESt4lessIS2_ESaIS0_IKS2_S5_EEE2atERS8_(ptr noundef nonnull align 8 dereferenceable(48) %23, ptr noundef nonnull align 4 dereferenceable(16) %14)
  call void @_ZNSt4pairIN3sim9CartesianES1_EC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %13, ptr noundef nonnull align 8 dereferenceable(80) %30) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %17) #6
  %31 = getelementptr inbounds i8, ptr %1, i64 16
  invoke void @_ZNK3sim6MetersplERKNS_8DistanceE(ptr dead_on_unwind nonnull writable sret(%"class.sim::Meters") align 8 %17, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %31)
          to label %32 unwind label %42

32:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %18) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %19) #6
  %33 = sitofp i32 %2 to double
  invoke void @_ZNK3sim6MetersmlEd(ptr dead_on_unwind nonnull writable sret(%"class.sim::Meters") align 8 %19, ptr noundef nonnull align 8 dereferenceable(16) %17, double noundef %33)
          to label %34 unwind label %44

34:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %20) #6
  %35 = sitofp i32 %3 to double
  invoke void @_ZNK3sim6MetersmlEd(ptr dead_on_unwind nonnull writable sret(%"class.sim::Meters") align 8 %20, ptr noundef nonnull align 8 dereferenceable(16) %17, double noundef %35)
          to label %36 unwind label %46

36:                                               ; preds = %34
  invoke void @_ZN3sim9CartesianC1ERKNS_8DistanceES3_(ptr noundef nonnull align 8 dereferenceable(40) %18, ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(16) %20)
          to label %37 unwind label %48

37:                                               ; preds = %36
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #6
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %19) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %21) #6
  invoke void @_ZNK3sim9CartesianplERKNS_10CoordinateE(ptr dead_on_unwind nonnull writable sret(%"class.sim::Cartesian") align 8 %21, ptr noundef nonnull align 8 dereferenceable(40) %13, ptr noundef nonnull align 8 dereferenceable(40) %18)
          to label %38 unwind label %52

38:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %22) #6
  %39 = getelementptr inbounds i8, ptr %13, i64 40
  invoke void @_ZNK3sim9CartesianplERKNS_10CoordinateE(ptr dead_on_unwind nonnull writable sret(%"class.sim::Cartesian") align 8 %22, ptr noundef nonnull align 8 dereferenceable(40) %39, ptr noundef nonnull align 8 dereferenceable(40) %18)
          to label %40 unwind label %54

40:                                               ; preds = %38
  invoke void @_ZSt9make_pairIRN3sim9CartesianES2_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr dead_on_unwind writable sret(%"struct.std::pair.36") align 8 %0, ptr noundef nonnull align 8 dereferenceable(40) %21, ptr noundef nonnull align 8 dereferenceable(40) %22)
          to label %41 unwind label %56

41:                                               ; preds = %40
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %22) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %22) #6
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %21) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %21) #6
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %18) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %18) #6
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #6
  call void @_ZNSt4pairIN3sim9CartesianES1_ED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %13) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %13) #6
  ret void

42:                                               ; preds = %8
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %61

44:                                               ; preds = %32
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %51

46:                                               ; preds = %34
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %50

48:                                               ; preds = %36
  %49 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #6
  br label %50

50:                                               ; preds = %48, %46
  %.pn = phi { ptr, i32 } [ %49, %48 ], [ %47, %46 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #6
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #6
  br label %51

51:                                               ; preds = %50, %44
  %.pn.pn = phi { ptr, i32 } [ %.pn, %50 ], [ %45, %44 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %19) #6
  br label %60

52:                                               ; preds = %37
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %59

54:                                               ; preds = %38
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %58

56:                                               ; preds = %40
  %57 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %22) #6
  br label %58

58:                                               ; preds = %56, %54
  %.pn12 = phi { ptr, i32 } [ %57, %56 ], [ %55, %54 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %22) #6
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %21) #6
  br label %59

59:                                               ; preds = %58, %52
  %.pn12.pn = phi { ptr, i32 } [ %.pn12, %58 ], [ %53, %52 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %21) #6
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %18) #6
  br label %60

60:                                               ; preds = %59, %51
  %.pn12.pn.pn = phi { ptr, i32 } [ %.pn12.pn, %59 ], [ %.pn.pn, %51 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %18) #6
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #6
  br label %61

61:                                               ; preds = %60, %42
  %.pn12.pn.pn.pn = phi { ptr, i32 } [ %.pn12.pn.pn, %60 ], [ %43, %42 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #6
  call void @_ZNSt4pairIN3sim9CartesianES1_ED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %13) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %13) #6
  resume { ptr, i32 } %.pn12.pn.pn.pn
}

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairISt4pairIiiES1_ES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIN3sim9CartesianES1_EC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

declare void @_ZNK3sim6MetersplERKNS_8DistanceE(ptr dead_on_unwind writable sret(%"class.sim::Meters") align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4

declare void @_ZNK3sim6MetersmlEd(ptr dead_on_unwind writable sret(%"class.sim::Meters") align 8, ptr noundef nonnull align 8 dereferenceable(16), double noundef) local_unnamed_addr #4

declare void @_ZN3sim9CartesianC1ERKNS_8DistanceES3_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

declare void @_ZNK3sim9CartesianplERKNS_10CoordinateE(ptr dead_on_unwind writable sret(%"class.sim::Cartesian") align 8, ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt9make_pairIRN3sim9CartesianES2_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.36") align 8, ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIN3sim9CartesianES1_ED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { "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 #5 = { inlinehint 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 #6 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass