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

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.sim::Meters" = type { %"class.sim::Distance" }
%"class.sim::Distance" = type { ptr, double }
%"class.sim::Cartesian" = type { %"class.sim::Coordinate" }
%"class.sim::Coordinate" = type { ptr, %"class.sim::Meters", %"class.sim::Meters" }
%"class.sim::MouseInterface" = type { ptr, ptr, ptr, ptr, %"class.std::set.221", %"struct.sim::StaticMouseAlgorithmOptions", i8, %"class.std::set.226", %"class.std::set.226" }
%"class.std::set.221" = type { %"class.std::_Rb_tree.222" }
%"class.std::_Rb_tree.222" = type { %"struct.std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.sim::StaticMouseAlgorithmOptions" = type { %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i32, i32, double }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::set.226" = type { %"class.std::_Rb_tree.227" }
%"class.std::_Rb_tree.227" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }

@__dso_handle = external hidden global i8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.105 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.106 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.107 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.108 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.109 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.110 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.111 = external hidden unnamed_addr constant [40 x i8], align 1
@_ZZNK3sim14MouseInterface15getCenterOfTileEiiE10tileLength = external hidden global %"class.sim::Meters", align 8
@_ZGVZNK3sim14MouseInterface15getCenterOfTileEiiE10tileLength = external hidden global i64, align 8

; Function Attrs: nounwind
declare i32 @__cxa_atexit(ptr, ptr, ptr) #0

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

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) #1

declare noundef ptr @_ZN3sim1PEv() #2

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

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

; Function Attrs: nounwind
declare i32 @__cxa_guard_acquire(ptr) #0

declare noundef double @_ZN3sim5Param10wallLengthEv(ptr noundef nonnull align 8 dereferenceable(1056)) #2

declare noundef double @_ZN3sim5Param9wallWidthEv(ptr noundef nonnull align 8 dereferenceable(1056)) #2

declare void @_ZN3sim6MetersC1Ed(ptr noundef nonnull align 8 dereferenceable(16), double noundef) unnamed_addr #2

; Function Attrs: nounwind
declare void @__cxa_guard_abort(ptr) #0

; Function Attrs: nounwind
declare void @__cxa_guard_release(ptr) #0

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #6

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3sim14MouseInterface15getCenterOfTileEii(ptr dead_on_unwind noalias writable sret(%"class.sim::Cartesian") align 8 %0, ptr noundef nonnull align 8 dereferenceable(296) %1, i32 noundef %2, i32 noundef %3) #5 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i1, align 1
  %12 = alloca %"class.sim::Meters", align 8
  %13 = alloca %"class.sim::Meters", align 8
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  %14 = load ptr, ptr %6, align 8
  %15 = getelementptr inbounds %"class.sim::MouseInterface", ptr %14, i32 0, i32 0
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = load i32, ptr %7, align 4, !tbaa !9
  %18 = load i32, ptr %8, align 4, !tbaa !9
  %19 = call noundef zeroext i1 @_ZNK3sim4Maze10withinMazeEii(ptr noundef nonnull align 8 dereferenceable(26) %16, i32 noundef %17, i32 noundef %18)
  br i1 %19, label %34, label %20

20:                                               ; preds = %4
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.105)
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef @.str.106)
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef @.str.107)
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef @.str.108)
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %26, i32 noundef 1022)
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef @.str.109)
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef @.str.110)
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef @.str.111)
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @exit(i32 noundef 1) #7
  unreachable

34:                                               ; preds = %4
  %35 = load atomic i8, ptr @_ZGVZNK3sim14MouseInterface15getCenterOfTileEiiE10tileLength acquire, align 8
  %36 = icmp eq i8 %35, 0
  br i1 %36, label %37, label %52, !prof !32

37:                                               ; preds = %34
  %38 = call i32 @__cxa_guard_acquire(ptr @_ZGVZNK3sim14MouseInterface15getCenterOfTileEiiE10tileLength) #0
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %52

40:                                               ; preds = %37
  %41 = invoke noundef ptr @_ZN3sim1PEv()
          to label %42 unwind label %62

42:                                               ; preds = %40
  %43 = invoke noundef double @_ZN3sim5Param10wallLengthEv(ptr noundef nonnull align 8 dereferenceable(1056) %41)
          to label %44 unwind label %62

44:                                               ; preds = %42
  %45 = invoke noundef ptr @_ZN3sim1PEv()
          to label %46 unwind label %62

46:                                               ; preds = %44
  %47 = invoke noundef double @_ZN3sim5Param9wallWidthEv(ptr noundef nonnull align 8 dereferenceable(1056) %45)
          to label %48 unwind label %62

48:                                               ; preds = %46
  %49 = fadd double %43, %47
  invoke void @_ZN3sim6MetersC1Ed(ptr noundef nonnull align 8 dereferenceable(16) @_ZZNK3sim14MouseInterface15getCenterOfTileEiiE10tileLength, double noundef %49)
          to label %50 unwind label %62

50:                                               ; preds = %48
  %51 = call i32 @__cxa_atexit(ptr @_ZN3sim8DistanceD2Ev, ptr @_ZZNK3sim14MouseInterface15getCenterOfTileEiiE10tileLength, ptr @__dso_handle) #0
  call void @__cxa_guard_release(ptr @_ZGVZNK3sim14MouseInterface15getCenterOfTileEiiE10tileLength) #0
  br label %52

52:                                               ; preds = %50, %37, %34
  store i1 false, ptr %11, align 1
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #0
  %53 = load i32, ptr %7, align 4, !tbaa !9
  %54 = sitofp i32 %53 to double
  %55 = fadd double %54, 5.000000e-01
  call void @_ZNK3sim6MetersmlEd(ptr dead_on_unwind writable sret(%"class.sim::Meters") align 8 %12, ptr noundef nonnull align 8 dereferenceable(16) @_ZZNK3sim14MouseInterface15getCenterOfTileEiiE10tileLength, double noundef %55)
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #0
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = sitofp i32 %56 to double
  %58 = fadd double %57, 5.000000e-01
  invoke void @_ZNK3sim6MetersmlEd(ptr dead_on_unwind writable sret(%"class.sim::Meters") align 8 %13, ptr noundef nonnull align 8 dereferenceable(16) @_ZZNK3sim14MouseInterface15getCenterOfTileEiiE10tileLength, double noundef %58)
          to label %59 unwind label %66

59:                                               ; preds = %52
  invoke void @_ZN3sim9CartesianC1ERKNS_8DistanceES3_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %13)
          to label %60 unwind label %70

60:                                               ; preds = %59
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #0
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #0
  store i1 true, ptr %11, align 1
  %61 = load i1, ptr %11, align 1
  br i1 %61, label %76, label %75

62:                                               ; preds = %48, %46, %44, %42, %40
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %9, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %10, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZNK3sim14MouseInterface15getCenterOfTileEiiE10tileLength) #0
  br label %77

66:                                               ; preds = %52
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %9, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %10, align 4
  br label %74

70:                                               ; preds = %59
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %9, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %10, align 4
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #0
  br label %74

74:                                               ; preds = %70, %66
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #0
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #0
  br label %77

75:                                               ; preds = %60
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %0) #0
  br label %76

76:                                               ; preds = %75, %60
  ret void

77:                                               ; preds = %74, %62
  %78 = load ptr, ptr %9, align 8
  %79 = load i32, ptr %10, align 4
  %80 = insertvalue { ptr, i32 } poison, ptr %78, 0
  %81 = insertvalue { ptr, i32 } %80, i32 %79, 1
  resume { ptr, i32 } %81
}

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

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 #2

attributes #0 = { nounwind }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { noreturn 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 #7 = { noreturn 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, !6, i64 0}
!12 = !{!"_ZTSN3sim14MouseInterfaceE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !13, i64 32, !22, i64 80, !26, i64 192, !27, i64 200, !27, i64 248}
!13 = !{!"_ZTSSt3setIcSt4lessIcESaIcEE", !14, i64 0}
!14 = !{!"_ZTSSt8_Rb_treeIccSt9_IdentityIcESt4lessIcESaIcEE", !15, i64 0}
!15 = !{!"_ZTSNSt8_Rb_treeIccSt9_IdentityIcESt4lessIcESaIcEE13_Rb_tree_implIS3_Lb1EEE", !16, i64 0, !18, i64 8}
!16 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIcEE", !17, i64 0}
!17 = !{!"_ZTSSt4lessIcE"}
!18 = !{!"_ZTSSt15_Rb_tree_header", !19, i64 0, !21, i64 32}
!19 = !{!"_ZTSSt18_Rb_tree_node_base", !20, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!20 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTSN3sim27StaticMouseAlgorithmOptionsE", !23, i64 0, !23, i64 32, !23, i64 64, !10, i64 96, !10, i64 100, !25, i64 104}
!23 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !24, i64 0, !21, i64 8, !7, i64 16}
!24 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!25 = !{!"double", !7, i64 0}
!26 = !{!"bool", !7, i64 0}
!27 = !{!"_ZTSSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE", !28, i64 0}
!28 = !{!"_ZTSSt8_Rb_treeISt4pairIiiES1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSNSt8_Rb_treeISt4pairIiiES1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE13_Rb_tree_implIS5_Lb1EEE", !30, i64 0, !18, i64 8}
!30 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessISt4pairIiiEEE", !31, i64 0}
!31 = !{!"_ZTSSt4lessISt4pairIiiEE"}
!32 = !{!"branch_weights", i32 1, i32 1048575}


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.sim::Meters" = type { %"class.sim::Distance" }
%"class.sim::Distance" = type { ptr, double }
%"class.sim::Cartesian" = type { %"class.sim::Coordinate" }
%"class.sim::Coordinate" = type { ptr, %"class.sim::Meters", %"class.sim::Meters" }

@__dso_handle = external hidden global i8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.105 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.106 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.107 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.108 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.109 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.110 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.111 = external hidden unnamed_addr constant [40 x i8], align 1
@_ZZNK3sim14MouseInterface15getCenterOfTileEiiE10tileLength = external hidden global %"class.sim::Meters", align 8
@_ZGVZNK3sim14MouseInterface15getCenterOfTileEiiE10tileLength = external hidden global i64, align 8

; Function Attrs: nofree nounwind
declare i32 @__cxa_atexit(ptr, ptr, ptr) local_unnamed_addr #0

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

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) #1

declare noundef ptr @_ZN3sim1PEv() local_unnamed_addr #2

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

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

; Function Attrs: nofree nounwind
declare i32 @__cxa_guard_acquire(ptr) local_unnamed_addr #0

declare noundef double @_ZN3sim5Param10wallLengthEv(ptr noundef nonnull align 8 dereferenceable(1056)) local_unnamed_addr #2

declare noundef double @_ZN3sim5Param9wallWidthEv(ptr noundef nonnull align 8 dereferenceable(1056)) local_unnamed_addr #2

declare void @_ZN3sim6MetersC1Ed(ptr noundef nonnull align 8 dereferenceable(16), double noundef) unnamed_addr #2

; Function Attrs: nofree nounwind
declare void @__cxa_guard_abort(ptr) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare void @__cxa_guard_release(ptr) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3sim14MouseInterface15getCenterOfTileEii(ptr dead_on_unwind noalias writable sret(%"class.sim::Cartesian") align 8 %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(296) %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.sim::Meters", align 8
  %6 = alloca %"class.sim::Meters", align 8
  %7 = load ptr, ptr %1, align 8, !tbaa !5
  %8 = tail call noundef zeroext i1 @_ZNK3sim4Maze10withinMazeEii(ptr noundef nonnull align 8 dereferenceable(26) %7, i32 noundef %2, i32 noundef %3)
  br i1 %8, label %23, label %9

9:                                                ; preds = %4
  %10 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.105)
  %11 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %12 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull @.str.106)
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull @.str.107)
  %14 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %15 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull @.str.108)
  %16 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %15, i32 noundef 1022)
  %17 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %18 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull @.str.109)
  %19 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull @.str.110)
  %20 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %21 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull @.str.111)
  %22 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  tail call void @exit(i32 noundef 1) #7
  unreachable

23:                                               ; preds = %4
  %24 = load atomic i8, ptr @_ZGVZNK3sim14MouseInterface15getCenterOfTileEiiE10tileLength acquire, align 8
  %25 = icmp eq i8 %24, 0
  br i1 %25, label %26, label %40, !prof !30

26:                                               ; preds = %23
  %27 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZNK3sim14MouseInterface15getCenterOfTileEiiE10tileLength) #8
  %.not = icmp eq i32 %27, 0
  br i1 %.not, label %40, label %28

28:                                               ; preds = %26
  %29 = invoke noundef ptr @_ZN3sim1PEv()
          to label %30 unwind label %47

30:                                               ; preds = %28
  %31 = invoke noundef double @_ZN3sim5Param10wallLengthEv(ptr noundef nonnull align 8 dereferenceable(1056) %29)
          to label %32 unwind label %47

32:                                               ; preds = %30
  %33 = invoke noundef ptr @_ZN3sim1PEv()
          to label %34 unwind label %47

34:                                               ; preds = %32
  %35 = invoke noundef double @_ZN3sim5Param9wallWidthEv(ptr noundef nonnull align 8 dereferenceable(1056) %33)
          to label %36 unwind label %47

36:                                               ; preds = %34
  %37 = fadd double %31, %35
  invoke void @_ZN3sim6MetersC1Ed(ptr noundef nonnull align 8 dereferenceable(16) @_ZZNK3sim14MouseInterface15getCenterOfTileEiiE10tileLength, double noundef %37)
          to label %38 unwind label %47

38:                                               ; preds = %36
  %39 = tail call i32 @__cxa_atexit(ptr nonnull @_ZN3sim8DistanceD2Ev, ptr nonnull @_ZZNK3sim14MouseInterface15getCenterOfTileEiiE10tileLength, ptr nonnull @__dso_handle) #8
  tail call void @__cxa_guard_release(ptr nonnull @_ZGVZNK3sim14MouseInterface15getCenterOfTileEiiE10tileLength) #8
  br label %40

40:                                               ; preds = %38, %26, %23
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #8
  %41 = sitofp i32 %2 to double
  %42 = fadd double %41, 5.000000e-01
  call void @_ZNK3sim6MetersmlEd(ptr dead_on_unwind nonnull writable sret(%"class.sim::Meters") align 8 %5, ptr noundef nonnull align 8 dereferenceable(16) @_ZZNK3sim14MouseInterface15getCenterOfTileEiiE10tileLength, double noundef %42)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #8
  %43 = sitofp i32 %3 to double
  %44 = fadd double %43, 5.000000e-01
  invoke void @_ZNK3sim6MetersmlEd(ptr dead_on_unwind nonnull writable sret(%"class.sim::Meters") align 8 %6, ptr noundef nonnull align 8 dereferenceable(16) @_ZZNK3sim14MouseInterface15getCenterOfTileEiiE10tileLength, double noundef %44)
          to label %45 unwind label %49

45:                                               ; preds = %40
  invoke void @_ZN3sim9CartesianC1ERKNS_8DistanceES3_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %46 unwind label %51

46:                                               ; preds = %45
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #8
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  ret void

47:                                               ; preds = %36, %34, %32, %30, %28
  %48 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_guard_abort(ptr nonnull @_ZGVZNK3sim14MouseInterface15getCenterOfTileEiiE10tileLength) #8
  br label %54

49:                                               ; preds = %40
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %53

51:                                               ; preds = %45
  %52 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #8
  br label %53

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

54:                                               ; preds = %53, %47
  %.pn.pn = phi { ptr, i32 } [ %.pn, %53 ], [ %48, %47 ]
  resume { ptr, i32 } %.pn.pn
}

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 #2

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 #2

attributes #0 = { nofree nounwind }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { noreturn 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 #7 = { noreturn nounwind }
attributes #8 = { 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, !7, i64 0}
!6 = !{!"_ZTSN3sim14MouseInterfaceE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !19, i64 80, !24, i64 192, !25, i64 200, !25, i64 248}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt3setIcSt4lessIcESaIcEE", !11, i64 0}
!11 = !{!"_ZTSSt8_Rb_treeIccSt9_IdentityIcESt4lessIcESaIcEE", !12, i64 0}
!12 = !{!"_ZTSNSt8_Rb_treeIccSt9_IdentityIcESt4lessIcESaIcEE13_Rb_tree_implIS3_Lb1EEE", !13, i64 0, !15, i64 8}
!13 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIcEE", !14, i64 0}
!14 = !{!"_ZTSSt4lessIcE"}
!15 = !{!"_ZTSSt15_Rb_tree_header", !16, i64 0, !18, i64 32}
!16 = !{!"_ZTSSt18_Rb_tree_node_base", !17, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!17 = !{!"_ZTSSt14_Rb_tree_color", !8, i64 0}
!18 = !{!"long", !8, i64 0}
!19 = !{!"_ZTSN3sim27StaticMouseAlgorithmOptionsE", !20, i64 0, !20, i64 32, !20, i64 64, !22, i64 96, !22, i64 100, !23, i64 104}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !21, i64 0, !18, i64 8, !8, i64 16}
!21 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !7, i64 0}
!22 = !{!"int", !8, i64 0}
!23 = !{!"double", !8, i64 0}
!24 = !{!"bool", !8, i64 0}
!25 = !{!"_ZTSSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE", !26, i64 0}
!26 = !{!"_ZTSSt8_Rb_treeISt4pairIiiES1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE", !27, i64 0}
!27 = !{!"_ZTSNSt8_Rb_treeISt4pairIiiES1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE13_Rb_tree_implIS5_Lb1EEE", !28, i64 0, !15, i64 8}
!28 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessISt4pairIiiEEE", !29, i64 0}
!29 = !{!"_ZTSSt4lessISt4pairIiiEE"}
!30 = !{!"branch_weights", i32 1, i32 1048575}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass