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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.sim::Meters" = type { %"class.sim::Distance" }
%"class.sim::Distance" = type { ptr, double }
%"class.sim::MetersSquared" = type { %"class.sim::Area" }
%"class.sim::Area" = type { ptr, double }
%"class.sim::Cartesian" = type { %"class.sim::Coordinate" }
%"class.sim::Coordinate" = type { ptr, %"class.sim::Meters", %"class.sim::Meters" }
%"class.sim::Polar" = type { %"class.sim::Coordinate" }
%"class.sim::Radians" = type { %"class.sim::Angle" }
%"class.sim::Angle" = type { ptr, double }
%"class.sim::Degrees" = type { %"class.sim::Angle" }
%"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
@.str.122 = external hidden unnamed_addr constant [256 x i8], align 1
@.str.123 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.124 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.125 = external hidden unnamed_addr constant [316 x i8], align 1
@_ZZN3sim14MouseInterface10doDiagonalEibbE13halfTileWidth = external hidden global %"class.sim::Meters", align 8
@_ZGVZN3sim14MouseInterface10doDiagonalEibbE13halfTileWidth = external hidden global i64, align 8
@_ZZN3sim14MouseInterface10doDiagonalEibbE16halfTileDiagonal = external hidden global %"class.sim::Meters", align 8
@_ZGVZN3sim14MouseInterface10doDiagonalEibbE16halfTileDiagonal = 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 void @_ZN3sim7DegreesC1Ed(ptr noundef nonnull align 8 dereferenceable(16), double noundef) unnamed_addr #2

declare noundef ptr @_ZN3sim1PEv() #2

declare noundef ptr @_ZN3sim1LEv() #2

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

declare noundef ptr @_ZN3sim1SEv() #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3sim14MouseInterface10doDiagonalEibb(ptr noundef nonnull align 8 dereferenceable(296) %0, i32 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3) #4 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"class.sim::Meters", align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca %"class.sim::MetersSquared", align 8
  %17 = alloca %"class.sim::Cartesian", align 8
  %18 = alloca %"class.sim::Cartesian", align 8
  %19 = alloca %"class.sim::Polar", align 8
  %20 = alloca %"class.sim::Meters", align 8
  %21 = alloca %"class.sim::Radians", align 8
  %22 = alloca %"class.sim::Radians", align 8
  %23 = alloca %"class.sim::Degrees", align 8
  %24 = alloca %"class.sim::Cartesian", align 8
  %25 = alloca %"class.sim::Polar", align 8
  %26 = alloca %"class.sim::Meters", align 8
  %27 = alloca %"class.sim::Radians", align 8
  %28 = alloca %"class.sim::Radians", align 8
  %29 = alloca %"class.sim::Degrees", align 8
  %30 = alloca %"class.sim::Degrees", align 8
  %31 = alloca %"class.sim::Polar", align 8
  %32 = alloca %"class.sim::Cartesian", align 8
  %33 = alloca %"class.sim::Cartesian", align 8
  %34 = alloca %"class.sim::Radians", align 8
  %35 = alloca %"class.sim::Degrees", align 8
  %36 = alloca %"class.sim::Degrees", align 8
  %37 = alloca %"class.sim::Cartesian", align 8
  %38 = alloca %"class.sim::Radians", align 8
  %39 = alloca %"class.sim::Radians", align 8
  %40 = alloca %"class.sim::Cartesian", align 8
  %41 = alloca %"class.sim::Cartesian", align 8
  %42 = alloca %"class.sim::Polar", align 8
  %43 = alloca %"class.sim::Meters", align 8
  %44 = alloca %"class.sim::Radians", align 8
  %45 = alloca %"class.sim::Radians", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  %46 = zext i1 %2 to i8
  store i8 %46, ptr %7, align 1, !tbaa !11
  %47 = zext i1 %3 to i8
  store i8 %47, ptr %8, align 1, !tbaa !11
  %48 = load ptr, ptr %5, align 8
  %49 = call noundef ptr @_ZN3sim1SEv()
  %50 = call noundef zeroext i1 @_ZN3sim5State7crashedEv(ptr noundef nonnull align 8 dereferenceable(168) %49)
  br i1 %50, label %51, label %52

51:                                               ; preds = %4
  br label %399

52:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #0
  store i8 0, ptr %9, align 1, !tbaa !11
  %53 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %54 = trunc i8 %53 to i1
  %55 = zext i1 %54 to i32
  %56 = load i8, ptr %8, align 1, !tbaa !11, !range !13, !noundef !14
  %57 = trunc i8 %56 to i1
  %58 = zext i1 %57 to i32
  %59 = icmp eq i32 %55, %58
  br i1 %59, label %60, label %71

60:                                               ; preds = %52
  %61 = load i32, ptr %6, align 4, !tbaa !9
  %62 = srem i32 %61, 2
  %63 = icmp ne i32 %62, 1
  br i1 %63, label %64, label %70

64:                                               ; preds = %60
  %65 = call noundef ptr @_ZN3sim1LEv()
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #0
  %66 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %67 = trunc i8 %66 to i1
  %68 = zext i1 %67 to i64
  %69 = select i1 %67, ptr @.str.123, ptr @.str.124
  store ptr %69, ptr %10, align 8, !tbaa !5
  call void @_ZN2el6Logger4warnIPKcJiEEEvS3_RKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728) %65, ptr noundef @.str.122, ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #0
  store i8 1, ptr %9, align 1, !tbaa !11
  br label %70

70:                                               ; preds = %64, %60
  br label %86

71:                                               ; preds = %52
  %72 = load i32, ptr %6, align 4, !tbaa !9
  %73 = srem i32 %72, 2
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %85

75:                                               ; preds = %71
  %76 = call noundef ptr @_ZN3sim1LEv()
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #0
  %77 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %78 = trunc i8 %77 to i1
  %79 = zext i1 %78 to i64
  %80 = select i1 %78, ptr @.str.123, ptr @.str.124
  store ptr %80, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #0
  %81 = load i8, ptr %8, align 1, !tbaa !11, !range !13, !noundef !14
  %82 = trunc i8 %81 to i1
  %83 = zext i1 %82 to i64
  %84 = select i1 %82, ptr @.str.123, ptr @.str.124
  store ptr %84, ptr %12, align 8, !tbaa !5
  call void @_ZN2el6Logger4warnIPKcJS3_iEEEvS3_RKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728) %76, ptr noundef @.str.125, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #0
  store i8 1, ptr %9, align 1, !tbaa !11
  br label %85

85:                                               ; preds = %75, %71
  br label %86

86:                                               ; preds = %85, %70
  %87 = load atomic i8, ptr @_ZGVZN3sim14MouseInterface10doDiagonalEibbE13halfTileWidth acquire, align 8
  %88 = icmp eq i8 %87, 0
  br i1 %88, label %89, label %105, !prof !15

89:                                               ; preds = %86
  %90 = call i32 @__cxa_guard_acquire(ptr @_ZGVZN3sim14MouseInterface10doDiagonalEibbE13halfTileWidth) #0
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %105

92:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #0
  %93 = invoke noundef ptr @_ZN3sim1PEv()
          to label %94 unwind label %167

94:                                               ; preds = %92
  %95 = invoke noundef double @_ZN3sim5Param10wallLengthEv(ptr noundef nonnull align 8 dereferenceable(1056) %93)
          to label %96 unwind label %167

96:                                               ; preds = %94
  %97 = invoke noundef ptr @_ZN3sim1PEv()
          to label %98 unwind label %167

98:                                               ; preds = %96
  %99 = invoke noundef double @_ZN3sim5Param9wallWidthEv(ptr noundef nonnull align 8 dereferenceable(1056) %97)
          to label %100 unwind label %167

100:                                              ; preds = %98
  %101 = fadd double %95, %99
  invoke void @_ZN3sim6MetersC1Ed(ptr noundef nonnull align 8 dereferenceable(16) %13, double noundef %101)
          to label %102 unwind label %167

102:                                              ; preds = %100
  invoke void @_ZNK3sim6MetersdvEd(ptr dead_on_unwind writable sret(%"class.sim::Meters") align 8 @_ZZN3sim14MouseInterface10doDiagonalEibbE13halfTileWidth, ptr noundef nonnull align 8 dereferenceable(16) %13, double noundef 2.000000e+00)
          to label %103 unwind label %171

103:                                              ; preds = %102
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #0
  %104 = call i32 @__cxa_atexit(ptr @_ZN3sim8DistanceD2Ev, ptr @_ZZN3sim14MouseInterface10doDiagonalEibbE13halfTileWidth, ptr @__dso_handle) #0
  call void @__cxa_guard_release(ptr @_ZGVZN3sim14MouseInterface10doDiagonalEibbE13halfTileWidth) #0
  br label %105

105:                                              ; preds = %103, %89, %86
  %106 = load atomic i8, ptr @_ZGVZN3sim14MouseInterface10doDiagonalEibbE16halfTileDiagonal acquire, align 8
  %107 = icmp eq i8 %106, 0
  br i1 %107, label %108, label %119, !prof !15

108:                                              ; preds = %105
  %109 = call i32 @__cxa_guard_acquire(ptr @_ZGVZN3sim14MouseInterface10doDiagonalEibbE16halfTileDiagonal) #0
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %111, label %119

111:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #0
  invoke void @_ZNK3sim6MetersmlERKNS_8DistanceE(ptr dead_on_unwind writable sret(%"class.sim::MetersSquared") align 8 %16, ptr noundef nonnull align 8 dereferenceable(16) @_ZZN3sim14MouseInterface10doDiagonalEibbE13halfTileWidth, ptr noundef nonnull align 8 dereferenceable(16) @_ZZN3sim14MouseInterface10doDiagonalEibbE13halfTileWidth)
          to label %112 unwind label %176

112:                                              ; preds = %111
  %113 = invoke noundef double @_ZNK3sim4Area16getMetersSquaredEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %114 unwind label %180

114:                                              ; preds = %112
  %115 = fmul double 2.000000e+00, %113
  %116 = call double @sqrt(double noundef %115) #0
  invoke void @_ZN3sim6MetersC1Ed(ptr noundef nonnull align 8 dereferenceable(16) @_ZZN3sim14MouseInterface10doDiagonalEibbE16halfTileDiagonal, double noundef %116)
          to label %117 unwind label %180

117:                                              ; preds = %114
  call void @_ZN3sim4AreaD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #0
  %118 = call i32 @__cxa_atexit(ptr @_ZN3sim8DistanceD2Ev, ptr @_ZZN3sim14MouseInterface10doDiagonalEibbE16halfTileDiagonal, ptr @__dso_handle) #0
  call void @__cxa_guard_release(ptr @_ZGVZN3sim14MouseInterface10doDiagonalEibbE16halfTileDiagonal) #0
  br label %119

119:                                              ; preds = %117, %108, %105
  call void @llvm.lifetime.start.p0(i64 40, ptr %17) #0
  call void @llvm.lifetime.start.p0(i64 40, ptr %18) #0
  %120 = getelementptr inbounds %"class.sim::MouseInterface", ptr %48, i32 0, i32 1
  %121 = load ptr, ptr %120, align 8, !tbaa !16
  call void @_ZNK3sim5Mouse21getCurrentTranslationEv(ptr dead_on_unwind writable sret(%"class.sim::Cartesian") align 8 %18, ptr noundef nonnull align 8 dereferenceable(528) %121)
  call void @llvm.lifetime.start.p0(i64 40, ptr %19) #0
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #0
  %122 = invoke noundef ptr @_ZN3sim1PEv()
          to label %123 unwind label %185

123:                                              ; preds = %119
  %124 = invoke noundef double @_ZN3sim5Param9wallWidthEv(ptr noundef nonnull align 8 dereferenceable(1056) %122)
          to label %125 unwind label %185

125:                                              ; preds = %123
  %126 = fdiv double %124, 2.000000e+00
  invoke void @_ZN3sim6MetersC1Ed(ptr noundef nonnull align 8 dereferenceable(16) %20, double noundef %126)
          to label %127 unwind label %185

127:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #0
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #0
  %128 = getelementptr inbounds %"class.sim::MouseInterface", ptr %48, i32 0, i32 1
  %129 = load ptr, ptr %128, align 8, !tbaa !16
  invoke void @_ZNK3sim5Mouse18getCurrentRotationEv(ptr dead_on_unwind writable sret(%"class.sim::Radians") align 8 %22, ptr noundef nonnull align 8 dereferenceable(528) %129)
          to label %130 unwind label %189

130:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #0
  invoke void @_ZN3sim7DegreesC1Ed(ptr noundef nonnull align 8 dereferenceable(16) %23, double noundef 1.800000e+02)
          to label %131 unwind label %193

131:                                              ; preds = %130
  invoke void @_ZNK3sim7RadiansplERKNS_5AngleE(ptr dead_on_unwind writable sret(%"class.sim::Radians") align 8 %21, ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(16) %23)
          to label %132 unwind label %197

132:                                              ; preds = %131
  invoke void @_ZN3sim5PolarC1ERKNS_8DistanceERKNS_5AngleE(ptr noundef nonnull align 8 dereferenceable(40) %19, ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(16) %21)
          to label %133 unwind label %201

133:                                              ; preds = %132
  invoke void @_ZNK3sim9CartesianplERKNS_10CoordinateE(ptr dead_on_unwind writable sret(%"class.sim::Cartesian") align 8 %17, ptr noundef nonnull align 8 dereferenceable(40) %18, ptr noundef nonnull align 8 dereferenceable(40) %19)
          to label %134 unwind label %205

134:                                              ; preds = %133
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %19) #0
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #0
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %23) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #0
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %22) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #0
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %19) #0
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %18) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %18) #0
  call void @llvm.lifetime.start.p0(i64 40, ptr %24) #0
  call void @llvm.lifetime.start.p0(i64 40, ptr %25) #0
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #0
  %135 = load i32, ptr %6, align 4, !tbaa !9
  %136 = sitofp i32 %135 to double
  invoke void @_ZNK3sim6MetersmlEd(ptr dead_on_unwind writable sret(%"class.sim::Meters") align 8 %26, ptr noundef nonnull align 8 dereferenceable(16) @_ZZN3sim14MouseInterface10doDiagonalEibbE16halfTileDiagonal, double noundef %136)
          to label %137 unwind label %214

137:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 16, ptr %27) #0
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #0
  %138 = getelementptr inbounds %"class.sim::MouseInterface", ptr %48, i32 0, i32 1
  %139 = load ptr, ptr %138, align 8, !tbaa !16
  invoke void @_ZNK3sim5Mouse18getCurrentRotationEv(ptr dead_on_unwind writable sret(%"class.sim::Radians") align 8 %28, ptr noundef nonnull align 8 dereferenceable(528) %139)
          to label %140 unwind label %218

140:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #0
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #0
  invoke void @_ZN3sim7DegreesC1Ed(ptr noundef nonnull align 8 dereferenceable(16) %30, double noundef 4.500000e+01)
          to label %141 unwind label %222

141:                                              ; preds = %140
  %142 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %143 = trunc i8 %142 to i1
  %144 = zext i1 %143 to i64
  %145 = select i1 %143, i32 1, i32 -1
  %146 = sitofp i32 %145 to double
  invoke void @_ZNK3sim7DegreesmlEd(ptr dead_on_unwind writable sret(%"class.sim::Degrees") align 8 %29, ptr noundef nonnull align 8 dereferenceable(16) %30, double noundef %146)
          to label %147 unwind label %226

147:                                              ; preds = %141
  invoke void @_ZNK3sim7RadiansplERKNS_5AngleE(ptr dead_on_unwind writable sret(%"class.sim::Radians") align 8 %27, ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(16) %29)
          to label %148 unwind label %230

148:                                              ; preds = %147
  invoke void @_ZN3sim5PolarC1ERKNS_8DistanceERKNS_5AngleE(ptr noundef nonnull align 8 dereferenceable(40) %25, ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(16) %27)
          to label %149 unwind label %234

149:                                              ; preds = %148
  invoke void @_ZNK3sim9CartesianplERKNS_10CoordinateE(ptr dead_on_unwind writable sret(%"class.sim::Cartesian") align 8 %24, ptr noundef nonnull align 8 dereferenceable(40) %17, ptr noundef nonnull align 8 dereferenceable(40) %25)
          to label %150 unwind label %238

150:                                              ; preds = %149
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %25) #0
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %27) #0
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %29) #0
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %30) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #0
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %28) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #0
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %26) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %25) #0
  call void @llvm.lifetime.start.p0(i64 40, ptr %31) #0
  call void @llvm.lifetime.start.p0(i64 40, ptr %32) #0
  call void @llvm.lifetime.start.p0(i64 40, ptr %33) #0
  %151 = getelementptr inbounds %"class.sim::MouseInterface", ptr %48, i32 0, i32 1
  %152 = load ptr, ptr %151, align 8, !tbaa !16
  invoke void @_ZNK3sim5Mouse21getCurrentTranslationEv(ptr dead_on_unwind writable sret(%"class.sim::Cartesian") align 8 %33, ptr noundef nonnull align 8 dereferenceable(528) %152)
          to label %153 unwind label %248

153:                                              ; preds = %150
  invoke void @_ZNK3sim9CartesianmiERKNS_10CoordinateE(ptr dead_on_unwind writable sret(%"class.sim::Cartesian") align 8 %32, ptr noundef nonnull align 8 dereferenceable(40) %24, ptr noundef nonnull align 8 dereferenceable(40) %33)
          to label %154 unwind label %252

154:                                              ; preds = %153
  invoke void @_ZN3sim5PolarC1ERKNS_10CoordinateE(ptr noundef nonnull align 8 dereferenceable(40) %31, ptr noundef nonnull align 8 dereferenceable(40) %32)
          to label %155 unwind label %256

155:                                              ; preds = %154
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %32) #0
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %33) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %33) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %32) #0
  call void @llvm.lifetime.start.p0(i64 16, ptr %34) #0
  %156 = getelementptr inbounds %"class.sim::MouseInterface", ptr %48, i32 0, i32 1
  %157 = load ptr, ptr %156, align 8, !tbaa !16
  invoke void @_ZNK3sim5Mouse18getCurrentRotationEv(ptr dead_on_unwind writable sret(%"class.sim::Radians") align 8 %34, ptr noundef nonnull align 8 dereferenceable(528) %157)
          to label %158 unwind label %262

158:                                              ; preds = %155
  %159 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %160 = trunc i8 %159 to i1
  br i1 %160, label %161, label %275

161:                                              ; preds = %158
  %162 = load i8, ptr %8, align 1, !tbaa !11, !range !13, !noundef !14
  %163 = trunc i8 %162 to i1
  br i1 %163, label %164, label %275

164:                                              ; preds = %161
  call void @llvm.lifetime.start.p0(i64 16, ptr %35) #0
  invoke void @_ZN3sim7DegreesC1Ed(ptr noundef nonnull align 8 dereferenceable(16) %35, double noundef 9.000000e+01)
          to label %165 unwind label %266

165:                                              ; preds = %164
  invoke void @_ZN3sim7RadianspLERKNS_5AngleE(ptr noundef nonnull align 8 dereferenceable(16) %34, ptr noundef nonnull align 8 dereferenceable(16) %35)
          to label %166 unwind label %270

166:                                              ; preds = %165
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %35) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %35) #0
  br label %275

167:                                              ; preds = %100, %98, %96, %94, %92
  %168 = landingpad { ptr, i32 }
          cleanup
  %169 = extractvalue { ptr, i32 } %168, 0
  store ptr %169, ptr %14, align 8
  %170 = extractvalue { ptr, i32 } %168, 1
  store i32 %170, ptr %15, align 4
  br label %175

171:                                              ; preds = %102
  %172 = landingpad { ptr, i32 }
          cleanup
  %173 = extractvalue { ptr, i32 } %172, 0
  store ptr %173, ptr %14, align 8
  %174 = extractvalue { ptr, i32 } %172, 1
  store i32 %174, ptr %15, align 4
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #0
  br label %175

175:                                              ; preds = %171, %167
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #0
  call void @__cxa_guard_abort(ptr @_ZGVZN3sim14MouseInterface10doDiagonalEibbE13halfTileWidth) #0
  br label %405

176:                                              ; preds = %111
  %177 = landingpad { ptr, i32 }
          cleanup
  %178 = extractvalue { ptr, i32 } %177, 0
  store ptr %178, ptr %14, align 8
  %179 = extractvalue { ptr, i32 } %177, 1
  store i32 %179, ptr %15, align 4
  br label %184

180:                                              ; preds = %114, %112
  %181 = landingpad { ptr, i32 }
          cleanup
  %182 = extractvalue { ptr, i32 } %181, 0
  store ptr %182, ptr %14, align 8
  %183 = extractvalue { ptr, i32 } %181, 1
  store i32 %183, ptr %15, align 4
  call void @_ZN3sim4AreaD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #0
  br label %184

184:                                              ; preds = %180, %176
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #0
  call void @__cxa_guard_abort(ptr @_ZGVZN3sim14MouseInterface10doDiagonalEibbE16halfTileDiagonal) #0
  br label %405

185:                                              ; preds = %125, %123, %119
  %186 = landingpad { ptr, i32 }
          cleanup
  %187 = extractvalue { ptr, i32 } %186, 0
  store ptr %187, ptr %14, align 8
  %188 = extractvalue { ptr, i32 } %186, 1
  store i32 %188, ptr %15, align 4
  br label %213

189:                                              ; preds = %127
  %190 = landingpad { ptr, i32 }
          cleanup
  %191 = extractvalue { ptr, i32 } %190, 0
  store ptr %191, ptr %14, align 8
  %192 = extractvalue { ptr, i32 } %190, 1
  store i32 %192, ptr %15, align 4
  br label %212

193:                                              ; preds = %130
  %194 = landingpad { ptr, i32 }
          cleanup
  %195 = extractvalue { ptr, i32 } %194, 0
  store ptr %195, ptr %14, align 8
  %196 = extractvalue { ptr, i32 } %194, 1
  store i32 %196, ptr %15, align 4
  br label %211

197:                                              ; preds = %131
  %198 = landingpad { ptr, i32 }
          cleanup
  %199 = extractvalue { ptr, i32 } %198, 0
  store ptr %199, ptr %14, align 8
  %200 = extractvalue { ptr, i32 } %198, 1
  store i32 %200, ptr %15, align 4
  br label %210

201:                                              ; preds = %132
  %202 = landingpad { ptr, i32 }
          cleanup
  %203 = extractvalue { ptr, i32 } %202, 0
  store ptr %203, ptr %14, align 8
  %204 = extractvalue { ptr, i32 } %202, 1
  store i32 %204, ptr %15, align 4
  br label %209

205:                                              ; preds = %133
  %206 = landingpad { ptr, i32 }
          cleanup
  %207 = extractvalue { ptr, i32 } %206, 0
  store ptr %207, ptr %14, align 8
  %208 = extractvalue { ptr, i32 } %206, 1
  store i32 %208, ptr %15, align 4
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %19) #0
  br label %209

209:                                              ; preds = %205, %201
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #0
  br label %210

210:                                              ; preds = %209, %197
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %23) #0
  br label %211

211:                                              ; preds = %210, %193
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #0
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %22) #0
  br label %212

212:                                              ; preds = %211, %189
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #0
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #0
  br label %213

213:                                              ; preds = %212, %185
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %19) #0
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %18) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %18) #0
  br label %404

214:                                              ; preds = %134
  %215 = landingpad { ptr, i32 }
          cleanup
  %216 = extractvalue { ptr, i32 } %215, 0
  store ptr %216, ptr %14, align 8
  %217 = extractvalue { ptr, i32 } %215, 1
  store i32 %217, ptr %15, align 4
  br label %247

218:                                              ; preds = %137
  %219 = landingpad { ptr, i32 }
          cleanup
  %220 = extractvalue { ptr, i32 } %219, 0
  store ptr %220, ptr %14, align 8
  %221 = extractvalue { ptr, i32 } %219, 1
  store i32 %221, ptr %15, align 4
  br label %246

222:                                              ; preds = %140
  %223 = landingpad { ptr, i32 }
          cleanup
  %224 = extractvalue { ptr, i32 } %223, 0
  store ptr %224, ptr %14, align 8
  %225 = extractvalue { ptr, i32 } %223, 1
  store i32 %225, ptr %15, align 4
  br label %245

226:                                              ; preds = %141
  %227 = landingpad { ptr, i32 }
          cleanup
  %228 = extractvalue { ptr, i32 } %227, 0
  store ptr %228, ptr %14, align 8
  %229 = extractvalue { ptr, i32 } %227, 1
  store i32 %229, ptr %15, align 4
  br label %244

230:                                              ; preds = %147
  %231 = landingpad { ptr, i32 }
          cleanup
  %232 = extractvalue { ptr, i32 } %231, 0
  store ptr %232, ptr %14, align 8
  %233 = extractvalue { ptr, i32 } %231, 1
  store i32 %233, ptr %15, align 4
  br label %243

234:                                              ; preds = %148
  %235 = landingpad { ptr, i32 }
          cleanup
  %236 = extractvalue { ptr, i32 } %235, 0
  store ptr %236, ptr %14, align 8
  %237 = extractvalue { ptr, i32 } %235, 1
  store i32 %237, ptr %15, align 4
  br label %242

238:                                              ; preds = %149
  %239 = landingpad { ptr, i32 }
          cleanup
  %240 = extractvalue { ptr, i32 } %239, 0
  store ptr %240, ptr %14, align 8
  %241 = extractvalue { ptr, i32 } %239, 1
  store i32 %241, ptr %15, align 4
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %25) #0
  br label %242

242:                                              ; preds = %238, %234
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %27) #0
  br label %243

243:                                              ; preds = %242, %230
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %29) #0
  br label %244

244:                                              ; preds = %243, %226
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %30) #0
  br label %245

245:                                              ; preds = %244, %222
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #0
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %28) #0
  br label %246

246:                                              ; preds = %245, %218
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #0
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %26) #0
  br label %247

247:                                              ; preds = %246, %214
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %25) #0
  br label %403

248:                                              ; preds = %150
  %249 = landingpad { ptr, i32 }
          cleanup
  %250 = extractvalue { ptr, i32 } %249, 0
  store ptr %250, ptr %14, align 8
  %251 = extractvalue { ptr, i32 } %249, 1
  store i32 %251, ptr %15, align 4
  br label %261

252:                                              ; preds = %153
  %253 = landingpad { ptr, i32 }
          cleanup
  %254 = extractvalue { ptr, i32 } %253, 0
  store ptr %254, ptr %14, align 8
  %255 = extractvalue { ptr, i32 } %253, 1
  store i32 %255, ptr %15, align 4
  br label %260

256:                                              ; preds = %154
  %257 = landingpad { ptr, i32 }
          cleanup
  %258 = extractvalue { ptr, i32 } %257, 0
  store ptr %258, ptr %14, align 8
  %259 = extractvalue { ptr, i32 } %257, 1
  store i32 %259, ptr %15, align 4
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %32) #0
  br label %260

260:                                              ; preds = %256, %252
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %33) #0
  br label %261

261:                                              ; preds = %260, %248
  call void @llvm.lifetime.end.p0(i64 40, ptr %33) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %32) #0
  br label %402

262:                                              ; preds = %155
  %263 = landingpad { ptr, i32 }
          cleanup
  %264 = extractvalue { ptr, i32 } %263, 0
  store ptr %264, ptr %14, align 8
  %265 = extractvalue { ptr, i32 } %263, 1
  store i32 %265, ptr %15, align 4
  br label %401

266:                                              ; preds = %164
  %267 = landingpad { ptr, i32 }
          cleanup
  %268 = extractvalue { ptr, i32 } %267, 0
  store ptr %268, ptr %14, align 8
  %269 = extractvalue { ptr, i32 } %267, 1
  store i32 %269, ptr %15, align 4
  br label %274

270:                                              ; preds = %165
  %271 = landingpad { ptr, i32 }
          cleanup
  %272 = extractvalue { ptr, i32 } %271, 0
  store ptr %272, ptr %14, align 8
  %273 = extractvalue { ptr, i32 } %271, 1
  store i32 %273, ptr %15, align 4
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %35) #0
  br label %274

274:                                              ; preds = %270, %266
  call void @llvm.lifetime.end.p0(i64 16, ptr %35) #0
  br label %400

275:                                              ; preds = %166, %161, %158
  %276 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %277 = trunc i8 %276 to i1
  br i1 %277, label %293, label %278

278:                                              ; preds = %275
  %279 = load i8, ptr %8, align 1, !tbaa !11, !range !13, !noundef !14
  %280 = trunc i8 %279 to i1
  br i1 %280, label %293, label %281

281:                                              ; preds = %278
  call void @llvm.lifetime.start.p0(i64 16, ptr %36) #0
  invoke void @_ZN3sim7DegreesC1Ed(ptr noundef nonnull align 8 dereferenceable(16) %36, double noundef 9.000000e+01)
          to label %282 unwind label %284

282:                                              ; preds = %281
  invoke void @_ZN3sim7RadiansmIERKNS_5AngleE(ptr noundef nonnull align 8 dereferenceable(16) %34, ptr noundef nonnull align 8 dereferenceable(16) %36)
          to label %283 unwind label %288

283:                                              ; preds = %282
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %36) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %36) #0
  br label %293

284:                                              ; preds = %281
  %285 = landingpad { ptr, i32 }
          cleanup
  %286 = extractvalue { ptr, i32 } %285, 0
  store ptr %286, ptr %14, align 8
  %287 = extractvalue { ptr, i32 } %285, 1
  store i32 %287, ptr %15, align 4
  br label %292

288:                                              ; preds = %282
  %289 = landingpad { ptr, i32 }
          cleanup
  %290 = extractvalue { ptr, i32 } %289, 0
  store ptr %290, ptr %14, align 8
  %291 = extractvalue { ptr, i32 } %289, 1
  store i32 %291, ptr %15, align 4
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %36) #0
  br label %292

292:                                              ; preds = %288, %284
  call void @llvm.lifetime.end.p0(i64 16, ptr %36) #0
  br label %400

293:                                              ; preds = %283, %278, %275
  call void @llvm.lifetime.start.p0(i64 40, ptr %37) #0
  %294 = getelementptr inbounds %"class.sim::MouseInterface", ptr %48, i32 0, i32 1
  %295 = load ptr, ptr %294, align 8, !tbaa !16
  invoke void @_ZNK3sim5Mouse21getCurrentTranslationEv(ptr dead_on_unwind writable sret(%"class.sim::Cartesian") align 8 %37, ptr noundef nonnull align 8 dereferenceable(528) %295)
          to label %296 unwind label %333

296:                                              ; preds = %293
  call void @llvm.lifetime.start.p0(i64 16, ptr %38) #0
  invoke void @_ZNK3sim10Coordinate8getThetaEv(ptr dead_on_unwind writable sret(%"class.sim::Radians") align 8 %38, ptr noundef nonnull align 8 dereferenceable(40) %31)
          to label %297 unwind label %337

297:                                              ; preds = %296
  invoke void @_ZN3sim14MouseInterface6turnToERKNS_9CartesianERKNS_7RadiansE(ptr noundef nonnull align 8 dereferenceable(296) %48, ptr noundef nonnull align 8 dereferenceable(40) %37, ptr noundef nonnull align 8 dereferenceable(16) %38)
          to label %298 unwind label %341

298:                                              ; preds = %297
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %38) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %38) #0
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %37) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %37) #0
  call void @llvm.lifetime.start.p0(i64 16, ptr %39) #0
  %299 = getelementptr inbounds %"class.sim::MouseInterface", ptr %48, i32 0, i32 1
  %300 = load ptr, ptr %299, align 8, !tbaa !16
  invoke void @_ZNK3sim5Mouse18getCurrentRotationEv(ptr dead_on_unwind writable sret(%"class.sim::Radians") align 8 %39, ptr noundef nonnull align 8 dereferenceable(528) %300)
          to label %301 unwind label %347

301:                                              ; preds = %298
  invoke void @_ZN3sim14MouseInterface13moveForwardToERKNS_9CartesianERKNS_7RadiansE(ptr noundef nonnull align 8 dereferenceable(296) %48, ptr noundef nonnull align 8 dereferenceable(40) %24, ptr noundef nonnull align 8 dereferenceable(16) %39)
          to label %302 unwind label %351

302:                                              ; preds = %301
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %39) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %39) #0
  call void @llvm.lifetime.start.p0(i64 40, ptr %40) #0
  %303 = getelementptr inbounds %"class.sim::MouseInterface", ptr %48, i32 0, i32 1
  %304 = load ptr, ptr %303, align 8, !tbaa !16
  invoke void @_ZNK3sim5Mouse21getCurrentTranslationEv(ptr dead_on_unwind writable sret(%"class.sim::Cartesian") align 8 %40, ptr noundef nonnull align 8 dereferenceable(528) %304)
          to label %305 unwind label %356

305:                                              ; preds = %302
  invoke void @_ZN3sim14MouseInterface6turnToERKNS_9CartesianERKNS_7RadiansE(ptr noundef nonnull align 8 dereferenceable(296) %48, ptr noundef nonnull align 8 dereferenceable(40) %40, ptr noundef nonnull align 8 dereferenceable(16) %34)
          to label %306 unwind label %360

306:                                              ; preds = %305
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %40) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %40) #0
  call void @llvm.lifetime.start.p0(i64 40, ptr %41) #0
  call void @llvm.lifetime.start.p0(i64 40, ptr %42) #0
  call void @llvm.lifetime.start.p0(i64 16, ptr %43) #0
  %307 = invoke noundef ptr @_ZN3sim1PEv()
          to label %308 unwind label %365

308:                                              ; preds = %306
  %309 = invoke noundef double @_ZN3sim5Param9wallWidthEv(ptr noundef nonnull align 8 dereferenceable(1056) %307)
          to label %310 unwind label %365

310:                                              ; preds = %308
  %311 = fdiv double %309, 2.000000e+00
  invoke void @_ZN3sim6MetersC1Ed(ptr noundef nonnull align 8 dereferenceable(16) %43, double noundef %311)
          to label %312 unwind label %365

312:                                              ; preds = %310
  call void @llvm.lifetime.start.p0(i64 16, ptr %44) #0
  %313 = getelementptr inbounds %"class.sim::MouseInterface", ptr %48, i32 0, i32 1
  %314 = load ptr, ptr %313, align 8, !tbaa !16
  invoke void @_ZNK3sim5Mouse18getCurrentRotationEv(ptr dead_on_unwind writable sret(%"class.sim::Radians") align 8 %44, ptr noundef nonnull align 8 dereferenceable(528) %314)
          to label %315 unwind label %369

315:                                              ; preds = %312
  invoke void @_ZN3sim5PolarC1ERKNS_8DistanceERKNS_5AngleE(ptr noundef nonnull align 8 dereferenceable(40) %42, ptr noundef nonnull align 8 dereferenceable(16) %43, ptr noundef nonnull align 8 dereferenceable(16) %44)
          to label %316 unwind label %373

316:                                              ; preds = %315
  invoke void @_ZNK3sim9CartesianplERKNS_10CoordinateE(ptr dead_on_unwind writable sret(%"class.sim::Cartesian") align 8 %41, ptr noundef nonnull align 8 dereferenceable(40) %24, ptr noundef nonnull align 8 dereferenceable(40) %42)
          to label %317 unwind label %377

317:                                              ; preds = %316
  call void @llvm.lifetime.start.p0(i64 16, ptr %45) #0
  %318 = getelementptr inbounds %"class.sim::MouseInterface", ptr %48, i32 0, i32 1
  %319 = load ptr, ptr %318, align 8, !tbaa !16
  invoke void @_ZNK3sim5Mouse18getCurrentRotationEv(ptr dead_on_unwind writable sret(%"class.sim::Radians") align 8 %45, ptr noundef nonnull align 8 dereferenceable(528) %319)
          to label %320 unwind label %381

320:                                              ; preds = %317
  invoke void @_ZN3sim14MouseInterface13moveForwardToERKNS_9CartesianERKNS_7RadiansE(ptr noundef nonnull align 8 dereferenceable(296) %48, ptr noundef nonnull align 8 dereferenceable(40) %41, ptr noundef nonnull align 8 dereferenceable(16) %45)
          to label %321 unwind label %385

321:                                              ; preds = %320
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %45) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %45) #0
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %41) #0
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %42) #0
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %44) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %44) #0
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %43) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %43) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %42) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %41) #0
  %322 = load i8, ptr %9, align 1, !tbaa !11, !range !13, !noundef !14
  %323 = trunc i8 %322 to i1
  br i1 %323, label %324, label %398

324:                                              ; preds = %321
  %325 = invoke noundef ptr @_ZN3sim1SEv()
          to label %326 unwind label %394

326:                                              ; preds = %324
  %327 = invoke noundef zeroext i1 @_ZN3sim5State7crashedEv(ptr noundef nonnull align 8 dereferenceable(168) %325)
          to label %328 unwind label %394

328:                                              ; preds = %326
  br i1 %327, label %398, label %329

329:                                              ; preds = %328
  %330 = invoke noundef ptr @_ZN3sim1SEv()
          to label %331 unwind label %394

331:                                              ; preds = %329
  invoke void @_ZN3sim5State10setCrashedEv(ptr noundef nonnull align 8 dereferenceable(168) %330)
          to label %332 unwind label %394

332:                                              ; preds = %331
  br label %398

333:                                              ; preds = %293
  %334 = landingpad { ptr, i32 }
          cleanup
  %335 = extractvalue { ptr, i32 } %334, 0
  store ptr %335, ptr %14, align 8
  %336 = extractvalue { ptr, i32 } %334, 1
  store i32 %336, ptr %15, align 4
  br label %346

337:                                              ; preds = %296
  %338 = landingpad { ptr, i32 }
          cleanup
  %339 = extractvalue { ptr, i32 } %338, 0
  store ptr %339, ptr %14, align 8
  %340 = extractvalue { ptr, i32 } %338, 1
  store i32 %340, ptr %15, align 4
  br label %345

341:                                              ; preds = %297
  %342 = landingpad { ptr, i32 }
          cleanup
  %343 = extractvalue { ptr, i32 } %342, 0
  store ptr %343, ptr %14, align 8
  %344 = extractvalue { ptr, i32 } %342, 1
  store i32 %344, ptr %15, align 4
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %38) #0
  br label %345

345:                                              ; preds = %341, %337
  call void @llvm.lifetime.end.p0(i64 16, ptr %38) #0
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %37) #0
  br label %346

346:                                              ; preds = %345, %333
  call void @llvm.lifetime.end.p0(i64 40, ptr %37) #0
  br label %400

347:                                              ; preds = %298
  %348 = landingpad { ptr, i32 }
          cleanup
  %349 = extractvalue { ptr, i32 } %348, 0
  store ptr %349, ptr %14, align 8
  %350 = extractvalue { ptr, i32 } %348, 1
  store i32 %350, ptr %15, align 4
  br label %355

351:                                              ; preds = %301
  %352 = landingpad { ptr, i32 }
          cleanup
  %353 = extractvalue { ptr, i32 } %352, 0
  store ptr %353, ptr %14, align 8
  %354 = extractvalue { ptr, i32 } %352, 1
  store i32 %354, ptr %15, align 4
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %39) #0
  br label %355

355:                                              ; preds = %351, %347
  call void @llvm.lifetime.end.p0(i64 16, ptr %39) #0
  br label %400

356:                                              ; preds = %302
  %357 = landingpad { ptr, i32 }
          cleanup
  %358 = extractvalue { ptr, i32 } %357, 0
  store ptr %358, ptr %14, align 8
  %359 = extractvalue { ptr, i32 } %357, 1
  store i32 %359, ptr %15, align 4
  br label %364

360:                                              ; preds = %305
  %361 = landingpad { ptr, i32 }
          cleanup
  %362 = extractvalue { ptr, i32 } %361, 0
  store ptr %362, ptr %14, align 8
  %363 = extractvalue { ptr, i32 } %361, 1
  store i32 %363, ptr %15, align 4
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %40) #0
  br label %364

364:                                              ; preds = %360, %356
  call void @llvm.lifetime.end.p0(i64 40, ptr %40) #0
  br label %400

365:                                              ; preds = %310, %308, %306
  %366 = landingpad { ptr, i32 }
          cleanup
  %367 = extractvalue { ptr, i32 } %366, 0
  store ptr %367, ptr %14, align 8
  %368 = extractvalue { ptr, i32 } %366, 1
  store i32 %368, ptr %15, align 4
  br label %393

369:                                              ; preds = %312
  %370 = landingpad { ptr, i32 }
          cleanup
  %371 = extractvalue { ptr, i32 } %370, 0
  store ptr %371, ptr %14, align 8
  %372 = extractvalue { ptr, i32 } %370, 1
  store i32 %372, ptr %15, align 4
  br label %392

373:                                              ; preds = %315
  %374 = landingpad { ptr, i32 }
          cleanup
  %375 = extractvalue { ptr, i32 } %374, 0
  store ptr %375, ptr %14, align 8
  %376 = extractvalue { ptr, i32 } %374, 1
  store i32 %376, ptr %15, align 4
  br label %391

377:                                              ; preds = %316
  %378 = landingpad { ptr, i32 }
          cleanup
  %379 = extractvalue { ptr, i32 } %378, 0
  store ptr %379, ptr %14, align 8
  %380 = extractvalue { ptr, i32 } %378, 1
  store i32 %380, ptr %15, align 4
  br label %390

381:                                              ; preds = %317
  %382 = landingpad { ptr, i32 }
          cleanup
  %383 = extractvalue { ptr, i32 } %382, 0
  store ptr %383, ptr %14, align 8
  %384 = extractvalue { ptr, i32 } %382, 1
  store i32 %384, ptr %15, align 4
  br label %389

385:                                              ; preds = %320
  %386 = landingpad { ptr, i32 }
          cleanup
  %387 = extractvalue { ptr, i32 } %386, 0
  store ptr %387, ptr %14, align 8
  %388 = extractvalue { ptr, i32 } %386, 1
  store i32 %388, ptr %15, align 4
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %45) #0
  br label %389

389:                                              ; preds = %385, %381
  call void @llvm.lifetime.end.p0(i64 16, ptr %45) #0
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %41) #0
  br label %390

390:                                              ; preds = %389, %377
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %42) #0
  br label %391

391:                                              ; preds = %390, %373
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %44) #0
  br label %392

392:                                              ; preds = %391, %369
  call void @llvm.lifetime.end.p0(i64 16, ptr %44) #0
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %43) #0
  br label %393

393:                                              ; preds = %392, %365
  call void @llvm.lifetime.end.p0(i64 16, ptr %43) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %42) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %41) #0
  br label %400

394:                                              ; preds = %331, %329, %326, %324
  %395 = landingpad { ptr, i32 }
          cleanup
  %396 = extractvalue { ptr, i32 } %395, 0
  store ptr %396, ptr %14, align 8
  %397 = extractvalue { ptr, i32 } %395, 1
  store i32 %397, ptr %15, align 4
  br label %400

398:                                              ; preds = %332, %328, %321
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %34) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %34) #0
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %31) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %31) #0
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %24) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %24) #0
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %17) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %17) #0
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #0
  br label %399

399:                                              ; preds = %398, %51
  ret void

400:                                              ; preds = %394, %393, %364, %355, %346, %292, %274
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %34) #0
  br label %401

401:                                              ; preds = %400, %262
  call void @llvm.lifetime.end.p0(i64 16, ptr %34) #0
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %31) #0
  br label %402

402:                                              ; preds = %401, %261
  call void @llvm.lifetime.end.p0(i64 40, ptr %31) #0
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %24) #0
  br label %403

403:                                              ; preds = %402, %247
  call void @llvm.lifetime.end.p0(i64 40, ptr %24) #0
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %17) #0
  br label %404

404:                                              ; preds = %403, %213
  call void @llvm.lifetime.end.p0(i64 40, ptr %17) #0
  br label %405

405:                                              ; preds = %404, %184, %175
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #0
  br label %406

406:                                              ; preds = %405
  %407 = load ptr, ptr %14, align 8
  %408 = load i32, ptr %15, align 4
  %409 = insertvalue { ptr, i32 } poison, ptr %407, 0
  %410 = insertvalue { ptr, i32 } %409, i32 %408, 1
  resume { ptr, i32 } %410
}

declare void @_ZNK3sim5Mouse21getCurrentTranslationEv(ptr dead_on_unwind writable sret(%"class.sim::Cartesian") align 8, ptr noundef nonnull align 8 dereferenceable(528)) #2

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

declare void @_ZNK3sim5Mouse18getCurrentRotationEv(ptr dead_on_unwind writable sret(%"class.sim::Radians") align 8, ptr noundef nonnull align 8 dereferenceable(528)) #2

; 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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3sim14MouseInterface13moveForwardToERKNS_9CartesianERKNS_7RadiansE(ptr noundef nonnull align 8 dereferenceable(296), ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

declare noundef zeroext i1 @_ZN3sim5State7crashedEv(ptr noundef nonnull align 8 dereferenceable(168)) #2

declare void @_ZN3sim5State10setCrashedEv(ptr noundef nonnull align 8 dereferenceable(168)) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3sim14MouseInterface6turnToERKNS_9CartesianERKNS_7RadiansE(ptr noundef nonnull align 8 dereferenceable(296), ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

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

declare void @_ZNK3sim9CartesianmiERKNS_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)) #2

declare void @_ZN3sim5PolarC1ERKNS_10CoordinateE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #2

declare void @_ZNK3sim10Coordinate8getThetaEv(ptr dead_on_unwind writable sret(%"class.sim::Radians") align 8, ptr noundef nonnull align 8 dereferenceable(40)) #2

declare void @_ZN3sim7RadianspLERKNS_5AngleE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #2

declare void @_ZN3sim7RadiansmIERKNS_5AngleE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2el6Logger4warnIPKcJiEEEvS3_RKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728), ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2el6Logger4warnIPKcJS3_iEEEvS3_RKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728), ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #5 align 2

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

; Function Attrs: nounwind
declare double @sqrt(double noundef) #3

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

declare noundef double @_ZNK3sim4Area16getMetersSquaredEv(ptr noundef nonnull align 8 dereferenceable(16)) #2

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

declare void @_ZNK3sim7DegreesmlEd(ptr dead_on_unwind writable sret(%"class.sim::Degrees") align 8, ptr noundef nonnull align 8 dereferenceable(16), double noundef) #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 = { 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 = { 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" }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!"branch_weights", i32 1, i32 1048575}
!16 = !{!17, !6, i64 8}
!17 = !{!"_ZTSN3sim14MouseInterfaceE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !18, i64 32, !27, i64 80, !12, i64 192, !31, i64 200, !31, i64 248}
!18 = !{!"_ZTSSt3setIcSt4lessIcESaIcEE", !19, i64 0}
!19 = !{!"_ZTSSt8_Rb_treeIccSt9_IdentityIcESt4lessIcESaIcEE", !20, i64 0}
!20 = !{!"_ZTSNSt8_Rb_treeIccSt9_IdentityIcESt4lessIcESaIcEE13_Rb_tree_implIS3_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, !6, i64 8, !6, i64 16, !6, i64 24}
!25 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!26 = !{!"long", !7, i64 0}
!27 = !{!"_ZTSN3sim27StaticMouseAlgorithmOptionsE", !28, i64 0, !28, i64 32, !28, i64 64, !10, i64 96, !10, i64 100, !30, i64 104}
!28 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !29, i64 0, !26, i64 8, !7, i64 16}
!29 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!30 = !{!"double", !7, i64 0}
!31 = !{!"_ZTSSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE", !32, i64 0}
!32 = !{!"_ZTSSt8_Rb_treeISt4pairIiiES1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE", !33, i64 0}
!33 = !{!"_ZTSNSt8_Rb_treeISt4pairIiiES1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE13_Rb_tree_implIS5_Lb1EEE", !34, i64 0, !23, i64 8}
!34 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessISt4pairIiiEEE", !35, i64 0}
!35 = !{!"_ZTSSt4lessISt4pairIiiEE"}


; 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.sim::Meters" = type { %"class.sim::Distance" }
%"class.sim::Distance" = type { ptr, double }
%"class.sim::MetersSquared" = type { %"class.sim::Area" }
%"class.sim::Area" = type { ptr, double }
%"class.sim::Cartesian" = type { %"class.sim::Coordinate" }
%"class.sim::Coordinate" = type { ptr, %"class.sim::Meters", %"class.sim::Meters" }
%"class.sim::Polar" = type { %"class.sim::Coordinate" }
%"class.sim::Radians" = type { %"class.sim::Angle" }
%"class.sim::Angle" = type { ptr, double }
%"class.sim::Degrees" = type { %"class.sim::Angle" }

@__dso_handle = external hidden global i8
@.str.122 = external hidden unnamed_addr constant [256 x i8], align 1
@.str.123 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.124 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.125 = external hidden unnamed_addr constant [316 x i8], align 1
@_ZZN3sim14MouseInterface10doDiagonalEibbE13halfTileWidth = external hidden global %"class.sim::Meters", align 8
@_ZGVZN3sim14MouseInterface10doDiagonalEibbE13halfTileWidth = external hidden global i64, align 8
@_ZZN3sim14MouseInterface10doDiagonalEibbE16halfTileDiagonal = external hidden global %"class.sim::Meters", align 8
@_ZGVZN3sim14MouseInterface10doDiagonalEibbE16halfTileDiagonal = 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 void @_ZN3sim7DegreesC1Ed(ptr noundef nonnull align 8 dereferenceable(16), double noundef) unnamed_addr #2

declare noundef ptr @_ZN3sim1PEv() local_unnamed_addr #2

declare noundef ptr @_ZN3sim1LEv() local_unnamed_addr #2

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

declare noundef ptr @_ZN3sim1SEv() local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3sim14MouseInterface10doDiagonalEibb(ptr noundef nonnull align 8 dereferenceable(296) %0, i32 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.sim::Meters", align 8
  %10 = alloca %"class.sim::MetersSquared", align 8
  %11 = alloca %"class.sim::Cartesian", align 8
  %12 = alloca %"class.sim::Cartesian", align 8
  %13 = alloca %"class.sim::Polar", align 8
  %14 = alloca %"class.sim::Meters", align 8
  %15 = alloca %"class.sim::Radians", align 8
  %16 = alloca %"class.sim::Radians", align 8
  %17 = alloca %"class.sim::Degrees", align 8
  %18 = alloca %"class.sim::Cartesian", align 8
  %19 = alloca %"class.sim::Polar", align 8
  %20 = alloca %"class.sim::Meters", align 8
  %21 = alloca %"class.sim::Radians", align 8
  %22 = alloca %"class.sim::Radians", align 8
  %23 = alloca %"class.sim::Degrees", align 8
  %24 = alloca %"class.sim::Degrees", align 8
  %25 = alloca %"class.sim::Polar", align 8
  %26 = alloca %"class.sim::Cartesian", align 8
  %27 = alloca %"class.sim::Cartesian", align 8
  %28 = alloca %"class.sim::Radians", align 8
  %29 = alloca %"class.sim::Degrees", align 8
  %30 = alloca %"class.sim::Degrees", align 8
  %31 = alloca %"class.sim::Cartesian", align 8
  %32 = alloca %"class.sim::Radians", align 8
  %33 = alloca %"class.sim::Radians", align 8
  %34 = alloca %"class.sim::Cartesian", align 8
  %35 = alloca %"class.sim::Cartesian", align 8
  %36 = alloca %"class.sim::Polar", align 8
  %37 = alloca %"class.sim::Meters", align 8
  %38 = alloca %"class.sim::Radians", align 8
  %39 = alloca %"class.sim::Radians", align 8
  store i32 %1, ptr %5, align 4, !tbaa !5
  %40 = tail call noundef ptr @_ZN3sim1SEv()
  %41 = tail call noundef zeroext i1 @_ZN3sim5State7crashedEv(ptr noundef nonnull align 8 dereferenceable(168) %40)
  br i1 %41, label %262, label %42

42:                                               ; preds = %4
  %43 = xor i1 %2, %3
  br i1 %43, label %49, label %44

44:                                               ; preds = %42
  %45 = and i32 %1, -2147483647
  %.not46 = icmp eq i32 %45, 1
  br i1 %.not46, label %55, label %46

46:                                               ; preds = %44
  %47 = tail call noundef ptr @_ZN3sim1LEv()
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %48 = select i1 %2, ptr @.str.123, ptr @.str.124
  store ptr %48, ptr %6, align 8, !tbaa !9
  call void @_ZN2el6Logger4warnIPKcJiEEEvS3_RKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728) %47, ptr noundef nonnull @.str.122, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %55

49:                                               ; preds = %42
  %50 = and i32 %1, 1
  %.not = icmp eq i32 %50, 0
  br i1 %.not, label %55, label %51

51:                                               ; preds = %49
  %52 = tail call noundef ptr @_ZN3sim1LEv()
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %53 = select i1 %2, ptr @.str.123, ptr @.str.124
  store ptr %53, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %54 = select i1 %3, ptr @.str.123, ptr @.str.124
  store ptr %54, ptr %8, align 8, !tbaa !9
  call void @_ZN2el6Logger4warnIPKcJS3_iEEEvS3_RKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728) %52, ptr noundef nonnull @.str.125, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %55

55:                                               ; preds = %49, %51, %44, %46
  %.045 = phi i1 [ true, %46 ], [ false, %44 ], [ true, %51 ], [ false, %49 ]
  %56 = load atomic i8, ptr @_ZGVZN3sim14MouseInterface10doDiagonalEibbE13halfTileWidth acquire, align 8
  %57 = icmp eq i8 %56, 0
  br i1 %57, label %58, label %73, !prof !11

58:                                               ; preds = %55
  %59 = call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZN3sim14MouseInterface10doDiagonalEibbE13halfTileWidth) #7
  %.not47 = icmp eq i32 %59, 0
  br i1 %.not47, label %73, label %60

60:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #7
  %61 = invoke noundef ptr @_ZN3sim1PEv()
          to label %62 unwind label %121

62:                                               ; preds = %60
  %63 = invoke noundef double @_ZN3sim5Param10wallLengthEv(ptr noundef nonnull align 8 dereferenceable(1056) %61)
          to label %64 unwind label %121

64:                                               ; preds = %62
  %65 = invoke noundef ptr @_ZN3sim1PEv()
          to label %66 unwind label %121

66:                                               ; preds = %64
  %67 = invoke noundef double @_ZN3sim5Param9wallWidthEv(ptr noundef nonnull align 8 dereferenceable(1056) %65)
          to label %68 unwind label %121

68:                                               ; preds = %66
  %69 = fadd double %63, %67
  invoke void @_ZN3sim6MetersC1Ed(ptr noundef nonnull align 8 dereferenceable(16) %9, double noundef %69)
          to label %70 unwind label %121

70:                                               ; preds = %68
  invoke void @_ZNK3sim6MetersdvEd(ptr dead_on_unwind nonnull writable sret(%"class.sim::Meters") align 8 @_ZZN3sim14MouseInterface10doDiagonalEibbE13halfTileWidth, ptr noundef nonnull align 8 dereferenceable(16) %9, double noundef 2.000000e+00)
          to label %71 unwind label %123

71:                                               ; preds = %70
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  %72 = call i32 @__cxa_atexit(ptr nonnull @_ZN3sim8DistanceD2Ev, ptr nonnull @_ZZN3sim14MouseInterface10doDiagonalEibbE13halfTileWidth, ptr nonnull @__dso_handle) #7
  call void @__cxa_guard_release(ptr nonnull @_ZGVZN3sim14MouseInterface10doDiagonalEibbE13halfTileWidth) #7
  br label %73

73:                                               ; preds = %71, %58, %55
  %74 = load atomic i8, ptr @_ZGVZN3sim14MouseInterface10doDiagonalEibbE16halfTileDiagonal acquire, align 8
  %75 = icmp eq i8 %74, 0
  br i1 %75, label %76, label %86, !prof !11

76:                                               ; preds = %73
  %77 = call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZN3sim14MouseInterface10doDiagonalEibbE16halfTileDiagonal) #7
  %.not49 = icmp eq i32 %77, 0
  br i1 %.not49, label %86, label %78

78:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #7
  invoke void @_ZNK3sim6MetersmlERKNS_8DistanceE(ptr dead_on_unwind nonnull writable sret(%"class.sim::MetersSquared") align 8 %10, ptr noundef nonnull align 8 dereferenceable(16) @_ZZN3sim14MouseInterface10doDiagonalEibbE13halfTileWidth, ptr noundef nonnull align 8 dereferenceable(16) @_ZZN3sim14MouseInterface10doDiagonalEibbE13halfTileWidth)
          to label %79 unwind label %126

79:                                               ; preds = %78
  %80 = invoke noundef double @_ZNK3sim4Area16getMetersSquaredEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %81 unwind label %128

81:                                               ; preds = %79
  %82 = fmul double %80, 2.000000e+00
  %83 = call double @sqrt(double noundef %82) #7
  invoke void @_ZN3sim6MetersC1Ed(ptr noundef nonnull align 8 dereferenceable(16) @_ZZN3sim14MouseInterface10doDiagonalEibbE16halfTileDiagonal, double noundef %83)
          to label %84 unwind label %128

84:                                               ; preds = %81
  call void @_ZN3sim4AreaD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #7
  %85 = call i32 @__cxa_atexit(ptr nonnull @_ZN3sim8DistanceD2Ev, ptr nonnull @_ZZN3sim14MouseInterface10doDiagonalEibbE16halfTileDiagonal, ptr nonnull @__dso_handle) #7
  call void @__cxa_guard_release(ptr nonnull @_ZGVZN3sim14MouseInterface10doDiagonalEibbE16halfTileDiagonal) #7
  br label %86

86:                                               ; preds = %84, %76, %73
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %12) #7
  %87 = getelementptr inbounds i8, ptr %0, i64 8
  %88 = load ptr, ptr %87, align 8, !tbaa !12
  call void @_ZNK3sim5Mouse21getCurrentTranslationEv(ptr dead_on_unwind nonnull writable sret(%"class.sim::Cartesian") align 8 %12, ptr noundef nonnull align 8 dereferenceable(528) %88)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #7
  %89 = invoke noundef ptr @_ZN3sim1PEv()
          to label %90 unwind label %131

90:                                               ; preds = %86
  %91 = invoke noundef double @_ZN3sim5Param9wallWidthEv(ptr noundef nonnull align 8 dereferenceable(1056) %89)
          to label %92 unwind label %131

92:                                               ; preds = %90
  %93 = fmul double %91, 5.000000e-01
  invoke void @_ZN3sim6MetersC1Ed(ptr noundef nonnull align 8 dereferenceable(16) %14, double noundef %93)
          to label %94 unwind label %131

94:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #7
  %95 = load ptr, ptr %87, align 8, !tbaa !12
  invoke void @_ZNK3sim5Mouse18getCurrentRotationEv(ptr dead_on_unwind nonnull writable sret(%"class.sim::Radians") align 8 %16, ptr noundef nonnull align 8 dereferenceable(528) %95)
          to label %96 unwind label %133

96:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %17) #7
  invoke void @_ZN3sim7DegreesC1Ed(ptr noundef nonnull align 8 dereferenceable(16) %17, double noundef 1.800000e+02)
          to label %97 unwind label %135

97:                                               ; preds = %96
  invoke void @_ZNK3sim7RadiansplERKNS_5AngleE(ptr dead_on_unwind nonnull writable sret(%"class.sim::Radians") align 8 %15, ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(16) %17)
          to label %98 unwind label %137

98:                                               ; preds = %97
  invoke void @_ZN3sim5PolarC1ERKNS_8DistanceERKNS_5AngleE(ptr noundef nonnull align 8 dereferenceable(40) %13, ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %15)
          to label %99 unwind label %139

99:                                               ; preds = %98
  invoke void @_ZNK3sim9CartesianplERKNS_10CoordinateE(ptr dead_on_unwind nonnull writable sret(%"class.sim::Cartesian") align 8 %11, ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef nonnull align 8 dereferenceable(40) %13)
          to label %100 unwind label %141

100:                                              ; preds = %99
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %13) #7
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #7
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #7
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #7
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %13) #7
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %12) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %18) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %19) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %20) #7
  %101 = load i32, ptr %5, align 4, !tbaa !5
  %102 = sitofp i32 %101 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) @_ZZN3sim14MouseInterface10doDiagonalEibbE16halfTileDiagonal, double noundef %102)
          to label %103 unwind label %148

103:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %21) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %22) #7
  %104 = load ptr, ptr %87, align 8, !tbaa !12
  invoke void @_ZNK3sim5Mouse18getCurrentRotationEv(ptr dead_on_unwind nonnull writable sret(%"class.sim::Radians") align 8 %22, ptr noundef nonnull align 8 dereferenceable(528) %104)
          to label %105 unwind label %150

105:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %23) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %24) #7
  invoke void @_ZN3sim7DegreesC1Ed(ptr noundef nonnull align 8 dereferenceable(16) %24, double noundef 4.500000e+01)
          to label %106 unwind label %152

106:                                              ; preds = %105
  %107 = select i1 %2, double 1.000000e+00, double -1.000000e+00
  invoke void @_ZNK3sim7DegreesmlEd(ptr dead_on_unwind nonnull writable sret(%"class.sim::Degrees") align 8 %23, ptr noundef nonnull align 8 dereferenceable(16) %24, double noundef %107)
          to label %108 unwind label %154

108:                                              ; preds = %106
  invoke void @_ZNK3sim7RadiansplERKNS_5AngleE(ptr dead_on_unwind nonnull writable sret(%"class.sim::Radians") align 8 %21, ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(16) %23)
          to label %109 unwind label %156

109:                                              ; preds = %108
  invoke void @_ZN3sim5PolarC1ERKNS_8DistanceERKNS_5AngleE(ptr noundef nonnull align 8 dereferenceable(40) %19, ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(16) %21)
          to label %110 unwind label %158

110:                                              ; preds = %109
  invoke void @_ZNK3sim9CartesianplERKNS_10CoordinateE(ptr dead_on_unwind nonnull writable sret(%"class.sim::Cartesian") align 8 %18, ptr noundef nonnull align 8 dereferenceable(40) %11, ptr noundef nonnull align 8 dereferenceable(40) %19)
          to label %111 unwind label %160

111:                                              ; preds = %110
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %19) #7
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #7
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %23) #7
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %24) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %24) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %23) #7
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %22) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %22) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %21) #7
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %19) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %25) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %26) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %27) #7
  %112 = load ptr, ptr %87, align 8, !tbaa !12
  invoke void @_ZNK3sim5Mouse21getCurrentTranslationEv(ptr dead_on_unwind nonnull writable sret(%"class.sim::Cartesian") align 8 %27, ptr noundef nonnull align 8 dereferenceable(528) %112)
          to label %113 unwind label %168

113:                                              ; preds = %111
  invoke void @_ZNK3sim9CartesianmiERKNS_10CoordinateE(ptr dead_on_unwind nonnull writable sret(%"class.sim::Cartesian") align 8 %26, ptr noundef nonnull align 8 dereferenceable(40) %18, ptr noundef nonnull align 8 dereferenceable(40) %27)
          to label %114 unwind label %170

114:                                              ; preds = %113
  invoke void @_ZN3sim5PolarC1ERKNS_10CoordinateE(ptr noundef nonnull align 8 dereferenceable(40) %25, ptr noundef nonnull align 8 dereferenceable(40) %26)
          to label %115 unwind label %172

115:                                              ; preds = %114
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %26) #7
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %27) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %27) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %26) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %28) #7
  %116 = load ptr, ptr %87, align 8, !tbaa !12
  invoke void @_ZNK3sim5Mouse18getCurrentRotationEv(ptr dead_on_unwind nonnull writable sret(%"class.sim::Radians") align 8 %28, ptr noundef nonnull align 8 dereferenceable(528) %116)
          to label %117 unwind label %176

117:                                              ; preds = %115
  %brmerge.demorgan = and i1 %2, %3
  br i1 %brmerge.demorgan, label %118, label %183

118:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %29) #7
  invoke void @_ZN3sim7DegreesC1Ed(ptr noundef nonnull align 8 dereferenceable(16) %29, double noundef 9.000000e+01)
          to label %119 unwind label %178

119:                                              ; preds = %118
  invoke void @_ZN3sim7RadianspLERKNS_5AngleE(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(16) %29)
          to label %120 unwind label %180

120:                                              ; preds = %119
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %29) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %29) #7
  br label %183

121:                                              ; preds = %68, %66, %64, %62, %60
  %122 = landingpad { ptr, i32 }
          cleanup
  br label %125

123:                                              ; preds = %70
  %124 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #7
  br label %125

125:                                              ; preds = %123, %121
  %.pn = phi { ptr, i32 } [ %124, %123 ], [ %122, %121 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  call void @__cxa_guard_abort(ptr nonnull @_ZGVZN3sim14MouseInterface10doDiagonalEibbE13halfTileWidth) #7
  br label %268

126:                                              ; preds = %78
  %127 = landingpad { ptr, i32 }
          cleanup
  br label %130

128:                                              ; preds = %81, %79
  %129 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3sim4AreaD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #7
  br label %130

130:                                              ; preds = %128, %126
  %.pn50 = phi { ptr, i32 } [ %129, %128 ], [ %127, %126 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #7
  call void @__cxa_guard_abort(ptr nonnull @_ZGVZN3sim14MouseInterface10doDiagonalEibbE16halfTileDiagonal) #7
  br label %268

131:                                              ; preds = %92, %90, %86
  %132 = landingpad { ptr, i32 }
          cleanup
  br label %147

133:                                              ; preds = %94
  %134 = landingpad { ptr, i32 }
          cleanup
  br label %146

135:                                              ; preds = %96
  %136 = landingpad { ptr, i32 }
          cleanup
  br label %145

137:                                              ; preds = %97
  %138 = landingpad { ptr, i32 }
          cleanup
  br label %144

139:                                              ; preds = %98
  %140 = landingpad { ptr, i32 }
          cleanup
  br label %143

141:                                              ; preds = %99
  %142 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %13) #7
  br label %143

143:                                              ; preds = %141, %139
  %.pn52 = phi { ptr, i32 } [ %142, %141 ], [ %140, %139 ]
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #7
  br label %144

144:                                              ; preds = %143, %137
  %.pn52.pn = phi { ptr, i32 } [ %.pn52, %143 ], [ %138, %137 ]
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #7
  br label %145

145:                                              ; preds = %144, %135
  %.pn52.pn.pn = phi { ptr, i32 } [ %.pn52.pn, %144 ], [ %136, %135 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #7
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #7
  br label %146

146:                                              ; preds = %145, %133
  %.pn52.pn.pn.pn = phi { ptr, i32 } [ %.pn52.pn.pn, %145 ], [ %134, %133 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #7
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #7
  br label %147

147:                                              ; preds = %146, %131
  %.pn52.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn52.pn.pn.pn, %146 ], [ %132, %131 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %13) #7
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %12) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %12) #7
  br label %267

148:                                              ; preds = %100
  %149 = landingpad { ptr, i32 }
          cleanup
  br label %167

150:                                              ; preds = %103
  %151 = landingpad { ptr, i32 }
          cleanup
  br label %166

152:                                              ; preds = %105
  %153 = landingpad { ptr, i32 }
          cleanup
  br label %165

154:                                              ; preds = %106
  %155 = landingpad { ptr, i32 }
          cleanup
  br label %164

156:                                              ; preds = %108
  %157 = landingpad { ptr, i32 }
          cleanup
  br label %163

158:                                              ; preds = %109
  %159 = landingpad { ptr, i32 }
          cleanup
  br label %162

160:                                              ; preds = %110
  %161 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %19) #7
  br label %162

162:                                              ; preds = %160, %158
  %.pn58 = phi { ptr, i32 } [ %161, %160 ], [ %159, %158 ]
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #7
  br label %163

163:                                              ; preds = %162, %156
  %.pn58.pn = phi { ptr, i32 } [ %.pn58, %162 ], [ %157, %156 ]
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %23) #7
  br label %164

164:                                              ; preds = %163, %154
  %.pn58.pn.pn = phi { ptr, i32 } [ %.pn58.pn, %163 ], [ %155, %154 ]
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %24) #7
  br label %165

165:                                              ; preds = %164, %152
  %.pn58.pn.pn.pn = phi { ptr, i32 } [ %.pn58.pn.pn, %164 ], [ %153, %152 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %24) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %23) #7
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %22) #7
  br label %166

166:                                              ; preds = %165, %150
  %.pn58.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn58.pn.pn.pn, %165 ], [ %151, %150 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %22) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %21) #7
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #7
  br label %167

167:                                              ; preds = %166, %148
  %.pn58.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn58.pn.pn.pn.pn, %166 ], [ %149, %148 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %19) #7
  br label %266

168:                                              ; preds = %111
  %169 = landingpad { ptr, i32 }
          cleanup
  br label %175

170:                                              ; preds = %113
  %171 = landingpad { ptr, i32 }
          cleanup
  br label %174

172:                                              ; preds = %114
  %173 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %26) #7
  br label %174

174:                                              ; preds = %172, %170
  %.pn65 = phi { ptr, i32 } [ %173, %172 ], [ %171, %170 ]
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %27) #7
  br label %175

175:                                              ; preds = %174, %168
  %.pn65.pn = phi { ptr, i32 } [ %.pn65, %174 ], [ %169, %168 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %27) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %26) #7
  br label %265

176:                                              ; preds = %115
  %177 = landingpad { ptr, i32 }
          cleanup
  br label %264

178:                                              ; preds = %118
  %179 = landingpad { ptr, i32 }
          cleanup
  br label %182

180:                                              ; preds = %119
  %181 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %29) #7
  br label %182

182:                                              ; preds = %180, %178
  %.pn68 = phi { ptr, i32 } [ %181, %180 ], [ %179, %178 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %29) #7
  br label %263

183:                                              ; preds = %117, %120
  %brmerge94 = or i1 %2, %3
  br i1 %brmerge94, label %192, label %184

184:                                              ; preds = %183
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %30) #7
  invoke void @_ZN3sim7DegreesC1Ed(ptr noundef nonnull align 8 dereferenceable(16) %30, double noundef 9.000000e+01)
          to label %185 unwind label %187

185:                                              ; preds = %184
  invoke void @_ZN3sim7RadiansmIERKNS_5AngleE(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(16) %30)
          to label %186 unwind label %189

186:                                              ; preds = %185
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %30) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %30) #7
  br label %192

187:                                              ; preds = %184
  %188 = landingpad { ptr, i32 }
          cleanup
  br label %191

189:                                              ; preds = %185
  %190 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %30) #7
  br label %191

191:                                              ; preds = %189, %187
  %.pn70 = phi { ptr, i32 } [ %190, %189 ], [ %188, %187 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %30) #7
  br label %263

192:                                              ; preds = %183, %186
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %31) #7
  %193 = load ptr, ptr %87, align 8, !tbaa !12
  invoke void @_ZNK3sim5Mouse21getCurrentTranslationEv(ptr dead_on_unwind nonnull writable sret(%"class.sim::Cartesian") align 8 %31, ptr noundef nonnull align 8 dereferenceable(528) %193)
          to label %194 unwind label %224

194:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %32) #7
  invoke void @_ZNK3sim10Coordinate8getThetaEv(ptr dead_on_unwind nonnull writable sret(%"class.sim::Radians") align 8 %32, ptr noundef nonnull align 8 dereferenceable(40) %25)
          to label %195 unwind label %226

195:                                              ; preds = %194
  invoke void @_ZN3sim14MouseInterface6turnToERKNS_9CartesianERKNS_7RadiansE(ptr noundef nonnull align 8 dereferenceable(296) %0, ptr noundef nonnull align 8 dereferenceable(40) %31, ptr noundef nonnull align 8 dereferenceable(16) %32)
          to label %196 unwind label %228

196:                                              ; preds = %195
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %32) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %32) #7
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %31) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %31) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %33) #7
  %197 = load ptr, ptr %87, align 8, !tbaa !12
  invoke void @_ZNK3sim5Mouse18getCurrentRotationEv(ptr dead_on_unwind nonnull writable sret(%"class.sim::Radians") align 8 %33, ptr noundef nonnull align 8 dereferenceable(528) %197)
          to label %198 unwind label %232

198:                                              ; preds = %196
  invoke void @_ZN3sim14MouseInterface13moveForwardToERKNS_9CartesianERKNS_7RadiansE(ptr noundef nonnull align 8 dereferenceable(296) %0, ptr noundef nonnull align 8 dereferenceable(40) %18, ptr noundef nonnull align 8 dereferenceable(16) %33)
          to label %199 unwind label %234

199:                                              ; preds = %198
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %33) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %33) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %34) #7
  %200 = load ptr, ptr %87, align 8, !tbaa !12
  invoke void @_ZNK3sim5Mouse21getCurrentTranslationEv(ptr dead_on_unwind nonnull writable sret(%"class.sim::Cartesian") align 8 %34, ptr noundef nonnull align 8 dereferenceable(528) %200)
          to label %201 unwind label %237

201:                                              ; preds = %199
  invoke void @_ZN3sim14MouseInterface6turnToERKNS_9CartesianERKNS_7RadiansE(ptr noundef nonnull align 8 dereferenceable(296) %0, ptr noundef nonnull align 8 dereferenceable(40) %34, ptr noundef nonnull align 8 dereferenceable(16) %28)
          to label %202 unwind label %239

202:                                              ; preds = %201
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %34) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %34) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %35) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %36) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %37) #7
  %203 = invoke noundef ptr @_ZN3sim1PEv()
          to label %204 unwind label %242

204:                                              ; preds = %202
  %205 = invoke noundef double @_ZN3sim5Param9wallWidthEv(ptr noundef nonnull align 8 dereferenceable(1056) %203)
          to label %206 unwind label %242

206:                                              ; preds = %204
  %207 = fmul double %205, 5.000000e-01
  invoke void @_ZN3sim6MetersC1Ed(ptr noundef nonnull align 8 dereferenceable(16) %37, double noundef %207)
          to label %208 unwind label %242

208:                                              ; preds = %206
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %38) #7
  %209 = load ptr, ptr %87, align 8, !tbaa !12
  invoke void @_ZNK3sim5Mouse18getCurrentRotationEv(ptr dead_on_unwind nonnull writable sret(%"class.sim::Radians") align 8 %38, ptr noundef nonnull align 8 dereferenceable(528) %209)
          to label %210 unwind label %244

210:                                              ; preds = %208
  invoke void @_ZN3sim5PolarC1ERKNS_8DistanceERKNS_5AngleE(ptr noundef nonnull align 8 dereferenceable(40) %36, ptr noundef nonnull align 8 dereferenceable(16) %37, ptr noundef nonnull align 8 dereferenceable(16) %38)
          to label %211 unwind label %246

211:                                              ; preds = %210
  invoke void @_ZNK3sim9CartesianplERKNS_10CoordinateE(ptr dead_on_unwind nonnull writable sret(%"class.sim::Cartesian") align 8 %35, ptr noundef nonnull align 8 dereferenceable(40) %18, ptr noundef nonnull align 8 dereferenceable(40) %36)
          to label %212 unwind label %248

212:                                              ; preds = %211
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %39) #7
  %213 = load ptr, ptr %87, align 8, !tbaa !12
  invoke void @_ZNK3sim5Mouse18getCurrentRotationEv(ptr dead_on_unwind nonnull writable sret(%"class.sim::Radians") align 8 %39, ptr noundef nonnull align 8 dereferenceable(528) %213)
          to label %214 unwind label %250

214:                                              ; preds = %212
  invoke void @_ZN3sim14MouseInterface13moveForwardToERKNS_9CartesianERKNS_7RadiansE(ptr noundef nonnull align 8 dereferenceable(296) %0, ptr noundef nonnull align 8 dereferenceable(40) %35, ptr noundef nonnull align 8 dereferenceable(16) %39)
          to label %215 unwind label %252

215:                                              ; preds = %214
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %39) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %39) #7
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %35) #7
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %36) #7
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %38) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %38) #7
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %37) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %37) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %36) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %35) #7
  br i1 %.045, label %216, label %261

216:                                              ; preds = %215
  %217 = invoke noundef ptr @_ZN3sim1SEv()
          to label %218 unwind label %259

218:                                              ; preds = %216
  %219 = invoke noundef zeroext i1 @_ZN3sim5State7crashedEv(ptr noundef nonnull align 8 dereferenceable(168) %217)
          to label %220 unwind label %259

220:                                              ; preds = %218
  br i1 %219, label %261, label %221

221:                                              ; preds = %220
  %222 = invoke noundef ptr @_ZN3sim1SEv()
          to label %223 unwind label %259

223:                                              ; preds = %221
  invoke void @_ZN3sim5State10setCrashedEv(ptr noundef nonnull align 8 dereferenceable(168) %222)
          to label %261 unwind label %259

224:                                              ; preds = %192
  %225 = landingpad { ptr, i32 }
          cleanup
  br label %231

226:                                              ; preds = %194
  %227 = landingpad { ptr, i32 }
          cleanup
  br label %230

228:                                              ; preds = %195
  %229 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %32) #7
  br label %230

230:                                              ; preds = %228, %226
  %.pn72 = phi { ptr, i32 } [ %229, %228 ], [ %227, %226 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %32) #7
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %31) #7
  br label %231

231:                                              ; preds = %230, %224
  %.pn72.pn = phi { ptr, i32 } [ %.pn72, %230 ], [ %225, %224 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %31) #7
  br label %263

232:                                              ; preds = %196
  %233 = landingpad { ptr, i32 }
          cleanup
  br label %236

234:                                              ; preds = %198
  %235 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %33) #7
  br label %236

236:                                              ; preds = %234, %232
  %.pn75 = phi { ptr, i32 } [ %235, %234 ], [ %233, %232 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %33) #7
  br label %263

237:                                              ; preds = %199
  %238 = landingpad { ptr, i32 }
          cleanup
  br label %241

239:                                              ; preds = %201
  %240 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %34) #7
  br label %241

241:                                              ; preds = %239, %237
  %.pn77 = phi { ptr, i32 } [ %240, %239 ], [ %238, %237 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %34) #7
  br label %263

242:                                              ; preds = %206, %204, %202
  %243 = landingpad { ptr, i32 }
          cleanup
  br label %258

244:                                              ; preds = %208
  %245 = landingpad { ptr, i32 }
          cleanup
  br label %257

246:                                              ; preds = %210
  %247 = landingpad { ptr, i32 }
          cleanup
  br label %256

248:                                              ; preds = %211
  %249 = landingpad { ptr, i32 }
          cleanup
  br label %255

250:                                              ; preds = %212
  %251 = landingpad { ptr, i32 }
          cleanup
  br label %254

252:                                              ; preds = %214
  %253 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %39) #7
  br label %254

254:                                              ; preds = %252, %250
  %.pn79 = phi { ptr, i32 } [ %253, %252 ], [ %251, %250 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %39) #7
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %35) #7
  br label %255

255:                                              ; preds = %254, %248
  %.pn79.pn = phi { ptr, i32 } [ %.pn79, %254 ], [ %249, %248 ]
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %36) #7
  br label %256

256:                                              ; preds = %255, %246
  %.pn79.pn.pn = phi { ptr, i32 } [ %.pn79.pn, %255 ], [ %247, %246 ]
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %38) #7
  br label %257

257:                                              ; preds = %256, %244
  %.pn79.pn.pn.pn = phi { ptr, i32 } [ %.pn79.pn.pn, %256 ], [ %245, %244 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %38) #7
  call void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %37) #7
  br label %258

258:                                              ; preds = %257, %242
  %.pn79.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn79.pn.pn.pn, %257 ], [ %243, %242 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %37) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %36) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %35) #7
  br label %263

259:                                              ; preds = %223, %221, %218, %216
  %260 = landingpad { ptr, i32 }
          cleanup
  br label %263

261:                                              ; preds = %223, %220, %215
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %28) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %28) #7
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %25) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %25) #7
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %18) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %18) #7
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %11) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %11) #7
  br label %262

262:                                              ; preds = %4, %261
  ret void

263:                                              ; preds = %259, %258, %241, %236, %231, %191, %182
  %.pn85 = phi { ptr, i32 } [ %260, %259 ], [ %.pn79.pn.pn.pn.pn, %258 ], [ %.pn77, %241 ], [ %.pn75, %236 ], [ %.pn72.pn, %231 ], [ %.pn70, %191 ], [ %.pn68, %182 ]
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %28) #7
  br label %264

264:                                              ; preds = %263, %176
  %.pn85.pn = phi { ptr, i32 } [ %.pn85, %263 ], [ %177, %176 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %28) #7
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %25) #7
  br label %265

265:                                              ; preds = %264, %175
  %.pn85.pn.pn = phi { ptr, i32 } [ %.pn85.pn, %264 ], [ %.pn65.pn, %175 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %25) #7
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %18) #7
  br label %266

266:                                              ; preds = %265, %167
  %.pn85.pn.pn.pn = phi { ptr, i32 } [ %.pn85.pn.pn, %265 ], [ %.pn58.pn.pn.pn.pn.pn, %167 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %18) #7
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %11) #7
  br label %267

267:                                              ; preds = %266, %147
  %.pn85.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn85.pn.pn.pn, %266 ], [ %.pn52.pn.pn.pn.pn, %147 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %11) #7
  br label %268

268:                                              ; preds = %267, %130, %125
  %.pn85.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn85.pn.pn.pn.pn, %267 ], [ %.pn50, %130 ], [ %.pn, %125 ]
  resume { ptr, i32 } %.pn85.pn.pn.pn.pn.pn
}

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

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

declare void @_ZNK3sim5Mouse18getCurrentRotationEv(ptr dead_on_unwind writable sret(%"class.sim::Radians") align 8, ptr noundef nonnull align 8 dereferenceable(528)) local_unnamed_addr #2

; 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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3sim14MouseInterface13moveForwardToERKNS_9CartesianERKNS_7RadiansE(ptr noundef nonnull align 8 dereferenceable(296), ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

declare noundef zeroext i1 @_ZN3sim5State7crashedEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #2

declare void @_ZN3sim5State10setCrashedEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3sim14MouseInterface6turnToERKNS_9CartesianERKNS_7RadiansE(ptr noundef nonnull align 8 dereferenceable(296), ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

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

declare void @_ZNK3sim9CartesianmiERKNS_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 #2

declare void @_ZN3sim5PolarC1ERKNS_10CoordinateE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #2

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

declare void @_ZN3sim7RadianspLERKNS_5AngleE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

declare void @_ZN3sim7RadiansmIERKNS_5AngleE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2el6Logger4warnIPKcJiEEEvS3_RKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728), ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2el6Logger4warnIPKcJS3_iEEEvS3_RKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728), ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #6

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

declare noundef double @_ZNK3sim4Area16getMetersSquaredEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

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

declare void @_ZNK3sim7DegreesmlEd(ptr dead_on_unwind writable sret(%"class.sim::Degrees") align 8, ptr noundef nonnull align 8 dereferenceable(16), double noundef) local_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 = { 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 = { 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 #6 = { mustprogress nofree nounwind willreturn memory(write) "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 = { 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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!"branch_weights", i32 1, i32 1048575}
!12 = !{!13, !10, i64 8}
!13 = !{!"_ZTSN3sim14MouseInterfaceE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !14, i64 32, !23, i64 80, !27, i64 192, !28, i64 200, !28, i64 248}
!14 = !{!"_ZTSSt3setIcSt4lessIcESaIcEE", !15, i64 0}
!15 = !{!"_ZTSSt8_Rb_treeIccSt9_IdentityIcESt4lessIcESaIcEE", !16, i64 0}
!16 = !{!"_ZTSNSt8_Rb_treeIccSt9_IdentityIcESt4lessIcESaIcEE13_Rb_tree_implIS3_Lb1EEE", !17, i64 0, !19, i64 8}
!17 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIcEE", !18, i64 0}
!18 = !{!"_ZTSSt4lessIcE"}
!19 = !{!"_ZTSSt15_Rb_tree_header", !20, i64 0, !22, i64 32}
!20 = !{!"_ZTSSt18_Rb_tree_node_base", !21, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!21 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!22 = !{!"long", !7, i64 0}
!23 = !{!"_ZTSN3sim27StaticMouseAlgorithmOptionsE", !24, i64 0, !24, i64 32, !24, i64 64, !6, i64 96, !6, i64 100, !26, i64 104}
!24 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !25, i64 0, !22, i64 8, !7, i64 16}
!25 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !10, i64 0}
!26 = !{!"double", !7, i64 0}
!27 = !{!"bool", !7, i64 0}
!28 = !{!"_ZTSSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSSt8_Rb_treeISt4pairIiiES1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE", !30, i64 0}
!30 = !{!"_ZTSNSt8_Rb_treeISt4pairIiiES1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE13_Rb_tree_implIS5_Lb1EEE", !31, i64 0, !19, i64 8}
!31 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessISt4pairIiiEEE", !32, i64 0}
!32 = !{!"_ZTSSt4lessISt4pairIiiEE"}


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