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

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

%"class.std::map.6" = type { %"class.std::_Rb_tree.7" }
%"class.std::_Rb_tree.7" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, sim::InterfaceType>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, sim::InterfaceType>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, sim::InterfaceType>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, sim::InterfaceType>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.sim::Meters" = type { %"class.sim::Distance" }
%"class.sim::Distance" = type { ptr, double }
%"class.std::vector.159" = type { %"struct.std::_Vector_base.160" }
%"struct.std::_Vector_base.160" = type { %"struct.std::_Vector_base<sim::Cartesian, std::allocator<sim::Cartesian>>::_Vector_impl" }
%"struct.std::_Vector_base<sim::Cartesian, std::allocator<sim::Cartesian>>::_Vector_impl" = type { %"struct.std::_Vector_base<sim::Cartesian, std::allocator<sim::Cartesian>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sim::Cartesian, std::allocator<sim::Cartesian>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.sim::Polygon" = type { %"class.std::vector.159", %"class.std::vector.164" }
%"class.std::vector.164" = type { %"struct.std::_Vector_base.165" }
%"struct.std::_Vector_base.165" = type { %"struct.std::_Vector_base<sim::Triangle, std::allocator<sim::Triangle>>::_Vector_impl" }
%"struct.std::_Vector_base<sim::Triangle, std::allocator<sim::Triangle>>::_Vector_impl" = type { %"struct.std::_Vector_base<sim::Triangle, std::allocator<sim::Triangle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sim::Triangle, std::allocator<sim::Triangle>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.sim::Cartesian" = type { %"class.sim::Coordinate" }
%"class.sim::Coordinate" = type { ptr, %"class.sim::Meters", %"class.sim::Meters" }
%"class.sim::Radians" = type { %"class.sim::Angle" }
%"class.sim::Angle" = type { ptr, double }
%"class.sim::Seconds" = type { %"class.sim::Duration" }
%"class.sim::Duration" = type { ptr, double }
%"class.sim::World" = type <{ ptr, ptr, %"struct.sim::StaticMouseAlgorithmOptions", %"class.sim::Seconds", %"class.sim::Seconds", %"class.std::set", i32, [4 x i8] }>
%"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" = type { %"class.std::_Rb_tree.143" }
%"class.std::_Rb_tree.143" = 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
@_ZN3simL24STRING_TO_INTERFACE_TYPEB5cxx11E = external hidden global %"class.std::map.6", align 8
@_ZZN3sim5World14checkCollisionEvE13halfWallWidth = external hidden global %"class.sim::Meters", align 8
@_ZGVZN3sim5World14checkCollisionEvE13halfWallWidth = external hidden global i64, align 8
@_ZZN3sim5World14checkCollisionEvE10tileLength = external hidden global %"class.sim::Meters", align 8
@_ZGVZN3sim5World14checkCollisionEvE10tileLength = external hidden global i64, align 8
@.str.32 = external hidden unnamed_addr constant [72 x i8], align 1

; 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 @_ZN3sim7SecondsC1Ed(ptr noundef nonnull align 8 dereferenceable(16), double noundef) unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3sim5World14checkCollisionEv(ptr noundef nonnull align 8 dereferenceable(212) %0) #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca double, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::vector.159", align 8
  %7 = alloca %"class.sim::Polygon", align 8
  %8 = alloca %"class.sim::Cartesian", align 8
  %9 = alloca %"class.sim::Radians", align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.sim::Cartesian", align 8
  %14 = alloca %"class.sim::Cartesian", align 8
  %15 = alloca %"class.sim::Cartesian", align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca %"class.sim::Seconds", align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %23 = load ptr, ptr %2, align 8
  %24 = call noundef ptr @_ZN3sim1PEv()
  %25 = call noundef zeroext i1 @_ZN3sim5Param25collisionDetectionEnabledEv(ptr noundef nonnull align 8 dereferenceable(1056) %24)
  br i1 %25, label %27, label %26

26:                                               ; preds = %1
  br label %258

27:                                               ; preds = %1
  %28 = getelementptr inbounds %"class.sim::World", ptr %23, i32 0, i32 2
  %29 = getelementptr inbounds %"struct.sim::StaticMouseAlgorithmOptions", ptr %28, i32 0, i32 1
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3sim13InterfaceTypeESt4lessIS5_ESaISt4pairIKS5_S7_EEE2atERSB_(ptr noundef nonnull align 8 dereferenceable(48) @_ZN3simL24STRING_TO_INTERFACE_TYPEB5cxx11E, ptr noundef nonnull align 8 dereferenceable(32) %29)
  %31 = load i32, ptr %30, align 4, !tbaa !9
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %34

33:                                               ; preds = %27
  br label %258

34:                                               ; preds = %27
  br label %35

35:                                               ; preds = %243, %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #0
  %36 = call noundef double @_ZN3sim12SimUtilities19getHighResTimestampEv()
  store double %36, ptr %3, align 8, !tbaa !11
  %37 = load atomic i8, ptr @_ZGVZN3sim5World14checkCollisionEvE13halfWallWidth acquire, align 8
  %38 = icmp eq i8 %37, 0
  br i1 %38, label %39, label %50, !prof !13

39:                                               ; preds = %35
  %40 = call i32 @__cxa_guard_acquire(ptr @_ZGVZN3sim5World14checkCollisionEvE13halfWallWidth) #0
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %50

42:                                               ; preds = %39
  %43 = invoke noundef ptr @_ZN3sim1PEv()
          to label %44 unwind label %84

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

46:                                               ; preds = %44
  %47 = fdiv double %45, 2.000000e+00
  invoke void @_ZN3sim6MetersC1Ed(ptr noundef nonnull align 8 dereferenceable(16) @_ZZN3sim5World14checkCollisionEvE13halfWallWidth, double noundef %47)
          to label %48 unwind label %84

48:                                               ; preds = %46
  %49 = call i32 @__cxa_atexit(ptr @_ZN3sim8DistanceD2Ev, ptr @_ZZN3sim5World14checkCollisionEvE13halfWallWidth, ptr @__dso_handle) #0
  call void @__cxa_guard_release(ptr @_ZGVZN3sim5World14checkCollisionEvE13halfWallWidth) #0
  br label %50

50:                                               ; preds = %48, %39, %35
  %51 = load atomic i8, ptr @_ZGVZN3sim5World14checkCollisionEvE10tileLength acquire, align 8
  %52 = icmp eq i8 %51, 0
  br i1 %52, label %53, label %68, !prof !13

53:                                               ; preds = %50
  %54 = call i32 @__cxa_guard_acquire(ptr @_ZGVZN3sim5World14checkCollisionEvE10tileLength) #0
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %68

56:                                               ; preds = %53
  %57 = invoke noundef ptr @_ZN3sim1PEv()
          to label %58 unwind label %88

58:                                               ; preds = %56
  %59 = invoke noundef double @_ZN3sim5Param10wallLengthEv(ptr noundef nonnull align 8 dereferenceable(1056) %57)
          to label %60 unwind label %88

60:                                               ; preds = %58
  %61 = invoke noundef ptr @_ZN3sim1PEv()
          to label %62 unwind label %88

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

64:                                               ; preds = %62
  %65 = fadd double %59, %63
  invoke void @_ZN3sim6MetersC1Ed(ptr noundef nonnull align 8 dereferenceable(16) @_ZZN3sim5World14checkCollisionEvE10tileLength, double noundef %65)
          to label %66 unwind label %88

66:                                               ; preds = %64
  %67 = call i32 @__cxa_atexit(ptr @_ZN3sim8DistanceD2Ev, ptr @_ZZN3sim5World14checkCollisionEvE10tileLength, ptr @__dso_handle) #0
  call void @__cxa_guard_release(ptr @_ZGVZN3sim5World14checkCollisionEvE10tileLength) #0
  br label %68

68:                                               ; preds = %66, %53, %50
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #0
  call void @llvm.lifetime.start.p0(i64 48, ptr %7) #0
  %69 = getelementptr inbounds %"class.sim::World", ptr %23, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 40, ptr %8) #0
  %71 = getelementptr inbounds %"class.sim::World", ptr %23, i32 0, i32 1
  %72 = load ptr, ptr %71, align 8, !tbaa !14
  call void @_ZNK3sim5Mouse21getCurrentTranslationEv(ptr dead_on_unwind writable sret(%"class.sim::Cartesian") align 8 %8, ptr noundef nonnull align 8 dereferenceable(528) %72)
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #0
  %73 = getelementptr inbounds %"class.sim::World", ptr %23, i32 0, i32 1
  %74 = load ptr, ptr %73, align 8, !tbaa !14
  invoke void @_ZNK3sim5Mouse18getCurrentRotationEv(ptr dead_on_unwind writable sret(%"class.sim::Radians") align 8 %9, ptr noundef nonnull align 8 dereferenceable(528) %74)
          to label %75 unwind label %92

75:                                               ; preds = %68
  invoke void @_ZNK3sim5Mouse26getCurrentCollisionPolygonERKNS_10CoordinateERKNS_5AngleE(ptr dead_on_unwind writable sret(%"class.sim::Polygon") align 8 %7, ptr noundef nonnull align 8 dereferenceable(528) %70, ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %76 unwind label %96

76:                                               ; preds = %75
  invoke void @_ZNK3sim7Polygon11getVerticesEv(ptr dead_on_unwind writable sret(%"class.std::vector.159") align 8 %6, ptr noundef nonnull align 8 dereferenceable(48) %7)
          to label %77 unwind label %100

77:                                               ; preds = %76
  call void @_ZN3sim7PolygonD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #0
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #0
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #0
  call void @llvm.lifetime.end.p0(i64 48, ptr %7) #0
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #0
  store i32 0, ptr %10, align 4, !tbaa !31
  br label %78

78:                                               ; preds = %155, %77
  %79 = load i32, ptr %10, align 4, !tbaa !31
  %80 = sext i32 %79 to i64
  %81 = call noundef i64 @_ZNKSt6vectorIN3sim9CartesianESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #0
  %82 = icmp ult i64 %80, %81
  br i1 %82, label %106, label %83

83:                                               ; preds = %78
  store i32 4, ptr %11, align 4
  br label %161

84:                                               ; preds = %46, %44, %42
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %4, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %5, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZN3sim5World14checkCollisionEvE13halfWallWidth) #0
  br label %257

88:                                               ; preds = %64, %62, %60, %58, %56
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %4, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %5, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZN3sim5World14checkCollisionEvE10tileLength) #0
  br label %257

92:                                               ; preds = %68
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %4, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %5, align 4
  br label %105

96:                                               ; preds = %75
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %4, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %5, align 4
  br label %104

100:                                              ; preds = %76
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %4, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %5, align 4
  call void @_ZN3sim7PolygonD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #0
  br label %104

104:                                              ; preds = %100, %96
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #0
  br label %105

105:                                              ; preds = %104, %92
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #0
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #0
  call void @llvm.lifetime.end.p0(i64 48, ptr %7) #0
  br label %256

106:                                              ; preds = %78
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #0
  %107 = load i32, ptr %10, align 4, !tbaa !31
  %108 = add nsw i32 %107, 1
  %109 = sext i32 %108 to i64
  %110 = call noundef i64 @_ZNKSt6vectorIN3sim9CartesianESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #0
  %111 = urem i64 %109, %110
  %112 = trunc i64 %111 to i32
  store i32 %112, ptr %12, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 40, ptr %13) #0
  %113 = load i32, ptr %10, align 4, !tbaa !31
  %114 = sext i32 %113 to i64
  %115 = invoke noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN3sim9CartesianESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %114)
          to label %116 unwind label %130

116:                                              ; preds = %106
  call void @_ZN3sim9CartesianC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(40) %13, ptr noundef nonnull align 8 dereferenceable(40) %115) #0
  call void @llvm.lifetime.start.p0(i64 40, ptr %14) #0
  %117 = load i32, ptr %12, align 4, !tbaa !31
  %118 = sext i32 %117 to i64
  %119 = invoke noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN3sim9CartesianESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %118)
          to label %120 unwind label %134

120:                                              ; preds = %116
  call void @_ZN3sim9CartesianC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(40) %14, ptr noundef nonnull align 8 dereferenceable(40) %119) #0
  call void @llvm.lifetime.start.p0(i64 40, ptr %15) #0
  %121 = getelementptr inbounds %"class.sim::World", ptr %23, i32 0, i32 0
  %122 = load ptr, ptr %121, align 8, !tbaa !32
  invoke void @_ZN3sim17GeometryUtilities7castRayERKNS_9CartesianES3_RKNS_4MazeERKNS_6MetersES9_(ptr dead_on_unwind writable sret(%"class.sim::Cartesian") align 8 %15, ptr noundef nonnull align 8 dereferenceable(40) %13, ptr noundef nonnull align 8 dereferenceable(40) %14, ptr noundef nonnull align 8 dereferenceable(26) %122, ptr noundef nonnull align 8 dereferenceable(16) @_ZZN3sim5World14checkCollisionEvE13halfWallWidth, ptr noundef nonnull align 8 dereferenceable(16) @_ZZN3sim5World14checkCollisionEvE10tileLength)
          to label %123 unwind label %138

123:                                              ; preds = %120
  %124 = invoke noundef zeroext i1 @_ZNK3sim10CoordinateneERKS0_(ptr noundef nonnull align 8 dereferenceable(40) %15, ptr noundef nonnull align 8 dereferenceable(40) %14)
          to label %125 unwind label %142

125:                                              ; preds = %123
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %15) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %15) #0
  br i1 %124, label %126, label %151

126:                                              ; preds = %125
  %127 = invoke noundef ptr @_ZN3sim1SEv()
          to label %128 unwind label %147

128:                                              ; preds = %126
  invoke void @_ZN3sim5State10setCrashedEv(ptr noundef nonnull align 8 dereferenceable(168) %127)
          to label %129 unwind label %147

129:                                              ; preds = %128
  store i32 1, ptr %11, align 4
  br label %152

130:                                              ; preds = %106
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %4, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %5, align 4
  br label %160

134:                                              ; preds = %116
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %4, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %5, align 4
  br label %159

138:                                              ; preds = %120
  %139 = landingpad { ptr, i32 }
          cleanup
  %140 = extractvalue { ptr, i32 } %139, 0
  store ptr %140, ptr %4, align 8
  %141 = extractvalue { ptr, i32 } %139, 1
  store i32 %141, ptr %5, align 4
  br label %146

142:                                              ; preds = %123
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %4, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %5, align 4
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %15) #0
  br label %146

146:                                              ; preds = %142, %138
  call void @llvm.lifetime.end.p0(i64 40, ptr %15) #0
  br label %158

147:                                              ; preds = %128, %126
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %4, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %5, align 4
  br label %158

151:                                              ; preds = %125
  store i32 0, ptr %11, align 4
  br label %152

152:                                              ; preds = %151, %129
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %14) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #0
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %13) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #0
  %153 = load i32, ptr %11, align 4
  switch i32 %153, label %161 [
    i32 0, label %154
  ]

154:                                              ; preds = %152
  br label %155

155:                                              ; preds = %154
  %156 = load i32, ptr %10, align 4, !tbaa !31
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %10, align 4, !tbaa !31
  br label %78, !llvm.loop !33

158:                                              ; preds = %147, %146
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %14) #0
  br label %159

159:                                              ; preds = %158, %134
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #0
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %13) #0
  br label %160

160:                                              ; preds = %159, %130
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #0
  br label %255

161:                                              ; preds = %152, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #0
  %162 = load i32, ptr %11, align 4
  switch i32 %162, label %241 [
    i32 4, label %163
  ]

163:                                              ; preds = %161
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #0
  %164 = invoke noundef double @_ZN3sim12SimUtilities19getHighResTimestampEv()
          to label %165 unwind label %210

165:                                              ; preds = %163
  store double %164, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #0
  %166 = load double, ptr %16, align 8, !tbaa !11
  %167 = load double, ptr %3, align 8, !tbaa !11
  %168 = fsub double %166, %167
  store double %168, ptr %17, align 8, !tbaa !11
  %169 = invoke noundef ptr @_ZN3sim1PEv()
          to label %170 unwind label %214

170:                                              ; preds = %165
  %171 = invoke noundef zeroext i1 @_ZN3sim5Param28printLateCollisionDetectionsEv(ptr noundef nonnull align 8 dereferenceable(1056) %169)
          to label %172 unwind label %214

172:                                              ; preds = %170
  br i1 %171, label %173, label %227

173:                                              ; preds = %172
  %174 = load double, ptr %17, align 8, !tbaa !11
  %175 = invoke noundef ptr @_ZN3sim1PEv()
          to label %176 unwind label %214

176:                                              ; preds = %173
  %177 = invoke noundef i32 @_ZN3sim5Param22collisionDetectionRateEv(ptr noundef nonnull align 8 dereferenceable(1056) %175)
          to label %178 unwind label %214

178:                                              ; preds = %176
  %179 = sitofp i32 %177 to double
  %180 = fdiv double 1.000000e+00, %179
  %181 = fcmp ogt double %174, %180
  br i1 %181, label %182, label %227

182:                                              ; preds = %178
  %183 = invoke noundef ptr @_ZN3sim1LEv()
          to label %184 unwind label %214

184:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #0
  %185 = load double, ptr %17, align 8, !tbaa !11
  %186 = invoke noundef ptr @_ZN3sim1PEv()
          to label %187 unwind label %218

187:                                              ; preds = %184
  %188 = invoke noundef i32 @_ZN3sim5Param22collisionDetectionRateEv(ptr noundef nonnull align 8 dereferenceable(1056) %186)
          to label %189 unwind label %218

189:                                              ; preds = %187
  %190 = sitofp i32 %188 to double
  %191 = fdiv double 1.000000e+00, %190
  %192 = fsub double %185, %191
  store double %192, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #0
  %193 = load double, ptr %17, align 8, !tbaa !11
  %194 = invoke noundef ptr @_ZN3sim1PEv()
          to label %195 unwind label %222

195:                                              ; preds = %189
  %196 = invoke noundef i32 @_ZN3sim5Param22collisionDetectionRateEv(ptr noundef nonnull align 8 dereferenceable(1056) %194)
          to label %197 unwind label %222

197:                                              ; preds = %195
  %198 = sitofp i32 %196 to double
  %199 = fdiv double 1.000000e+00, %198
  %200 = fsub double %193, %199
  %201 = invoke noundef ptr @_ZN3sim1PEv()
          to label %202 unwind label %222

202:                                              ; preds = %197
  %203 = invoke noundef i32 @_ZN3sim5Param22collisionDetectionRateEv(ptr noundef nonnull align 8 dereferenceable(1056) %201)
          to label %204 unwind label %222

204:                                              ; preds = %202
  %205 = sitofp i32 %203 to double
  %206 = fdiv double 1.000000e+00, %205
  %207 = fdiv double %200, %206
  %208 = fmul double %207, 1.000000e+02
  store double %208, ptr %19, align 8, !tbaa !11
  invoke void @_ZN2el6Logger4warnIdJdEEEvPKcRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728) %183, ptr noundef @.str.32, ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19)
          to label %209 unwind label %222

209:                                              ; preds = %204
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #0
  br label %227

210:                                              ; preds = %163
  %211 = landingpad { ptr, i32 }
          cleanup
  %212 = extractvalue { ptr, i32 } %211, 0
  store ptr %212, ptr %4, align 8
  %213 = extractvalue { ptr, i32 } %211, 1
  store i32 %213, ptr %5, align 4
  br label %254

214:                                              ; preds = %182, %176, %173, %170, %165
  %215 = landingpad { ptr, i32 }
          cleanup
  %216 = extractvalue { ptr, i32 } %215, 0
  store ptr %216, ptr %4, align 8
  %217 = extractvalue { ptr, i32 } %215, 1
  store i32 %217, ptr %5, align 4
  br label %253

218:                                              ; preds = %187, %184
  %219 = landingpad { ptr, i32 }
          cleanup
  %220 = extractvalue { ptr, i32 } %219, 0
  store ptr %220, ptr %4, align 8
  %221 = extractvalue { ptr, i32 } %219, 1
  store i32 %221, ptr %5, align 4
  br label %226

222:                                              ; preds = %204, %202, %197, %195, %189
  %223 = landingpad { ptr, i32 }
          cleanup
  %224 = extractvalue { ptr, i32 } %223, 0
  store ptr %224, ptr %4, align 8
  %225 = extractvalue { ptr, i32 } %223, 1
  store i32 %225, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #0
  br label %226

226:                                              ; preds = %222, %218
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #0
  br label %253

227:                                              ; preds = %209, %178, %172
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #0
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #0
  store double 0.000000e+00, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #0
  %228 = invoke noundef ptr @_ZN3sim1PEv()
          to label %229 unwind label %244

229:                                              ; preds = %227
  %230 = invoke noundef i32 @_ZN3sim5Param22collisionDetectionRateEv(ptr noundef nonnull align 8 dereferenceable(1056) %228)
          to label %231 unwind label %244

231:                                              ; preds = %229
  %232 = sitofp i32 %230 to double
  %233 = fdiv double 1.000000e+00, %232
  %234 = load double, ptr %17, align 8, !tbaa !11
  %235 = fsub double %233, %234
  store double %235, ptr %22, align 8, !tbaa !11
  %236 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22)
          to label %237 unwind label %244

237:                                              ; preds = %231
  %238 = load double, ptr %236, align 8, !tbaa !11
  invoke void @_ZN3sim7SecondsC1Ed(ptr noundef nonnull align 8 dereferenceable(16) %20, double noundef %238)
          to label %239 unwind label %244

239:                                              ; preds = %237
  invoke void @_ZN3sim12SimUtilities5sleepERKNS_8DurationE(ptr noundef nonnull align 8 dereferenceable(16) %20)
          to label %240 unwind label %248

240:                                              ; preds = %239
  call void @_ZN3sim8DurationD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #0
  store i32 0, ptr %11, align 4
  br label %241

241:                                              ; preds = %240, %161
  call void @_ZNSt6vectorIN3sim9CartesianESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #0
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #0
  %242 = load i32, ptr %11, align 4
  switch i32 %242, label %264 [
    i32 0, label %243
    i32 1, label %258
  ]

243:                                              ; preds = %241
  br label %35, !llvm.loop !35

244:                                              ; preds = %237, %231, %229, %227
  %245 = landingpad { ptr, i32 }
          cleanup
  %246 = extractvalue { ptr, i32 } %245, 0
  store ptr %246, ptr %4, align 8
  %247 = extractvalue { ptr, i32 } %245, 1
  store i32 %247, ptr %5, align 4
  br label %252

248:                                              ; preds = %239
  %249 = landingpad { ptr, i32 }
          cleanup
  %250 = extractvalue { ptr, i32 } %249, 0
  store ptr %250, ptr %4, align 8
  %251 = extractvalue { ptr, i32 } %249, 1
  store i32 %251, ptr %5, align 4
  call void @_ZN3sim8DurationD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #0
  br label %252

252:                                              ; preds = %248, %244
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #0
  br label %253

253:                                              ; preds = %252, %226, %214
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #0
  br label %254

254:                                              ; preds = %253, %210
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #0
  br label %255

255:                                              ; preds = %254, %160
  call void @_ZNSt6vectorIN3sim9CartesianESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #0
  br label %256

256:                                              ; preds = %255, %105
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #0
  br label %257

257:                                              ; preds = %256, %88, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #0
  br label %259

258:                                              ; preds = %241, %33, %26
  ret void

259:                                              ; preds = %257
  %260 = load ptr, ptr %4, align 8
  %261 = load i32, ptr %5, align 4
  %262 = insertvalue { ptr, i32 } poison, ptr %260, 0
  %263 = insertvalue { ptr, i32 } %262, i32 %261, 1
  resume { ptr, i32 } %263

264:                                              ; preds = %241
  unreachable
}

declare noundef double @_ZN3sim12SimUtilities19getHighResTimestampEv() #2

declare noundef ptr @_ZN3sim1SEv() #2

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

declare noundef ptr @_ZN3sim1PEv() #2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

declare noundef zeroext i1 @_ZN3sim5Param25collisionDetectionEnabledEv(ptr noundef nonnull align 8 dereferenceable(1056)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3sim13InterfaceTypeESt4lessIS5_ESaISt4pairIKS5_S7_EEE2atERSB_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(32)) #3 align 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 @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

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

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

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

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

declare void @_ZNK3sim7Polygon11getVerticesEv(ptr dead_on_unwind writable sret(%"class.std::vector.159") align 8, ptr noundef nonnull align 8 dereferenceable(48)) #2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN3sim9CartesianESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN3sim9CartesianESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

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

declare void @_ZN3sim17GeometryUtilities7castRayERKNS_9CartesianES3_RKNS_4MazeERKNS_6MetersES9_(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), ptr noundef nonnull align 8 dereferenceable(26), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #2

declare noundef zeroext i1 @_ZNK3sim10CoordinateneERKS0_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) #2

declare noundef zeroext i1 @_ZN3sim5Param28printLateCollisionDetectionsEv(ptr noundef nonnull align 8 dereferenceable(1056)) #2

declare noundef i32 @_ZN3sim5Param22collisionDetectionRateEv(ptr noundef nonnull align 8 dereferenceable(1056)) #2

declare noundef ptr @_ZN3sim1LEv() #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN3sim9CartesianESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #6 align 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 = { 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 #4 = { 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 #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 = !{!"_ZTSN3sim13InterfaceTypeE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!"branch_weights", i32 1, i32 1048575}
!14 = !{!15, !6, i64 8}
!15 = !{!"_ZTSN3sim5WorldE", !6, i64 0, !6, i64 8, !16, i64 16, !21, i64 128, !21, i64 144, !23, i64 160, !20, i64 208}
!16 = !{!"_ZTSN3sim27StaticMouseAlgorithmOptionsE", !17, i64 0, !17, i64 32, !17, i64 64, !20, i64 96, !20, i64 100, !12, i64 104}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !18, i64 0, !19, i64 8, !7, i64 16}
!18 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!"int", !7, i64 0}
!21 = !{!"_ZTSN3sim7SecondsE", !22, i64 0}
!22 = !{!"_ZTSN3sim8DurationE", !12, i64 8}
!23 = !{!"_ZTSSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE", !24, i64 0}
!24 = !{!"_ZTSSt8_Rb_treeISt4pairIiiES1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE", !25, i64 0}
!25 = !{!"_ZTSNSt8_Rb_treeISt4pairIiiES1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE13_Rb_tree_implIS5_Lb1EEE", !26, i64 0, !28, i64 8}
!26 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessISt4pairIiiEEE", !27, i64 0}
!27 = !{!"_ZTSSt4lessISt4pairIiiEE"}
!28 = !{!"_ZTSSt15_Rb_tree_header", !29, i64 0, !19, i64 32}
!29 = !{!"_ZTSSt18_Rb_tree_node_base", !30, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!30 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!31 = !{!20, !20, i64 0}
!32 = !{!15, !6, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = distinct !{!35, !34}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::map.6" = type { %"class.std::_Rb_tree.7" }
%"class.std::_Rb_tree.7" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, sim::InterfaceType>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, sim::InterfaceType>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, sim::InterfaceType>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, sim::InterfaceType>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.sim::Meters" = type { %"class.sim::Distance" }
%"class.sim::Distance" = type { ptr, double }
%"class.std::vector.159" = type { %"struct.std::_Vector_base.160" }
%"struct.std::_Vector_base.160" = type { %"struct.std::_Vector_base<sim::Cartesian, std::allocator<sim::Cartesian>>::_Vector_impl" }
%"struct.std::_Vector_base<sim::Cartesian, std::allocator<sim::Cartesian>>::_Vector_impl" = type { %"struct.std::_Vector_base<sim::Cartesian, std::allocator<sim::Cartesian>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sim::Cartesian, std::allocator<sim::Cartesian>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.sim::Polygon" = type { %"class.std::vector.159", %"class.std::vector.164" }
%"class.std::vector.164" = type { %"struct.std::_Vector_base.165" }
%"struct.std::_Vector_base.165" = type { %"struct.std::_Vector_base<sim::Triangle, std::allocator<sim::Triangle>>::_Vector_impl" }
%"struct.std::_Vector_base<sim::Triangle, std::allocator<sim::Triangle>>::_Vector_impl" = type { %"struct.std::_Vector_base<sim::Triangle, std::allocator<sim::Triangle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sim::Triangle, std::allocator<sim::Triangle>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.sim::Cartesian" = type { %"class.sim::Coordinate" }
%"class.sim::Coordinate" = type { ptr, %"class.sim::Meters", %"class.sim::Meters" }
%"class.sim::Radians" = type { %"class.sim::Angle" }
%"class.sim::Angle" = type { ptr, double }
%"class.sim::Seconds" = type { %"class.sim::Duration" }
%"class.sim::Duration" = type { ptr, double }

@__dso_handle = external hidden global i8
@_ZN3simL24STRING_TO_INTERFACE_TYPEB5cxx11E = external hidden global %"class.std::map.6", align 8
@_ZZN3sim5World14checkCollisionEvE13halfWallWidth = external hidden global %"class.sim::Meters", align 8
@_ZGVZN3sim5World14checkCollisionEvE13halfWallWidth = external hidden global i64, align 8
@_ZZN3sim5World14checkCollisionEvE10tileLength = external hidden global %"class.sim::Meters", align 8
@_ZGVZN3sim5World14checkCollisionEvE10tileLength = external hidden global i64, align 8
@.str.32 = external hidden unnamed_addr constant [72 x i8], align 1

; 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 @_ZN3sim7SecondsC1Ed(ptr noundef nonnull align 8 dereferenceable(16), double noundef) unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3sim5World14checkCollisionEv(ptr noundef nonnull align 8 dereferenceable(212) %0) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::vector.159", align 8
  %3 = alloca %"class.sim::Polygon", align 8
  %4 = alloca %"class.sim::Cartesian", align 8
  %5 = alloca %"class.sim::Radians", align 8
  %6 = alloca %"class.sim::Cartesian", align 8
  %7 = alloca %"class.sim::Cartesian", align 8
  %8 = alloca %"class.sim::Cartesian", align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca %"class.sim::Seconds", align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = tail call noundef ptr @_ZN3sim1PEv()
  %15 = tail call noundef zeroext i1 @_ZN3sim5Param25collisionDetectionEnabledEv(ptr noundef nonnull align 8 dereferenceable(1056) %14)
  br i1 %15, label %16, label %171

16:                                               ; preds = %1
  %17 = getelementptr inbounds i8, ptr %0, i64 48
  %18 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3sim13InterfaceTypeESt4lessIS5_ESaISt4pairIKS5_S7_EEE2atERSB_(ptr noundef nonnull align 8 dereferenceable(48) @_ZN3simL24STRING_TO_INTERFACE_TYPEB5cxx11E, ptr noundef nonnull align 8 dereferenceable(32) %17)
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %171, label %.preheader

.preheader:                                       ; preds = %16
  %21 = getelementptr inbounds i8, ptr %0, i64 8
  br label %22

22:                                               ; preds = %.preheader, %162
  %23 = call noundef double @_ZN3sim12SimUtilities19getHighResTimestampEv()
  %24 = load atomic i8, ptr @_ZGVZN3sim5World14checkCollisionEvE13halfWallWidth acquire, align 8
  %25 = icmp eq i8 %24, 0
  br i1 %25, label %26, label %36, !prof !9

26:                                               ; preds = %22
  %27 = call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZN3sim5World14checkCollisionEvE13halfWallWidth) #8
  %.not = icmp eq i32 %27, 0
  br i1 %.not, label %36, label %28

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

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

32:                                               ; preds = %30
  %33 = fmul double %31, 5.000000e-01
  invoke void @_ZN3sim6MetersC1Ed(ptr noundef nonnull align 8 dereferenceable(16) @_ZZN3sim5World14checkCollisionEvE13halfWallWidth, double noundef %33)
          to label %34 unwind label %60

34:                                               ; preds = %32
  %35 = call i32 @__cxa_atexit(ptr nonnull @_ZN3sim8DistanceD2Ev, ptr nonnull @_ZZN3sim5World14checkCollisionEvE13halfWallWidth, ptr nonnull @__dso_handle) #8
  call void @__cxa_guard_release(ptr nonnull @_ZGVZN3sim5World14checkCollisionEvE13halfWallWidth) #8
  br label %36

36:                                               ; preds = %34, %26, %22
  %37 = load atomic i8, ptr @_ZGVZN3sim5World14checkCollisionEvE10tileLength acquire, align 8
  %38 = icmp eq i8 %37, 0
  br i1 %38, label %39, label %53, !prof !9

39:                                               ; preds = %36
  %40 = call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZN3sim5World14checkCollisionEvE10tileLength) #8
  %.not36 = icmp eq i32 %40, 0
  br i1 %.not36, label %53, label %41

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

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

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

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

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

51:                                               ; preds = %49
  %52 = call i32 @__cxa_atexit(ptr nonnull @_ZN3sim8DistanceD2Ev, ptr nonnull @_ZZN3sim5World14checkCollisionEvE10tileLength, ptr nonnull @__dso_handle) #8
  call void @__cxa_guard_release(ptr nonnull @_ZGVZN3sim5World14checkCollisionEvE10tileLength) #8
  br label %53

53:                                               ; preds = %51, %39, %36
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #8
  %54 = load ptr, ptr %21, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #8
  call void @_ZNK3sim5Mouse21getCurrentTranslationEv(ptr dead_on_unwind nonnull writable sret(%"class.sim::Cartesian") align 8 %4, ptr noundef nonnull align 8 dereferenceable(528) %54)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #8
  %55 = load ptr, ptr %21, align 8, !tbaa !10
  invoke void @_ZNK3sim5Mouse18getCurrentRotationEv(ptr dead_on_unwind nonnull writable sret(%"class.sim::Radians") align 8 %5, ptr noundef nonnull align 8 dereferenceable(528) %55)
          to label %56 unwind label %64

56:                                               ; preds = %53
  invoke void @_ZNK3sim5Mouse26getCurrentCollisionPolygonERKNS_10CoordinateERKNS_5AngleE(ptr dead_on_unwind nonnull writable sret(%"class.sim::Polygon") align 8 %3, ptr noundef nonnull align 8 dereferenceable(528) %54, ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %57 unwind label %66

57:                                               ; preds = %56
  invoke void @_ZNK3sim7Polygon11getVerticesEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.159") align 8 %2, ptr noundef nonnull align 8 dereferenceable(48) %3)
          to label %58 unwind label %68

58:                                               ; preds = %57
  call void @_ZN3sim7PolygonD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #8
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #8
  %59 = call noundef i64 @_ZNKSt6vectorIN3sim9CartesianESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  %.not4559.not = icmp eq i64 %59, 0
  br i1 %.not4559.not, label %._crit_edge, label %.lr.ph

60:                                               ; preds = %32, %30, %28
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_guard_abort(ptr nonnull @_ZGVZN3sim5World14checkCollisionEvE13halfWallWidth) #8
  br label %170

62:                                               ; preds = %49, %47, %45, %43, %41
  %63 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_guard_abort(ptr nonnull @_ZGVZN3sim5World14checkCollisionEvE10tileLength) #8
  br label %170

64:                                               ; preds = %53
  %65 = landingpad { ptr, i32 }
          cleanup
  br label %71

66:                                               ; preds = %56
  %67 = landingpad { ptr, i32 }
          cleanup
  br label %70

68:                                               ; preds = %57
  %69 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3sim7PolygonD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #8
  br label %70

70:                                               ; preds = %68, %66
  %.pn = phi { ptr, i32 } [ %69, %68 ], [ %67, %66 ]
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #8
  br label %71

71:                                               ; preds = %70, %64
  %.pn.pn = phi { ptr, i32 } [ %.pn, %70 ], [ %65, %64 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #8
  br label %169

.lr.ph:                                           ; preds = %58, %96
  %indvars.iv = phi i64 [ %indvars.iv.next, %96 ], [ 0, %58 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %72 = call noundef i64 @_ZNKSt6vectorIN3sim9CartesianESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #8
  %73 = invoke noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN3sim9CartesianESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv)
          to label %74 unwind label %85

74:                                               ; preds = %.lr.ph
  %75 = urem i64 %indvars.iv.next, %72
  call void @_ZN3sim9CartesianC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(40) %6, ptr noundef nonnull align 8 dereferenceable(40) %73) #8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #8
  %76 = invoke noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN3sim9CartesianESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %75)
          to label %77 unwind label %87

77:                                               ; preds = %74
  call void @_ZN3sim9CartesianC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef nonnull align 8 dereferenceable(40) %76) #8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #8
  %78 = load ptr, ptr %0, align 8, !tbaa !29
  invoke void @_ZN3sim17GeometryUtilities7castRayERKNS_9CartesianES3_RKNS_4MazeERKNS_6MetersES9_(ptr dead_on_unwind nonnull writable sret(%"class.sim::Cartesian") align 8 %8, ptr noundef nonnull align 8 dereferenceable(40) %6, ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef nonnull align 8 dereferenceable(26) %78, ptr noundef nonnull align 8 dereferenceable(16) @_ZZN3sim5World14checkCollisionEvE13halfWallWidth, ptr noundef nonnull align 8 dereferenceable(16) @_ZZN3sim5World14checkCollisionEvE10tileLength)
          to label %79 unwind label %89

79:                                               ; preds = %77
  %80 = invoke noundef zeroext i1 @_ZNK3sim10CoordinateneERKS0_(ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef nonnull align 8 dereferenceable(40) %7)
          to label %81 unwind label %91

81:                                               ; preds = %79
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #8
  br i1 %80, label %82, label %96

82:                                               ; preds = %81
  %83 = invoke noundef ptr @_ZN3sim1SEv()
          to label %84 unwind label %94

84:                                               ; preds = %82
  invoke void @_ZN3sim5State10setCrashedEv(ptr noundef nonnull align 8 dereferenceable(168) %83)
          to label %.thread56 unwind label %94

85:                                               ; preds = %.lr.ph
  %86 = landingpad { ptr, i32 }
          cleanup
  br label %100

87:                                               ; preds = %74
  %88 = landingpad { ptr, i32 }
          cleanup
  br label %99

89:                                               ; preds = %77
  %90 = landingpad { ptr, i32 }
          cleanup
  br label %93

91:                                               ; preds = %79
  %92 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #8
  br label %93

93:                                               ; preds = %91, %89
  %.pn39 = phi { ptr, i32 } [ %92, %91 ], [ %90, %89 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #8
  br label %98

94:                                               ; preds = %84, %82
  %95 = landingpad { ptr, i32 }
          cleanup
  br label %98

.thread56:                                        ; preds = %84
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #8
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #8
  call void @_ZNSt6vectorIN3sim9CartesianESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #8
  br label %171

96:                                               ; preds = %81
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #8
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #8
  %97 = call noundef i64 @_ZNKSt6vectorIN3sim9CartesianESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  %.not45 = icmp ugt i64 %97, %indvars.iv.next
  br i1 %.not45, label %.lr.ph, label %._crit_edge, !llvm.loop !30

98:                                               ; preds = %94, %93
  %.pn41 = phi { ptr, i32 } [ %95, %94 ], [ %.pn39, %93 ]
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #8
  br label %99

99:                                               ; preds = %98, %87
  %.pn41.pn = phi { ptr, i32 } [ %.pn41, %98 ], [ %88, %87 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #8
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #8
  br label %100

100:                                              ; preds = %99, %85
  %.pn41.pn.pn = phi { ptr, i32 } [ %.pn41.pn, %99 ], [ %86, %85 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #8
  br label %168

._crit_edge:                                      ; preds = %96, %58
  %101 = invoke noundef double @_ZN3sim12SimUtilities19getHighResTimestampEv()
          to label %102 unwind label %142

102:                                              ; preds = %._crit_edge
  %103 = fsub double %101, %23
  %104 = invoke noundef ptr @_ZN3sim1PEv()
          to label %105 unwind label %144

105:                                              ; preds = %102
  %106 = invoke noundef zeroext i1 @_ZN3sim5Param28printLateCollisionDetectionsEv(ptr noundef nonnull align 8 dereferenceable(1056) %104)
          to label %107 unwind label %144

107:                                              ; preds = %105
  br i1 %106, label %108, label %151

108:                                              ; preds = %107
  %109 = invoke noundef ptr @_ZN3sim1PEv()
          to label %110 unwind label %144

110:                                              ; preds = %108
  %111 = invoke noundef i32 @_ZN3sim5Param22collisionDetectionRateEv(ptr noundef nonnull align 8 dereferenceable(1056) %109)
          to label %112 unwind label %144

112:                                              ; preds = %110
  %113 = sitofp i32 %111 to double
  %114 = fdiv double 1.000000e+00, %113
  %115 = fcmp ogt double %103, %114
  br i1 %115, label %116, label %151

116:                                              ; preds = %112
  %117 = invoke noundef ptr @_ZN3sim1LEv()
          to label %118 unwind label %144

118:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #8
  %119 = invoke noundef ptr @_ZN3sim1PEv()
          to label %120 unwind label %146

120:                                              ; preds = %118
  %121 = invoke noundef i32 @_ZN3sim5Param22collisionDetectionRateEv(ptr noundef nonnull align 8 dereferenceable(1056) %119)
          to label %122 unwind label %146

122:                                              ; preds = %120
  %123 = sitofp i32 %121 to double
  %124 = fdiv double 1.000000e+00, %123
  %125 = fsub double %103, %124
  store double %125, ptr %9, align 8, !tbaa !32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #8
  %126 = invoke noundef ptr @_ZN3sim1PEv()
          to label %127 unwind label %148

127:                                              ; preds = %122
  %128 = invoke noundef i32 @_ZN3sim5Param22collisionDetectionRateEv(ptr noundef nonnull align 8 dereferenceable(1056) %126)
          to label %129 unwind label %148

129:                                              ; preds = %127
  %130 = sitofp i32 %128 to double
  %131 = fdiv double 1.000000e+00, %130
  %132 = fsub double %103, %131
  %133 = invoke noundef ptr @_ZN3sim1PEv()
          to label %134 unwind label %148

134:                                              ; preds = %129
  %135 = invoke noundef i32 @_ZN3sim5Param22collisionDetectionRateEv(ptr noundef nonnull align 8 dereferenceable(1056) %133)
          to label %136 unwind label %148

136:                                              ; preds = %134
  %137 = sitofp i32 %135 to double
  %138 = fdiv double 1.000000e+00, %137
  %139 = fdiv double %132, %138
  %140 = fmul double %139, 1.000000e+02
  store double %140, ptr %10, align 8, !tbaa !32
  invoke void @_ZN2el6Logger4warnIdJdEEEvPKcRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728) %117, ptr noundef nonnull @.str.32, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %141 unwind label %148

141:                                              ; preds = %136
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  br label %151

142:                                              ; preds = %._crit_edge
  %143 = landingpad { ptr, i32 }
          cleanup
  br label %168

144:                                              ; preds = %116, %110, %108, %105, %102
  %145 = landingpad { ptr, i32 }
          cleanup
  br label %168

146:                                              ; preds = %120, %118
  %147 = landingpad { ptr, i32 }
          cleanup
  br label %150

148:                                              ; preds = %136, %134, %129, %127, %122
  %149 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  br label %150

150:                                              ; preds = %148, %146
  %.pn46 = phi { ptr, i32 } [ %149, %148 ], [ %147, %146 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  br label %168

151:                                              ; preds = %141, %112, %107
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #8
  store double 0.000000e+00, ptr %12, align 8, !tbaa !32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #8
  %152 = invoke noundef ptr @_ZN3sim1PEv()
          to label %153 unwind label %163

153:                                              ; preds = %151
  %154 = invoke noundef i32 @_ZN3sim5Param22collisionDetectionRateEv(ptr noundef nonnull align 8 dereferenceable(1056) %152)
          to label %155 unwind label %163

155:                                              ; preds = %153
  %156 = sitofp i32 %154 to double
  %157 = fdiv double 1.000000e+00, %156
  %158 = fsub double %157, %103
  store double %158, ptr %13, align 8, !tbaa !32
  %159 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %160 = load double, ptr %159, align 8, !tbaa !32
  invoke void @_ZN3sim7SecondsC1Ed(ptr noundef nonnull align 8 dereferenceable(16) %11, double noundef %160)
          to label %161 unwind label %163

161:                                              ; preds = %155
  invoke void @_ZN3sim12SimUtilities5sleepERKNS_8DurationE(ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %162 unwind label %165

162:                                              ; preds = %161
  call void @_ZN3sim8DurationD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #8
  call void @_ZNSt6vectorIN3sim9CartesianESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #8
  br label %22

163:                                              ; preds = %155, %153, %151
  %164 = landingpad { ptr, i32 }
          cleanup
  br label %167

165:                                              ; preds = %161
  %166 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3sim8DurationD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #8
  br label %167

167:                                              ; preds = %165, %163
  %.pn48 = phi { ptr, i32 } [ %166, %165 ], [ %164, %163 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #8
  br label %168

168:                                              ; preds = %142, %167, %150, %144, %100
  %.pn48.pn.pn.pn = phi { ptr, i32 } [ %.pn41.pn.pn, %100 ], [ %143, %142 ], [ %.pn48, %167 ], [ %.pn46, %150 ], [ %145, %144 ]
  call void @_ZNSt6vectorIN3sim9CartesianESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  br label %169

169:                                              ; preds = %168, %71
  %.pn48.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn48.pn.pn.pn, %168 ], [ %.pn.pn, %71 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #8
  br label %170

170:                                              ; preds = %169, %62, %60
  %.pn48.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn48.pn.pn.pn.pn, %169 ], [ %63, %62 ], [ %61, %60 ]
  resume { ptr, i32 } %.pn48.pn.pn.pn.pn.pn

171:                                              ; preds = %.thread56, %16, %1
  ret void
}

declare noundef double @_ZN3sim12SimUtilities19getHighResTimestampEv() local_unnamed_addr #2

declare noundef ptr @_ZN3sim1SEv() local_unnamed_addr #2

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

declare noundef ptr @_ZN3sim1PEv() local_unnamed_addr #2

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

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

; 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 @_ZN3sim5State10setCrashedEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

declare noundef zeroext i1 @_ZN3sim5Param25collisionDetectionEnabledEv(ptr noundef nonnull align 8 dereferenceable(1056)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3sim13InterfaceTypeESt4lessIS5_ESaISt4pairIKS5_S7_EEE2atERSB_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 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: nounwind
declare void @_ZN3sim8DistanceD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

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

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

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

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

declare void @_ZNK3sim7Polygon11getVerticesEv(ptr dead_on_unwind writable sret(%"class.std::vector.159") align 8, ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN3sim9CartesianESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN3sim9CartesianESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

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

declare void @_ZN3sim17GeometryUtilities7castRayERKNS_9CartesianES3_RKNS_4MazeERKNS_6MetersES9_(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), ptr noundef nonnull align 8 dereferenceable(26), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

declare noundef zeroext i1 @_ZNK3sim10CoordinateneERKS0_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2

declare noundef zeroext i1 @_ZN3sim5Param28printLateCollisionDetectionsEv(ptr noundef nonnull align 8 dereferenceable(1056)) local_unnamed_addr #2

declare noundef i32 @_ZN3sim5Param22collisionDetectionRateEv(ptr noundef nonnull align 8 dereferenceable(1056)) local_unnamed_addr #2

declare noundef ptr @_ZN3sim1LEv() local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN3sim9CartesianESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #6 align 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 = { 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 #4 = { 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 #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"_ZTSN3sim13InterfaceTypeE", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"branch_weights", i32 1, i32 1048575}
!10 = !{!11, !12, i64 8}
!11 = !{!"_ZTSN3sim5WorldE", !12, i64 0, !12, i64 8, !13, i64 16, !19, i64 128, !19, i64 144, !21, i64 160, !17, i64 208}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"_ZTSN3sim27StaticMouseAlgorithmOptionsE", !14, i64 0, !14, i64 32, !14, i64 64, !17, i64 96, !17, i64 100, !18, i64 104}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !15, i64 0, !16, i64 8, !7, i64 16}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !12, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = !{!"_ZTSN3sim7SecondsE", !20, i64 0}
!20 = !{!"_ZTSN3sim8DurationE", !18, i64 8}
!21 = !{!"_ZTSSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE", !22, i64 0}
!22 = !{!"_ZTSSt8_Rb_treeISt4pairIiiES1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE", !23, i64 0}
!23 = !{!"_ZTSNSt8_Rb_treeISt4pairIiiES1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE13_Rb_tree_implIS5_Lb1EEE", !24, i64 0, !26, i64 8}
!24 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessISt4pairIiiEEE", !25, i64 0}
!25 = !{!"_ZTSSt4lessISt4pairIiiEE"}
!26 = !{!"_ZTSSt15_Rb_tree_header", !27, i64 0, !16, i64 32}
!27 = !{!"_ZTSSt18_Rb_tree_node_base", !28, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!28 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!29 = !{!11, !12, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{!18, !18, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass