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

; 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::Radians" = type { %"class.sim::Angle" }
%"class.sim::Angle" = type { ptr, double }
%"class.sim::Polygon" = type { %"class.std::vector.55", %"class.std::vector.60" }
%"class.std::vector.55" = type { %"struct.std::_Vector_base.56" }
%"struct.std::_Vector_base.56" = 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.std::vector.60" = type { %"struct.std::_Vector_base.61" }
%"struct.std::_Vector_base.61" = 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.std::initializer_list.70" = type { ptr, i64 }
%"class.sim::Cartesian" = type { %"class.sim::Coordinate" }
%"class.sim::Coordinate" = type { ptr, %"class.sim::Meters", %"class.sim::Meters" }
%"class.std::allocator.57" = type { i8 }
%"class.sim::Polar" = type { %"class.sim::Coordinate" }
%"class.sim::Degrees" = type { %"class.sim::Angle" }
%"class.sim::Sensor" = type { %"class.sim::Meters", %"class.sim::Degrees", %"class.sim::Cartesian", %"class.sim::Radians", %"class.sim::Polygon", %"class.sim::Polygon", double }

@__dso_handle = external hidden global i8
@_ZZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE13halfWallWidth = external hidden global %"class.sim::Meters", align 8
@_ZGVZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE13halfWallWidth = external hidden global i64, align 8
@_ZZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE10tileLength = external hidden global %"class.sim::Meters", align 8
@_ZGVZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE10tileLength = external hidden global i64, align 8

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

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

declare i32 @__gxx_personality_v0(...)

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

declare noundef ptr @_ZN3sim1PEv() #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN3sim9CartesianESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(40)) #3 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 @_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 #4

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

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

declare void @_ZN3sim7PolygonC1ERKSt6vectorINS_9CartesianESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2

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

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

; 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 #6 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeE(ptr dead_on_unwind noalias writable sret(%"class.sim::Polygon") align 8 %0, ptr noundef nonnull align 8 dereferenceable(192) %1, ptr noundef nonnull align 8 dereferenceable(40) %2, ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(26) %4) #3 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::vector.55", align 8
  %14 = alloca %"class.std::initializer_list.70", align 8
  %15 = alloca [1 x %"class.sim::Cartesian"], align 8
  %16 = alloca %"class.std::allocator.57", align 1
  %17 = alloca double, align 8
  %18 = alloca %"class.sim::Cartesian", align 8
  %19 = alloca %"class.sim::Cartesian", align 8
  %20 = alloca %"class.sim::Polar", align 8
  %21 = alloca %"class.sim::Radians", align 8
  %22 = alloca %"class.sim::Degrees", align 8
  store ptr %0, ptr %6, align 8
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %23 = load ptr, ptr %7, align 8
  %24 = load atomic i8, ptr @_ZGVZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE13halfWallWidth acquire, align 8
  %25 = icmp eq i8 %24, 0
  br i1 %25, label %26, label %37, !prof !9

26:                                               ; preds = %5
  %27 = call i32 @__cxa_guard_acquire(ptr @_ZGVZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE13halfWallWidth) #0
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %37

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

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

33:                                               ; preds = %31
  %34 = fdiv double %32, 2.000000e+00
  invoke void @_ZN3sim6MetersC1Ed(ptr noundef nonnull align 8 dereferenceable(16) @_ZZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE13halfWallWidth, double noundef %34)
          to label %35 unwind label %75

35:                                               ; preds = %33
  %36 = call i32 @__cxa_atexit(ptr @_ZN3sim8DistanceD2Ev, ptr @_ZZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE13halfWallWidth, ptr @__dso_handle) #0
  call void @__cxa_guard_release(ptr @_ZGVZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE13halfWallWidth) #0
  br label %37

37:                                               ; preds = %35, %26, %5
  %38 = load atomic i8, ptr @_ZGVZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE10tileLength acquire, align 8
  %39 = icmp eq i8 %38, 0
  br i1 %39, label %40, label %55, !prof !9

40:                                               ; preds = %37
  %41 = call i32 @__cxa_guard_acquire(ptr @_ZGVZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE10tileLength) #0
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %55

43:                                               ; preds = %40
  %44 = invoke noundef ptr @_ZN3sim1PEv()
          to label %45 unwind label %79

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

47:                                               ; preds = %45
  %48 = invoke noundef ptr @_ZN3sim1PEv()
          to label %49 unwind label %79

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

51:                                               ; preds = %49
  %52 = fadd double %46, %50
  invoke void @_ZN3sim6MetersC1Ed(ptr noundef nonnull align 8 dereferenceable(16) @_ZZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE10tileLength, double noundef %52)
          to label %53 unwind label %79

53:                                               ; preds = %51
  %54 = call i32 @__cxa_atexit(ptr @_ZN3sim8DistanceD2Ev, ptr @_ZZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE10tileLength, ptr @__dso_handle) #0
  call void @__cxa_guard_release(ptr @_ZGVZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE10tileLength) #0
  br label %55

55:                                               ; preds = %53, %40, %37
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #0
  call void @llvm.lifetime.start.p0(i64 40, ptr %15) #0
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN3sim9CartesianC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(40) %15, ptr noundef nonnull align 8 dereferenceable(40) %56) #0
  %57 = getelementptr inbounds %"class.std::initializer_list.70", ptr %14, i32 0, i32 0
  store ptr %15, ptr %57, align 8, !tbaa !10
  %58 = getelementptr inbounds %"class.std::initializer_list.70", ptr %14, i32 0, i32 1
  store i64 1, ptr %58, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #0
  call void @_ZNSaIN3sim9CartesianEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #0
  %59 = getelementptr inbounds { ptr, i64 }, ptr %14, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8
  %61 = getelementptr inbounds { ptr, i64 }, ptr %14, i32 0, i32 1
  %62 = load i64, ptr %61, align 8
  invoke void @_ZNSt6vectorIN3sim9CartesianESaIS1_EEC2ESt16initializer_listIS1_ERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr %60, i64 %62, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %63 unwind label %83

63:                                               ; preds = %55
  call void @_ZNSt15__new_allocatorIN3sim9CartesianEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #0
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #0
  %64 = getelementptr inbounds [1 x %"class.sim::Cartesian"], ptr %15, i32 0, i32 0
  %65 = getelementptr inbounds %"class.sim::Cartesian", ptr %64, i64 1
  br label %66

66:                                               ; preds = %66, %63
  %67 = phi ptr [ %65, %63 ], [ %68, %66 ]
  %68 = getelementptr inbounds %"class.sim::Cartesian", ptr %67, i64 -1
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %68) #0
  %69 = icmp eq ptr %68, %64
  br i1 %69, label %70, label %66

70:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 40, ptr %15) #0
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #0
  store double -1.000000e+00, ptr %17, align 8, !tbaa !14
  br label %71

71:                                               ; preds = %112, %70
  %72 = load double, ptr %17, align 8, !tbaa !14
  %73 = fcmp ole double %72, 1.000000e+00
  br i1 %73, label %94, label %74

74:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #0
  br label %152

75:                                               ; preds = %33, %31, %29
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %11, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %12, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE13halfWallWidth) #0
  br label %160

79:                                               ; preds = %51, %49, %47, %45, %43
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %11, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %12, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE10tileLength) #0
  br label %160

83:                                               ; preds = %55
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %11, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %12, align 4
  call void @_ZNSt15__new_allocatorIN3sim9CartesianEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #0
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #0
  %87 = getelementptr inbounds [1 x %"class.sim::Cartesian"], ptr %15, i32 0, i32 0
  %88 = getelementptr inbounds %"class.sim::Cartesian", ptr %87, i64 1
  br label %89

89:                                               ; preds = %89, %83
  %90 = phi ptr [ %88, %83 ], [ %91, %89 ]
  %91 = getelementptr inbounds %"class.sim::Cartesian", ptr %90, i64 -1
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %91) #0
  %92 = icmp eq ptr %91, %87
  br i1 %92, label %93, label %89

93:                                               ; preds = %89
  call void @llvm.lifetime.end.p0(i64 40, ptr %15) #0
  br label %159

94:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 40, ptr %18) #0
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr %19) #0
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr %20) #0
  %97 = getelementptr inbounds %"class.sim::Sensor", ptr %23, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #0
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #0
  %99 = getelementptr inbounds %"class.sim::Sensor", ptr %23, i32 0, i32 1
  %100 = load double, ptr %17, align 8, !tbaa !14
  invoke void @_ZNK3sim7DegreesmlEd(ptr dead_on_unwind writable sret(%"class.sim::Degrees") align 8 %22, ptr noundef nonnull align 8 dereferenceable(16) %99, double noundef %100)
          to label %101 unwind label %118

101:                                              ; preds = %94
  invoke void @_ZNK3sim7RadiansplERKNS_5AngleE(ptr dead_on_unwind writable sret(%"class.sim::Radians") align 8 %21, ptr noundef nonnull align 8 dereferenceable(16) %98, ptr noundef nonnull align 8 dereferenceable(16) %22)
          to label %102 unwind label %122

102:                                              ; preds = %101
  invoke void @_ZN3sim5PolarC1ERKNS_8DistanceERKNS_5AngleE(ptr noundef nonnull align 8 dereferenceable(40) %20, ptr noundef nonnull align 8 dereferenceable(16) %97, ptr noundef nonnull align 8 dereferenceable(16) %21)
          to label %103 unwind label %126

103:                                              ; preds = %102
  invoke void @_ZNK3sim9CartesianplERKNS_10CoordinateE(ptr dead_on_unwind writable sret(%"class.sim::Cartesian") align 8 %19, ptr noundef nonnull align 8 dereferenceable(40) %96, ptr noundef nonnull align 8 dereferenceable(40) %20)
          to label %104 unwind label %130

104:                                              ; preds = %103
  %105 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_ZN3sim17GeometryUtilities7castRayERKNS_9CartesianES3_RKNS_4MazeERKNS_6MetersES9_(ptr dead_on_unwind writable sret(%"class.sim::Cartesian") align 8 %18, ptr noundef nonnull align 8 dereferenceable(40) %95, ptr noundef nonnull align 8 dereferenceable(40) %19, ptr noundef nonnull align 8 dereferenceable(26) %105, ptr noundef nonnull align 8 dereferenceable(16) @_ZZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE13halfWallWidth, ptr noundef nonnull align 8 dereferenceable(16) @_ZZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE10tileLength)
          to label %106 unwind label %134

106:                                              ; preds = %104
  invoke void @_ZNSt6vectorIN3sim9CartesianESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(40) %18)
          to label %107 unwind label %138

107:                                              ; preds = %106
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %18) #0
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %19) #0
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %20) #0
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #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 @llvm.lifetime.end.p0(i64 40, ptr %20) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %19) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %18) #0
  br label %108

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

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

112:                                              ; preds = %110
  %113 = sub nsw i32 %111, 1
  %114 = sitofp i32 %113 to double
  %115 = fdiv double 2.000000e+00, %114
  %116 = load double, ptr %17, align 8, !tbaa !14
  %117 = fadd double %116, %115
  store double %117, ptr %17, align 8, !tbaa !14
  br label %71, !llvm.loop !16

118:                                              ; preds = %94
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %11, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %12, align 4
  br label %146

122:                                              ; preds = %101
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %11, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %12, align 4
  br label %145

126:                                              ; preds = %102
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %11, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %12, align 4
  br label %144

130:                                              ; preds = %103
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %11, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %12, align 4
  br label %143

134:                                              ; preds = %104
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %11, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %12, align 4
  br label %142

138:                                              ; preds = %106
  %139 = landingpad { ptr, i32 }
          cleanup
  %140 = extractvalue { ptr, i32 } %139, 0
  store ptr %140, ptr %11, align 8
  %141 = extractvalue { ptr, i32 } %139, 1
  store i32 %141, ptr %12, align 4
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %18) #0
  br label %142

142:                                              ; preds = %138, %134
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %19) #0
  br label %143

143:                                              ; preds = %142, %130
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %20) #0
  br label %144

144:                                              ; preds = %143, %126
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #0
  br label %145

145:                                              ; preds = %144, %122
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %22) #0
  br label %146

146:                                              ; preds = %145, %118
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %20) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %19) #0
  call void @llvm.lifetime.end.p0(i64 40, ptr %18) #0
  br label %151

147:                                              ; preds = %110, %108
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %11, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %12, align 4
  br label %151

151:                                              ; preds = %147, %146
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #0
  br label %158

152:                                              ; preds = %74
  invoke void @_ZN3sim7PolygonC1ERKSt6vectorINS_9CartesianESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %153 unwind label %154

153:                                              ; preds = %152
  call void @_ZNSt6vectorIN3sim9CartesianESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #0
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #0
  ret void

154:                                              ; preds = %152
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %11, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %12, align 4
  br label %158

158:                                              ; preds = %154, %151
  call void @_ZNSt6vectorIN3sim9CartesianESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #0
  br label %159

159:                                              ; preds = %158, %93
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #0
  br label %160

160:                                              ; preds = %159, %79, %75
  %161 = load ptr, ptr %11, align 8
  %162 = load i32, ptr %12, align 4
  %163 = insertvalue { ptr, i32 } poison, ptr %161, 0
  %164 = insertvalue { ptr, i32 } %163, i32 %162, 1
  resume { ptr, i32 } %164
}

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

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 noundef double @_ZN3sim5Param10wallLengthEv(ptr noundef nonnull align 8 dereferenceable(1056)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIN3sim9CartesianEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN3sim9CartesianESaIS1_EEC2ESt16initializer_listIS1_ERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr, i64, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIN3sim9CartesianEED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) 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 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 @_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 = { 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 = { 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 = { 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" }

!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 = !{!"branch_weights", i32 1, i32 1048575}
!10 = !{!11, !6, i64 0}
!11 = !{!"_ZTSSt16initializer_listIN3sim9CartesianEE", !6, i64 0, !12, i64 8}
!12 = !{!"long", !7, i64 0}
!13 = !{!11, !12, i64 8}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


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

%"class.sim::Meters" = type { %"class.sim::Distance" }
%"class.sim::Distance" = type { ptr, double }
%"class.sim::Radians" = type { %"class.sim::Angle" }
%"class.sim::Angle" = type { ptr, double }
%"class.sim::Polygon" = type { %"class.std::vector.55", %"class.std::vector.60" }
%"class.std::vector.55" = type { %"struct.std::_Vector_base.56" }
%"struct.std::_Vector_base.56" = 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.std::vector.60" = type { %"struct.std::_Vector_base.61" }
%"struct.std::_Vector_base.61" = 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.std::allocator.57" = type { i8 }
%"class.sim::Polar" = type { %"class.sim::Coordinate" }
%"class.sim::Degrees" = type { %"class.sim::Angle" }

@__dso_handle = external hidden global i8
@_ZZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE13halfWallWidth = external hidden global %"class.sim::Meters", align 8
@_ZGVZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE13halfWallWidth = external hidden global i64, align 8
@_ZZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE10tileLength = external hidden global %"class.sim::Meters", align 8
@_ZGVZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE10tileLength = external hidden global i64, align 8

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

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

declare i32 @__gxx_personality_v0(...)

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

declare noundef ptr @_ZN3sim1PEv() local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN3sim9CartesianESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3 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 @_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 #4

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

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

declare void @_ZN3sim7PolygonC1ERKSt6vectorINS_9CartesianESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2

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

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

; 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 #6 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeE(ptr dead_on_unwind noalias writable sret(%"class.sim::Polygon") align 8 %0, ptr noundef nonnull align 8 dereferenceable(192) %1, ptr noundef nonnull align 8 dereferenceable(40) %2, ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(26) %4) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.std::vector.55", align 8
  %7 = alloca [1 x %"class.sim::Cartesian"], align 8
  %8 = alloca %"class.std::allocator.57", align 1
  %9 = alloca %"class.sim::Cartesian", align 8
  %10 = alloca %"class.sim::Cartesian", align 8
  %11 = alloca %"class.sim::Polar", align 8
  %12 = alloca %"class.sim::Radians", align 8
  %13 = alloca %"class.sim::Degrees", align 8
  %14 = load atomic i8, ptr @_ZGVZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE13halfWallWidth acquire, align 8
  %15 = icmp eq i8 %14, 0
  br i1 %15, label %16, label %26, !prof !5

16:                                               ; preds = %5
  %17 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE13halfWallWidth) #7
  %.not = icmp eq i32 %17, 0
  br i1 %.not, label %26, label %18

18:                                               ; preds = %16
  %19 = invoke noundef ptr @_ZN3sim1PEv()
          to label %20 unwind label %47

20:                                               ; preds = %18
  %21 = invoke noundef double @_ZN3sim5Param9wallWidthEv(ptr noundef nonnull align 8 dereferenceable(1056) %19)
          to label %22 unwind label %47

22:                                               ; preds = %20
  %23 = fmul double %21, 5.000000e-01
  invoke void @_ZN3sim6MetersC1Ed(ptr noundef nonnull align 8 dereferenceable(16) @_ZZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE13halfWallWidth, double noundef %23)
          to label %24 unwind label %47

24:                                               ; preds = %22
  %25 = tail call i32 @__cxa_atexit(ptr nonnull @_ZN3sim8DistanceD2Ev, ptr nonnull @_ZZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE13halfWallWidth, ptr nonnull @__dso_handle) #7
  tail call void @__cxa_guard_release(ptr nonnull @_ZGVZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE13halfWallWidth) #7
  br label %26

26:                                               ; preds = %24, %16, %5
  %27 = load atomic i8, ptr @_ZGVZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE10tileLength acquire, align 8
  %28 = icmp eq i8 %27, 0
  br i1 %28, label %29, label %43, !prof !5

29:                                               ; preds = %26
  %30 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE10tileLength) #7
  %.not22 = icmp eq i32 %30, 0
  br i1 %.not22, label %43, label %31

31:                                               ; preds = %29
  %32 = invoke noundef ptr @_ZN3sim1PEv()
          to label %33 unwind label %49

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

35:                                               ; preds = %33
  %36 = invoke noundef ptr @_ZN3sim1PEv()
          to label %37 unwind label %49

37:                                               ; preds = %35
  %38 = invoke noundef double @_ZN3sim5Param9wallWidthEv(ptr noundef nonnull align 8 dereferenceable(1056) %36)
          to label %39 unwind label %49

39:                                               ; preds = %37
  %40 = fadd double %34, %38
  invoke void @_ZN3sim6MetersC1Ed(ptr noundef nonnull align 8 dereferenceable(16) @_ZZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE10tileLength, double noundef %40)
          to label %41 unwind label %49

41:                                               ; preds = %39
  %42 = tail call i32 @__cxa_atexit(ptr nonnull @_ZN3sim8DistanceD2Ev, ptr nonnull @_ZZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE10tileLength, ptr nonnull @__dso_handle) #7
  tail call void @__cxa_guard_release(ptr nonnull @_ZGVZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE10tileLength) #7
  br label %43

43:                                               ; preds = %41, %29, %26
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #7
  call void @_ZN3sim9CartesianC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef nonnull align 8 dereferenceable(40) %2) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #7
  call void @_ZNSaIN3sim9CartesianEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  invoke void @_ZNSt6vectorIN3sim9CartesianESaIS1_EEC2ESt16initializer_listIS1_ERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr nonnull %7, i64 1, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %44 unwind label %51

44:                                               ; preds = %43
  call void @_ZNSt15__new_allocatorIN3sim9CartesianEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #7
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #7
  %45 = getelementptr inbounds i8, ptr %1, i64 16
  br label %53

46:                                               ; preds = %63
  invoke void @_ZN3sim7PolygonC1ERKSt6vectorINS_9CartesianESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %88 unwind label %89

47:                                               ; preds = %22, %20, %18
  %48 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_guard_abort(ptr nonnull @_ZGVZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE13halfWallWidth) #7
  br label %93

49:                                               ; preds = %39, %37, %35, %33, %31
  %50 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_guard_abort(ptr nonnull @_ZGVZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE10tileLength) #7
  br label %93

51:                                               ; preds = %43
  %52 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIN3sim9CartesianEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #7
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #7
  br label %92

53:                                               ; preds = %44, %63
  %.033 = phi double [ -1.000000e+00, %44 ], [ %67, %63 ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #7
  invoke void @_ZNK3sim7DegreesmlEd(ptr dead_on_unwind nonnull writable sret(%"class.sim::Degrees") align 8 %13, ptr noundef nonnull align 8 dereferenceable(16) %45, double noundef %.033)
          to label %54 unwind label %69

54:                                               ; preds = %53
  invoke void @_ZNK3sim7RadiansplERKNS_5AngleE(ptr dead_on_unwind nonnull writable sret(%"class.sim::Radians") align 8 %12, ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %13)
          to label %55 unwind label %71

55:                                               ; preds = %54
  invoke void @_ZN3sim5PolarC1ERKNS_8DistanceERKNS_5AngleE(ptr noundef nonnull align 8 dereferenceable(40) %11, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %56 unwind label %73

56:                                               ; preds = %55
  invoke void @_ZNK3sim9CartesianplERKNS_10CoordinateE(ptr dead_on_unwind nonnull writable sret(%"class.sim::Cartesian") align 8 %10, ptr noundef nonnull align 8 dereferenceable(40) %2, ptr noundef nonnull align 8 dereferenceable(40) %11)
          to label %57 unwind label %75

57:                                               ; preds = %56
  invoke void @_ZN3sim17GeometryUtilities7castRayERKNS_9CartesianES3_RKNS_4MazeERKNS_6MetersES9_(ptr dead_on_unwind nonnull writable sret(%"class.sim::Cartesian") align 8 %9, ptr noundef nonnull align 8 dereferenceable(40) %2, ptr noundef nonnull align 8 dereferenceable(40) %10, ptr noundef nonnull align 8 dereferenceable(26) %4, ptr noundef nonnull align 8 dereferenceable(16) @_ZZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE13halfWallWidth, ptr noundef nonnull align 8 dereferenceable(16) @_ZZNK3sim6Sensor14getViewPolygonERKNS_9CartesianERKNS_7RadiansERKNS_4MazeEE10tileLength)
          to label %58 unwind label %77

58:                                               ; preds = %57
  invoke void @_ZNSt6vectorIN3sim9CartesianESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(40) %9)
          to label %59 unwind label %79

59:                                               ; preds = %58
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #7
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %10) #7
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %11) #7
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #7
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #7
  %60 = invoke noundef ptr @_ZN3sim1PEv()
          to label %61 unwind label %86

61:                                               ; preds = %59
  %62 = invoke noundef i32 @_ZN3sim5Param24numberOfSensorEdgePointsEv(ptr noundef nonnull align 8 dereferenceable(1056) %60)
          to label %63 unwind label %86

63:                                               ; preds = %61
  %64 = add nsw i32 %62, -1
  %65 = sitofp i32 %64 to double
  %66 = fdiv double 2.000000e+00, %65
  %67 = fadd double %.033, %66
  %68 = fcmp ugt double %67, 1.000000e+00
  br i1 %68, label %46, label %53, !llvm.loop !6

69:                                               ; preds = %53
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %85

71:                                               ; preds = %54
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %84

73:                                               ; preds = %55
  %74 = landingpad { ptr, i32 }
          cleanup
  br label %83

75:                                               ; preds = %56
  %76 = landingpad { ptr, i32 }
          cleanup
  br label %82

77:                                               ; preds = %57
  %78 = landingpad { ptr, i32 }
          cleanup
  br label %81

79:                                               ; preds = %58
  %80 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #7
  br label %81

81:                                               ; preds = %79, %77
  %.pn = phi { ptr, i32 } [ %80, %79 ], [ %78, %77 ]
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %10) #7
  br label %82

82:                                               ; preds = %81, %75
  %.pn.pn = phi { ptr, i32 } [ %.pn, %81 ], [ %76, %75 ]
  call void @_ZN3sim10CoordinateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %11) #7
  br label %83

83:                                               ; preds = %82, %73
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %82 ], [ %74, %73 ]
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #7
  br label %84

84:                                               ; preds = %83, %71
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %83 ], [ %72, %71 ]
  call void @_ZN3sim5AngleD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #7
  br label %85

85:                                               ; preds = %84, %69
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %84 ], [ %70, %69 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #7
  br label %91

86:                                               ; preds = %61, %59
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %91

88:                                               ; preds = %46
  call void @_ZNSt6vectorIN3sim9CartesianESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  ret void

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

91:                                               ; preds = %85, %86, %89
  %.pn28.pn = phi { ptr, i32 } [ %90, %89 ], [ %87, %86 ], [ %.pn.pn.pn.pn.pn, %85 ]
  call void @_ZNSt6vectorIN3sim9CartesianESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  br label %92

92:                                               ; preds = %91, %51
  %.pn28.pn.pn = phi { ptr, i32 } [ %.pn28.pn, %91 ], [ %52, %51 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  br label %93

93:                                               ; preds = %92, %49, %47
  %.pn28.pn.pn.pn = phi { ptr, i32 } [ %.pn28.pn.pn, %92 ], [ %50, %49 ], [ %48, %47 ]
  resume { ptr, i32 } %.pn28.pn.pn.pn
}

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

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 noundef double @_ZN3sim5Param10wallLengthEv(ptr noundef nonnull align 8 dereferenceable(1056)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIN3sim9CartesianEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN3sim9CartesianESaIS1_EEC2ESt16initializer_listIS1_ERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr, i64, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIN3sim9CartesianEED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) 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 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 @_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 = { 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 = { 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 = { 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 #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 = !{!"branch_weights", i32 1, i32 1048575}
!6 = distinct !{!6, !7}
!7 = !{!"llvm.loop.mustprogress"}


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