; LLVM IR from mackorone/mms :: old/v2/src/mouse/continuous/Continuous.ll (ZN10continuous10Continuous10correctionEv)

; 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::__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::allocator.0" = type { i8 }
%"class.continuous::Continuous" = type { %class.IMouseAlgorithm, i32, i32, i32, i32, float, float, [256 x i8], [5 x i8], [3 x i8], i8, i8, i32, i8, i8, i8, i8, i32, i32, i32, i8, i8, i8, i8, i8, float, i32, i32, i32, double, double, double, double, double, double, i32, i32, ptr }
%class.IMouseAlgorithm = type { ptr }

@_ZZN10continuous10Continuous10correctionEvE17totalForwardCount = external hidden global i32, align 4
@_ZZN10continuous10Continuous10correctionEvE12forwardCount = external hidden global i32, align 4
@_ZZN10continuous10Continuous10correctionEvE15in_acceleration = external hidden global i8, align 1
@_ZZN10continuous10Continuous10correctionEvE13indexInBuffer = external hidden global i8, align 1
@_ZZN10continuous10Continuous10correctionEvE12movedForward = external hidden global i8, align 1
@.str.68 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [12 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10continuous10Continuous8wallLeftEv(ptr noundef nonnull align 8 dereferenceable(408)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10continuous10Continuous9wallFrontEv(ptr noundef nonnull align 8 dereferenceable(408)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10continuous10Continuous9wallRightEv(ptr noundef nonnull align 8 dereferenceable(408)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10continuous10Continuous10correctionEv(ptr noundef nonnull align 8 dereferenceable(408) %0) #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::allocator.0", align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.std::allocator.0", align 1
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca %"class.std::allocator.0", align 1
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::allocator.0", align 1
  store ptr %0, ptr %2, align 8, !tbaa !5
  %14 = load ptr, ptr %2, align 8
  %15 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 10
  %16 = load volatile i8, ptr %15, align 8, !tbaa !9, !range !17, !noundef !18
  %17 = trunc i8 %16 to i1
  br i1 %17, label %20, label %18

18:                                               ; preds = %1
  %19 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 24
  store volatile i8 0, ptr %19, align 4, !tbaa !19
  br label %251

20:                                               ; preds = %1
  call void @_ZN10continuous10Continuous11readSensorsEv(ptr noundef nonnull align 8 dereferenceable(408) %14)
  %21 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 37
  %22 = load ptr, ptr %21, align 8, !tbaa !20
  %23 = call noundef double @_ZN3sim14MouseInterface8readGyroEv(ptr noundef nonnull align 8 dereferenceable(296) %22)
  %24 = fptrunc double %23 to float
  %25 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 25
  store volatile float %24, ptr %25, align 8, !tbaa !21
  %26 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 13
  %27 = load i8, ptr %26, align 8, !tbaa !22, !range !17, !noundef !18
  %28 = trunc i8 %27 to i1
  br i1 %28, label %29, label %60

29:                                               ; preds = %20
  store i8 0, ptr @_ZZN10continuous10Continuous10correctionEvE12movedForward, align 1, !tbaa !23
  %30 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 14
  %31 = load i8, ptr %30, align 1, !tbaa !24, !range !17, !noundef !18
  %32 = trunc i8 %31 to i1
  br i1 %32, label %33, label %35

33:                                               ; preds = %29
  %34 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 14
  store i8 0, ptr %34, align 1, !tbaa !24
  br label %35

35:                                               ; preds = %33, %29
  %36 = load i32, ptr @_ZZN10continuous10Continuous10correctionEvE12forwardCount, align 4, !tbaa !25
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %41

38:                                               ; preds = %35
  %39 = load i32, ptr @_ZZN10continuous10Continuous10correctionEvE12forwardCount, align 4, !tbaa !25
  %40 = add nsw i32 %39, -1
  store i32 %40, ptr @_ZZN10continuous10Continuous10correctionEvE12forwardCount, align 4, !tbaa !25
  br label %42

41:                                               ; preds = %35
  store i32 0, ptr @_ZZN10continuous10Continuous10correctionEvE17totalForwardCount, align 4, !tbaa !25
  store i8 0, ptr @_ZZN10continuous10Continuous10correctionEvE15in_acceleration, align 1, !tbaa !23
  br label %42

42:                                               ; preds = %41, %38
  %43 = load i8, ptr @_ZZN10continuous10Continuous10correctionEvE13indexInBuffer, align 1, !tbaa !26
  %44 = sext i8 %43 to i32
  %45 = add nsw i32 %44, 1
  %46 = trunc i32 %45 to i8
  store i8 %46, ptr @_ZZN10continuous10Continuous10correctionEvE13indexInBuffer, align 1, !tbaa !26
  %47 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 13
  store i8 0, ptr %47, align 8, !tbaa !22
  %48 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 7
  %49 = load i8, ptr @_ZZN10continuous10Continuous10correctionEvE13indexInBuffer, align 1, !tbaa !26
  %50 = sext i8 %49 to i64
  %51 = getelementptr inbounds [256 x i8], ptr %48, i64 0, i64 %50
  %52 = load volatile i8, ptr %51, align 1, !tbaa !26
  %53 = sext i8 %52 to i32
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %59

55:                                               ; preds = %42
  %56 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 10
  store volatile i8 0, ptr %56, align 8, !tbaa !9
  %57 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 11
  store volatile i8 1, ptr %57, align 1, !tbaa !27
  store i8 0, ptr @_ZZN10continuous10Continuous10correctionEvE13indexInBuffer, align 1, !tbaa !26
  %58 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 24
  store volatile i8 0, ptr %58, align 4, !tbaa !19
  br label %251

59:                                               ; preds = %42
  br label %60

60:                                               ; preds = %59, %20
  %61 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 7
  %62 = load i8, ptr @_ZZN10continuous10Continuous10correctionEvE13indexInBuffer, align 1, !tbaa !26
  %63 = sext i8 %62 to i64
  %64 = getelementptr inbounds [256 x i8], ptr %61, i64 0, i64 %63
  %65 = load volatile i8, ptr %64, align 1, !tbaa !26
  %66 = sext i8 %65 to i32
  switch i32 %66, label %247 [
    i32 102, label %67
    i32 114, label %166
    i32 108, label %214
    i32 97, label %216
  ]

67:                                               ; preds = %60
  %68 = load i8, ptr @_ZZN10continuous10Continuous10correctionEvE15in_acceleration, align 1, !tbaa !23, !range !17, !noundef !18
  %69 = trunc i8 %68 to i1
  br i1 %69, label %150, label %70

70:                                               ; preds = %67
  store i32 1, ptr @_ZZN10continuous10Continuous10correctionEvE12forwardCount, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %71 = load i8, ptr @_ZZN10continuous10Continuous10correctionEvE13indexInBuffer, align 1, !tbaa !26
  %72 = sext i8 %71 to i32
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %3, align 4, !tbaa !25
  br label %74

74:                                               ; preds = %83, %70
  %75 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 7
  %76 = load i32, ptr %3, align 4, !tbaa !25
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %3, align 4, !tbaa !25
  %78 = sext i32 %76 to i64
  %79 = getelementptr inbounds [256 x i8], ptr %75, i64 0, i64 %78
  %80 = load volatile i8, ptr %79, align 1, !tbaa !26
  %81 = sext i8 %80 to i32
  %82 = icmp eq i32 %81, 102
  br i1 %82, label %83, label %86

83:                                               ; preds = %74
  %84 = load i32, ptr @_ZZN10continuous10Continuous10correctionEvE12forwardCount, align 4, !tbaa !25
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr @_ZZN10continuous10Continuous10correctionEvE12forwardCount, align 4, !tbaa !25
  br label %74, !llvm.loop !28

86:                                               ; preds = %74
  %87 = load i32, ptr @_ZZN10continuous10Continuous10correctionEvE12forwardCount, align 4, !tbaa !25
  store i32 %87, ptr @_ZZN10continuous10Continuous10correctionEvE17totalForwardCount, align 4, !tbaa !25
  %88 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 16
  %89 = load i8, ptr %88, align 1, !tbaa !30, !range !17, !noundef !18
  %90 = trunc i8 %89 to i1
  br i1 %90, label %91, label %120

91:                                               ; preds = %86
  %92 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 2
  %93 = load i32, ptr %92, align 4, !tbaa !31
  %94 = sitofp i32 %93 to float
  %95 = load i32, ptr @_ZZN10continuous10Continuous10correctionEvE12forwardCount, align 4, !tbaa !25
  %96 = sitofp i32 %95 to float
  %97 = fmul float %94, %96
  %98 = fptosi float %97 to i32
  %99 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 17
  store i32 %98, ptr %99, align 4, !tbaa !32
  %100 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 17
  %101 = load i32, ptr %100, align 4, !tbaa !32
  %102 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 12
  %103 = load i32, ptr %102, align 4, !tbaa !33
  %104 = icmp sgt i32 %101, %103
  br i1 %104, label %105, label %109

105:                                              ; preds = %91
  %106 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 12
  %107 = load i32, ptr %106, align 4, !tbaa !33
  %108 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 17
  store i32 %107, ptr %108, align 4, !tbaa !32
  br label %109

109:                                              ; preds = %105, %91
  %110 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 17
  %111 = load i32, ptr %110, align 4, !tbaa !32
  %112 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 2
  %113 = load i32, ptr %112, align 4, !tbaa !31
  %114 = icmp slt i32 %111, %113
  br i1 %114, label %115, label %119

115:                                              ; preds = %109
  %116 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 2
  %117 = load i32, ptr %116, align 4, !tbaa !31
  %118 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 17
  store i32 %117, ptr %118, align 4, !tbaa !32
  br label %119

119:                                              ; preds = %115, %109
  br label %149

120:                                              ; preds = %86
  %121 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 1
  %122 = load i32, ptr %121, align 8, !tbaa !34
  %123 = sitofp i32 %122 to float
  %124 = load i32, ptr @_ZZN10continuous10Continuous10correctionEvE12forwardCount, align 4, !tbaa !25
  %125 = sitofp i32 %124 to float
  %126 = fmul float %123, %125
  %127 = fptosi float %126 to i32
  %128 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 17
  store i32 %127, ptr %128, align 4, !tbaa !32
  %129 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 17
  %130 = load i32, ptr %129, align 4, !tbaa !32
  %131 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 1
  %132 = load i32, ptr %131, align 8, !tbaa !34
  %133 = icmp slt i32 %130, %132
  br i1 %133, label %134, label %138

134:                                              ; preds = %120
  %135 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 1
  %136 = load i32, ptr %135, align 8, !tbaa !34
  %137 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 17
  store i32 %136, ptr %137, align 4, !tbaa !32
  br label %138

138:                                              ; preds = %134, %120
  %139 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 17
  %140 = load i32, ptr %139, align 4, !tbaa !32
  %141 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 12
  %142 = load i32, ptr %141, align 4, !tbaa !33
  %143 = icmp sgt i32 %140, %142
  br i1 %143, label %144, label %148

144:                                              ; preds = %138
  %145 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 12
  %146 = load i32, ptr %145, align 4, !tbaa !33
  %147 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 17
  store i32 %146, ptr %147, align 4, !tbaa !32
  br label %148

148:                                              ; preds = %144, %138
  br label %149

149:                                              ; preds = %148, %119
  store i8 1, ptr @_ZZN10continuous10Continuous10correctionEvE15in_acceleration, align 1, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %160

150:                                              ; preds = %67
  %151 = load i32, ptr @_ZZN10continuous10Continuous10correctionEvE12forwardCount, align 4, !tbaa !25
  %152 = load i32, ptr @_ZZN10continuous10Continuous10correctionEvE17totalForwardCount, align 4, !tbaa !25
  %153 = add nsw i32 %152, 4
  %154 = sdiv i32 %153, 5
  %155 = add nsw i32 2, %154
  %156 = icmp eq i32 %151, %155
  br i1 %156, label %157, label %159

157:                                              ; preds = %150
  %158 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 17
  store i32 620, ptr %158, align 4, !tbaa !32
  br label %159

159:                                              ; preds = %157, %150
  br label %160

160:                                              ; preds = %159, %149
  %161 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 26
  store volatile i32 1, ptr %161, align 4, !tbaa !35
  %162 = load i8, ptr @_ZZN10continuous10Continuous10correctionEvE12movedForward, align 1, !tbaa !23, !range !17, !noundef !18
  %163 = trunc i8 %162 to i1
  br i1 %163, label %165, label %164

164:                                              ; preds = %160
  store i8 1, ptr @_ZZN10continuous10Continuous10correctionEvE12movedForward, align 1, !tbaa !23
  call void @_ZN10continuous10Continuous11moveForwardEv(ptr noundef nonnull align 8 dereferenceable(408) %14)
  br label %165

165:                                              ; preds = %164, %160
  call void @_ZN10continuous10Continuous17forwardCorrectionEv(ptr noundef nonnull align 8 dereferenceable(408) %14)
  br label %249

166:                                              ; preds = %60
  %167 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 26
  store volatile i32 3, ptr %167, align 4, !tbaa !35
  %168 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 14
  %169 = load i8, ptr %168, align 1, !tbaa !24, !range !17, !noundef !18
  %170 = trunc i8 %169 to i1
  br i1 %170, label %171, label %213

171:                                              ; preds = %166
  %172 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 28
  store i32 0, ptr %172, align 4, !tbaa !36
  %173 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 27
  store i32 0, ptr %173, align 8, !tbaa !37
  %174 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 37
  %175 = load ptr, ptr %174, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef @.str.68, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %176 unwind label %195

176:                                              ; preds = %171
  invoke void @_ZN3sim14MouseInterface17resetWheelEncoderERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(296) %175, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %177 unwind label %199

177:                                              ; preds = %176
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #4
  %178 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 37
  %179 = load ptr, ptr %178, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef @.str.69, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %180 unwind label %204

180:                                              ; preds = %177
  invoke void @_ZN3sim14MouseInterface17resetWheelEncoderERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(296) %179, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %181 unwind label %208

181:                                              ; preds = %180
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #4
  %182 = call noundef zeroext i1 @_ZN10continuous10Continuous8wallLeftEv(ptr noundef nonnull align 8 dereferenceable(408) %14)
  %183 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 9
  %184 = getelementptr inbounds [3 x i8], ptr %183, i64 0, i64 0
  %185 = zext i1 %182 to i8
  store volatile i8 %185, ptr %184, align 1, !tbaa !23
  %186 = call noundef zeroext i1 @_ZN10continuous10Continuous9wallFrontEv(ptr noundef nonnull align 8 dereferenceable(408) %14)
  %187 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 9
  %188 = getelementptr inbounds [3 x i8], ptr %187, i64 0, i64 1
  %189 = zext i1 %186 to i8
  store volatile i8 %189, ptr %188, align 1, !tbaa !23
  %190 = call noundef zeroext i1 @_ZN10continuous10Continuous9wallRightEv(ptr noundef nonnull align 8 dereferenceable(408) %14)
  %191 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 9
  %192 = getelementptr inbounds [3 x i8], ptr %191, i64 0, i64 2
  %193 = zext i1 %190 to i8
  store volatile i8 %193, ptr %192, align 1, !tbaa !23
  %194 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 24
  store volatile i8 0, ptr %194, align 4, !tbaa !19
  br label %251

195:                                              ; preds = %171
  %196 = landingpad { ptr, i32 }
          cleanup
  %197 = extractvalue { ptr, i32 } %196, 0
  store ptr %197, ptr %6, align 8
  %198 = extractvalue { ptr, i32 } %196, 1
  store i32 %198, ptr %7, align 4
  br label %203

199:                                              ; preds = %176
  %200 = landingpad { ptr, i32 }
          cleanup
  %201 = extractvalue { ptr, i32 } %200, 0
  store ptr %201, ptr %6, align 8
  %202 = extractvalue { ptr, i32 } %200, 1
  store i32 %202, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  br label %203

203:                                              ; preds = %199, %195
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #4
  br label %252

204:                                              ; preds = %177
  %205 = landingpad { ptr, i32 }
          cleanup
  %206 = extractvalue { ptr, i32 } %205, 0
  store ptr %206, ptr %6, align 8
  %207 = extractvalue { ptr, i32 } %205, 1
  store i32 %207, ptr %7, align 4
  br label %212

208:                                              ; preds = %180
  %209 = landingpad { ptr, i32 }
          cleanup
  %210 = extractvalue { ptr, i32 } %209, 0
  store ptr %210, ptr %6, align 8
  %211 = extractvalue { ptr, i32 } %209, 1
  store i32 %211, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #4
  br label %212

212:                                              ; preds = %208, %204
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #4
  br label %252

213:                                              ; preds = %166
  call void @_ZN10continuous10Continuous14curveTurnRightEv(ptr noundef nonnull align 8 dereferenceable(408) %14)
  br label %249

214:                                              ; preds = %60
  %215 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 26
  store volatile i32 2, ptr %215, align 4, !tbaa !35
  call void @_ZN10continuous10Continuous14curveTurnRightEv(ptr noundef nonnull align 8 dereferenceable(408) %14)
  br label %249

216:                                              ; preds = %60
  %217 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 28
  store i32 0, ptr %217, align 4, !tbaa !36
  %218 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 27
  store i32 0, ptr %218, align 8, !tbaa !37
  %219 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 37
  %220 = load ptr, ptr %219, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef @.str.68, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %221 unwind label %229

221:                                              ; preds = %216
  invoke void @_ZN3sim14MouseInterface17resetWheelEncoderERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(296) %220, ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %222 unwind label %233

222:                                              ; preds = %221
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #4
  %223 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 37
  %224 = load ptr, ptr %223, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str.69, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %225 unwind label %238

225:                                              ; preds = %222
  invoke void @_ZN3sim14MouseInterface17resetWheelEncoderERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(296) %224, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %226 unwind label %242

226:                                              ; preds = %225
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #4
  call void @_ZN10continuous10Continuous10turnAroundEv(ptr noundef nonnull align 8 dereferenceable(408) %14)
  %227 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 13
  store i8 1, ptr %227, align 8, !tbaa !22
  %228 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 24
  store volatile i8 0, ptr %228, align 4, !tbaa !19
  br label %251

229:                                              ; preds = %216
  %230 = landingpad { ptr, i32 }
          cleanup
  %231 = extractvalue { ptr, i32 } %230, 0
  store ptr %231, ptr %6, align 8
  %232 = extractvalue { ptr, i32 } %230, 1
  store i32 %232, ptr %7, align 4
  br label %237

233:                                              ; preds = %221
  %234 = landingpad { ptr, i32 }
          cleanup
  %235 = extractvalue { ptr, i32 } %234, 0
  store ptr %235, ptr %6, align 8
  %236 = extractvalue { ptr, i32 } %234, 1
  store i32 %236, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #4
  br label %237

237:                                              ; preds = %233, %229
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #4
  br label %252

238:                                              ; preds = %222
  %239 = landingpad { ptr, i32 }
          cleanup
  %240 = extractvalue { ptr, i32 } %239, 0
  store ptr %240, ptr %6, align 8
  %241 = extractvalue { ptr, i32 } %239, 1
  store i32 %241, ptr %7, align 4
  br label %246

242:                                              ; preds = %225
  %243 = landingpad { ptr, i32 }
          cleanup
  %244 = extractvalue { ptr, i32 } %243, 0
  store ptr %244, ptr %6, align 8
  %245 = extractvalue { ptr, i32 } %243, 1
  store i32 %245, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #4
  br label %246

246:                                              ; preds = %242, %238
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #4
  br label %252

247:                                              ; preds = %60
  %248 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 26
  store volatile i32 0, ptr %248, align 4, !tbaa !35
  br label %249

249:                                              ; preds = %247, %214, %213, %165
  %250 = getelementptr inbounds %"class.continuous::Continuous", ptr %14, i32 0, i32 24
  store volatile i8 0, ptr %250, align 4, !tbaa !19
  br label %251

251:                                              ; preds = %249, %226, %181, %55, %18
  ret void

252:                                              ; preds = %246, %237, %212, %203
  %253 = load ptr, ptr %6, align 8
  %254 = load i32, ptr %7, align 4
  %255 = insertvalue { ptr, i32 } poison, ptr %253, 0
  %256 = insertvalue { ptr, i32 } %255, i32 %254, 1
  resume { ptr, i32 } %256
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10continuous10Continuous11readSensorsEv(ptr noundef nonnull align 8 dereferenceable(408)) #2 align 2

declare noundef double @_ZN3sim14MouseInterface8readGyroEv(ptr noundef nonnull align 8 dereferenceable(296)) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10continuous10Continuous11moveForwardEv(ptr noundef nonnull align 8 dereferenceable(408)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10continuous10Continuous17forwardCorrectionEv(ptr noundef nonnull align 8 dereferenceable(408)) #2 align 2

declare void @_ZN3sim14MouseInterface17resetWheelEncoderERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(296), ptr noundef nonnull align 8 dereferenceable(32)) #3

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10continuous10Continuous14curveTurnRightEv(ptr noundef nonnull align 8 dereferenceable(408)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10continuous10Continuous10turnAroundEv(ptr noundef nonnull align 8 dereferenceable(408)) #2 align 2

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

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

!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, !14, i64 296}
!10 = !{!"_ZTSN10continuous10ContinuousE", !11, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !13, i64 24, !13, i64 28, !7, i64 32, !7, i64 288, !7, i64 293, !14, i64 296, !14, i64 297, !12, i64 300, !14, i64 304, !14, i64 305, !14, i64 306, !14, i64 307, !12, i64 308, !12, i64 312, !12, i64 316, !14, i64 320, !14, i64 321, !14, i64 322, !14, i64 323, !14, i64 324, !13, i64 328, !15, i64 332, !12, i64 336, !12, i64 340, !16, i64 344, !16, i64 352, !16, i64 360, !16, i64 368, !16, i64 376, !16, i64 384, !12, i64 392, !12, i64 396, !6, i64 400}
!11 = !{!"_ZTS15IMouseAlgorithm"}
!12 = !{!"int", !7, i64 0}
!13 = !{!"float", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"_ZTSN10continuous10ContinuousUt_E", !7, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!10, !14, i64 324}
!20 = !{!10, !6, i64 400}
!21 = !{!10, !13, i64 328}
!22 = !{!10, !14, i64 304}
!23 = !{!14, !14, i64 0}
!24 = !{!10, !14, i64 305}
!25 = !{!12, !12, i64 0}
!26 = !{!7, !7, i64 0}
!27 = !{!10, !14, i64 297}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!10, !14, i64 307}
!31 = !{!10, !12, i64 12}
!32 = !{!10, !12, i64 308}
!33 = !{!10, !12, i64 300}
!34 = !{!10, !12, i64 8}
!35 = !{!10, !15, i64 332}
!36 = !{!10, !12, i64 340}
!37 = !{!10, !12, i64 336}


; 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::__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::allocator.0" = type { i8 }

@_ZZN10continuous10Continuous10correctionEvE17totalForwardCount = external hidden local_unnamed_addr global i32, align 4
@_ZZN10continuous10Continuous10correctionEvE12forwardCount = external hidden local_unnamed_addr global i32, align 4
@_ZZN10continuous10Continuous10correctionEvE15in_acceleration = external hidden local_unnamed_addr global i8, align 1
@_ZZN10continuous10Continuous10correctionEvE13indexInBuffer = external hidden local_unnamed_addr global i8, align 1
@_ZZN10continuous10Continuous10correctionEvE12movedForward = external hidden local_unnamed_addr global i8, align 1
@.str.68 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [12 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10continuous10Continuous8wallLeftEv(ptr noundef nonnull align 8 dereferenceable(408)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10continuous10Continuous9wallFrontEv(ptr noundef nonnull align 8 dereferenceable(408)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10continuous10Continuous9wallRightEv(ptr noundef nonnull align 8 dereferenceable(408)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10continuous10Continuous10correctionEv(ptr noundef nonnull align 8 dereferenceable(408) %0) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca %"class.std::allocator.0", align 1
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::allocator.0", align 1
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::allocator.0", align 1
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.std::allocator.0", align 1
  %10 = getelementptr inbounds i8, ptr %0, i64 296
  %11 = load volatile i8, ptr %10, align 8, !tbaa !5, !range !16, !noundef !17
  %12 = trunc nuw i8 %11 to i1
  br i1 %12, label %13, label %156

13:                                               ; preds = %1
  tail call void @_ZN10continuous10Continuous11readSensorsEv(ptr noundef nonnull align 8 dereferenceable(408) %0)
  %14 = getelementptr inbounds i8, ptr %0, i64 400
  %15 = load ptr, ptr %14, align 8, !tbaa !18
  %16 = tail call noundef double @_ZN3sim14MouseInterface8readGyroEv(ptr noundef nonnull align 8 dereferenceable(296) %15)
  %17 = fptrunc double %16 to float
  %18 = getelementptr inbounds i8, ptr %0, i64 328
  store volatile float %17, ptr %18, align 8, !tbaa !19
  %19 = getelementptr inbounds i8, ptr %0, i64 304
  %20 = load i8, ptr %19, align 8, !tbaa !20, !range !16, !noundef !17
  %21 = trunc nuw i8 %20 to i1
  br i1 %21, label %22, label %._crit_edge28

._crit_edge28:                                    ; preds = %13
  %.pre = load i8, ptr @_ZZN10continuous10Continuous10correctionEvE13indexInBuffer, align 1, !tbaa !21
  %.pre29 = sext i8 %.pre to i64
  br label %42

22:                                               ; preds = %13
  store i8 0, ptr @_ZZN10continuous10Continuous10correctionEvE12movedForward, align 1, !tbaa !22
  %23 = getelementptr inbounds i8, ptr %0, i64 305
  %24 = load i8, ptr %23, align 1, !tbaa !23, !range !16, !noundef !17
  %25 = trunc nuw i8 %24 to i1
  br i1 %25, label %26, label %27

26:                                               ; preds = %22
  store i8 0, ptr %23, align 1, !tbaa !23
  br label %27

27:                                               ; preds = %26, %22
  %28 = load i32, ptr @_ZZN10continuous10Continuous10correctionEvE12forwardCount, align 4, !tbaa !24
  %.not = icmp eq i32 %28, 0
  br i1 %.not, label %31, label %29

29:                                               ; preds = %27
  %30 = add nsw i32 %28, -1
  store i32 %30, ptr @_ZZN10continuous10Continuous10correctionEvE12forwardCount, align 4, !tbaa !24
  br label %32

31:                                               ; preds = %27
  store i32 0, ptr @_ZZN10continuous10Continuous10correctionEvE17totalForwardCount, align 4, !tbaa !24
  store i8 0, ptr @_ZZN10continuous10Continuous10correctionEvE15in_acceleration, align 1, !tbaa !22
  br label %32

32:                                               ; preds = %31, %29
  %33 = load i8, ptr @_ZZN10continuous10Continuous10correctionEvE13indexInBuffer, align 1, !tbaa !21
  %34 = add i8 %33, 1
  store i8 %34, ptr @_ZZN10continuous10Continuous10correctionEvE13indexInBuffer, align 1, !tbaa !21
  store i8 0, ptr %19, align 8, !tbaa !20
  %35 = getelementptr inbounds i8, ptr %0, i64 32
  %36 = sext i8 %34 to i64
  %37 = getelementptr inbounds [256 x i8], ptr %35, i64 0, i64 %36
  %38 = load volatile i8, ptr %37, align 1, !tbaa !21
  %39 = icmp eq i8 %38, 0
  br i1 %39, label %40, label %42

40:                                               ; preds = %32
  store volatile i8 0, ptr %10, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %0, i64 297
  store volatile i8 1, ptr %41, align 1, !tbaa !25
  store i8 0, ptr @_ZZN10continuous10Continuous10correctionEvE13indexInBuffer, align 1, !tbaa !21
  br label %156

42:                                               ; preds = %._crit_edge28, %32
  %.pre-phi = phi i64 [ %.pre29, %._crit_edge28 ], [ %36, %32 ]
  %43 = phi i8 [ %.pre, %._crit_edge28 ], [ %34, %32 ]
  %44 = getelementptr inbounds i8, ptr %0, i64 32
  %45 = getelementptr inbounds [256 x i8], ptr %44, i64 0, i64 %.pre-phi
  %46 = load volatile i8, ptr %45, align 1, !tbaa !21
  switch i8 %46, label %154 [
    i8 102, label %47
    i8 114, label %99
    i8 108, label %133
    i8 97, label %135
  ]

47:                                               ; preds = %42
  %48 = load i8, ptr @_ZZN10continuous10Continuous10correctionEvE15in_acceleration, align 1, !tbaa !22, !range !16, !noundef !17
  %49 = trunc nuw i8 %48 to i1
  br i1 %49, label %84, label %50

50:                                               ; preds = %47
  store i32 1, ptr @_ZZN10continuous10Continuous10correctionEvE12forwardCount, align 4, !tbaa !24
  %51 = sext i8 %43 to i64
  %.0825 = add nsw i64 %51, 1
  %52 = getelementptr inbounds [256 x i8], ptr %44, i64 0, i64 %.0825
  %53 = load volatile i8, ptr %52, align 1, !tbaa !21
  %54 = icmp eq i8 %53, 102
  br i1 %54, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %50
  %55 = add nsw i64 %.pre-phi, 1
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %55, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %56 = phi i32 [ 1, %.lr.ph.preheader ], [ %57, %.lr.ph ]
  %57 = add nuw nsw i32 %56, 1
  store i32 %57, ptr @_ZZN10continuous10Continuous10correctionEvE12forwardCount, align 4, !tbaa !24
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %58 = getelementptr inbounds [256 x i8], ptr %44, i64 0, i64 %indvars.iv.next
  %59 = load volatile i8, ptr %58, align 1, !tbaa !21
  %60 = icmp eq i8 %59, 102
  br i1 %60, label %.lr.ph, label %._crit_edge, !llvm.loop !26

._crit_edge:                                      ; preds = %.lr.ph, %50
  %61 = phi i32 [ 1, %50 ], [ %57, %.lr.ph ]
  store i32 %61, ptr @_ZZN10continuous10Continuous10correctionEvE17totalForwardCount, align 4, !tbaa !24
  %62 = getelementptr inbounds i8, ptr %0, i64 307
  %63 = load i8, ptr %62, align 1, !tbaa !28, !range !16, !noundef !17
  %64 = trunc nuw i8 %63 to i1
  %65 = sitofp i32 %61 to float
  %66 = getelementptr inbounds i8, ptr %0, i64 308
  br i1 %64, label %67, label %75

67:                                               ; preds = %._crit_edge
  %68 = getelementptr inbounds i8, ptr %0, i64 12
  %69 = load i32, ptr %68, align 4, !tbaa !29
  %70 = sitofp i32 %69 to float
  %71 = fmul float %65, %70
  %72 = fptosi float %71 to i32
  %73 = getelementptr inbounds i8, ptr %0, i64 300
  %74 = load i32, ptr %73, align 4, !tbaa !30
  %spec.store.select = tail call i32 @llvm.smin.i32(i32 %74, i32 %72)
  %spec.store.select23 = tail call i32 @llvm.smax.i32(i32 %spec.store.select, i32 %69)
  br label %83

75:                                               ; preds = %._crit_edge
  %76 = getelementptr inbounds i8, ptr %0, i64 8
  %77 = load i32, ptr %76, align 8, !tbaa !31
  %78 = sitofp i32 %77 to float
  %79 = fmul float %65, %78
  %80 = fptosi float %79 to i32
  %spec.store.select22 = tail call i32 @llvm.smax.i32(i32 %77, i32 %80)
  %81 = getelementptr inbounds i8, ptr %0, i64 300
  %82 = load i32, ptr %81, align 4, !tbaa !30
  %spec.store.select24 = tail call i32 @llvm.smin.i32(i32 %spec.store.select22, i32 %82)
  br label %83

83:                                               ; preds = %75, %67
  %spec.store.select24.sink = phi i32 [ %spec.store.select24, %75 ], [ %spec.store.select23, %67 ]
  store i32 %spec.store.select24.sink, ptr %66, align 4
  store i8 1, ptr @_ZZN10continuous10Continuous10correctionEvE15in_acceleration, align 1, !tbaa !22
  br label %93

84:                                               ; preds = %47
  %85 = load i32, ptr @_ZZN10continuous10Continuous10correctionEvE12forwardCount, align 4, !tbaa !24
  %86 = load i32, ptr @_ZZN10continuous10Continuous10correctionEvE17totalForwardCount, align 4, !tbaa !24
  %87 = add nsw i32 %86, 4
  %88 = sdiv i32 %87, 5
  %89 = add nsw i32 %88, 2
  %90 = icmp eq i32 %85, %89
  br i1 %90, label %91, label %93

91:                                               ; preds = %84
  %92 = getelementptr inbounds i8, ptr %0, i64 308
  store i32 620, ptr %92, align 4, !tbaa !32
  br label %93

93:                                               ; preds = %84, %91, %83
  %94 = getelementptr inbounds i8, ptr %0, i64 332
  store volatile i32 1, ptr %94, align 4, !tbaa !33
  %95 = load i8, ptr @_ZZN10continuous10Continuous10correctionEvE12movedForward, align 1, !tbaa !22, !range !16, !noundef !17
  %96 = trunc nuw i8 %95 to i1
  br i1 %96, label %98, label %97

97:                                               ; preds = %93
  store i8 1, ptr @_ZZN10continuous10Continuous10correctionEvE12movedForward, align 1, !tbaa !22
  tail call void @_ZN10continuous10Continuous11moveForwardEv(ptr noundef nonnull align 8 dereferenceable(408) %0)
  br label %98

98:                                               ; preds = %97, %93
  tail call void @_ZN10continuous10Continuous17forwardCorrectionEv(ptr noundef nonnull align 8 dereferenceable(408) %0)
  br label %156

99:                                               ; preds = %42
  %100 = getelementptr inbounds i8, ptr %0, i64 332
  store volatile i32 3, ptr %100, align 4, !tbaa !33
  %101 = getelementptr inbounds i8, ptr %0, i64 305
  %102 = load i8, ptr %101, align 1, !tbaa !23, !range !16, !noundef !17
  %103 = trunc nuw i8 %102 to i1
  br i1 %103, label %104, label %132

104:                                              ; preds = %99
  %105 = getelementptr inbounds i8, ptr %0, i64 340
  store i32 0, ptr %105, align 4, !tbaa !34
  %106 = getelementptr inbounds i8, ptr %0, i64 336
  store i32 0, ptr %106, align 8, !tbaa !35
  %107 = load ptr, ptr %14, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull @.str.68, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %108 unwind label %122

108:                                              ; preds = %104
  invoke void @_ZN3sim14MouseInterface17resetWheelEncoderERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(296) %107, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %109 unwind label %124

109:                                              ; preds = %108
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #5
  %110 = load ptr, ptr %14, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @.str.69, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %111 unwind label %127

111:                                              ; preds = %109
  invoke void @_ZN3sim14MouseInterface17resetWheelEncoderERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(296) %110, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %112 unwind label %129

112:                                              ; preds = %111
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  %113 = call noundef zeroext i1 @_ZN10continuous10Continuous8wallLeftEv(ptr noundef nonnull align 8 dereferenceable(408) %0)
  %114 = getelementptr inbounds i8, ptr %0, i64 293
  %115 = zext i1 %113 to i8
  store volatile i8 %115, ptr %114, align 1, !tbaa !22
  %116 = call noundef zeroext i1 @_ZN10continuous10Continuous9wallFrontEv(ptr noundef nonnull align 8 dereferenceable(408) %0)
  %117 = getelementptr inbounds i8, ptr %0, i64 294
  %118 = zext i1 %116 to i8
  store volatile i8 %118, ptr %117, align 2, !tbaa !22
  %119 = call noundef zeroext i1 @_ZN10continuous10Continuous9wallRightEv(ptr noundef nonnull align 8 dereferenceable(408) %0)
  %120 = getelementptr inbounds i8, ptr %0, i64 295
  %121 = zext i1 %119 to i8
  store volatile i8 %121, ptr %120, align 1, !tbaa !22
  br label %156

122:                                              ; preds = %104
  %123 = landingpad { ptr, i32 }
          cleanup
  br label %126

124:                                              ; preds = %108
  %125 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  br label %126

126:                                              ; preds = %124, %122
  %.pn17 = phi { ptr, i32 } [ %125, %124 ], [ %123, %122 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #5
  br label %158

127:                                              ; preds = %109
  %128 = landingpad { ptr, i32 }
          cleanup
  br label %131

129:                                              ; preds = %111
  %130 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  br label %131

131:                                              ; preds = %129, %127
  %.pn19 = phi { ptr, i32 } [ %130, %129 ], [ %128, %127 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  br label %158

132:                                              ; preds = %99
  tail call void @_ZN10continuous10Continuous14curveTurnRightEv(ptr noundef nonnull align 8 dereferenceable(408) %0)
  br label %156

133:                                              ; preds = %42
  %134 = getelementptr inbounds i8, ptr %0, i64 332
  store volatile i32 2, ptr %134, align 4, !tbaa !33
  tail call void @_ZN10continuous10Continuous14curveTurnRightEv(ptr noundef nonnull align 8 dereferenceable(408) %0)
  br label %156

135:                                              ; preds = %42
  %136 = getelementptr inbounds i8, ptr %0, i64 340
  store i32 0, ptr %136, align 4, !tbaa !34
  %137 = getelementptr inbounds i8, ptr %0, i64 336
  store i32 0, ptr %137, align 8, !tbaa !35
  %138 = load ptr, ptr %14, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull @.str.68, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %139 unwind label %144

139:                                              ; preds = %135
  invoke void @_ZN3sim14MouseInterface17resetWheelEncoderERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(296) %138, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %140 unwind label %146

140:                                              ; preds = %139
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  %141 = load ptr, ptr %14, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull @.str.69, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %142 unwind label %149

142:                                              ; preds = %140
  invoke void @_ZN3sim14MouseInterface17resetWheelEncoderERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(296) %141, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %143 unwind label %151

143:                                              ; preds = %142
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  call void @_ZN10continuous10Continuous10turnAroundEv(ptr noundef nonnull align 8 dereferenceable(408) %0)
  store i8 1, ptr %19, align 8, !tbaa !20
  br label %156

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

146:                                              ; preds = %139
  %147 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  br label %148

148:                                              ; preds = %146, %144
  %.pn = phi { ptr, i32 } [ %147, %146 ], [ %145, %144 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  br label %158

149:                                              ; preds = %140
  %150 = landingpad { ptr, i32 }
          cleanup
  br label %153

151:                                              ; preds = %142
  %152 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  br label %153

153:                                              ; preds = %151, %149
  %.pn15 = phi { ptr, i32 } [ %152, %151 ], [ %150, %149 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  br label %158

154:                                              ; preds = %42
  %155 = getelementptr inbounds i8, ptr %0, i64 332
  store volatile i32 0, ptr %155, align 4, !tbaa !33
  br label %156

156:                                              ; preds = %98, %132, %133, %154, %1, %143, %112, %40
  %157 = getelementptr inbounds i8, ptr %0, i64 324
  store volatile i8 0, ptr %157, align 4, !tbaa !36
  ret void

158:                                              ; preds = %153, %148, %131, %126
  %.pn15.pn = phi { ptr, i32 } [ %.pn15, %153 ], [ %.pn, %148 ], [ %.pn19, %131 ], [ %.pn17, %126 ]
  resume { ptr, i32 } %.pn15.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10continuous10Continuous11readSensorsEv(ptr noundef nonnull align 8 dereferenceable(408)) local_unnamed_addr #2 align 2

declare noundef double @_ZN3sim14MouseInterface8readGyroEv(ptr noundef nonnull align 8 dereferenceable(296)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10continuous10Continuous11moveForwardEv(ptr noundef nonnull align 8 dereferenceable(408)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10continuous10Continuous17forwardCorrectionEv(ptr noundef nonnull align 8 dereferenceable(408)) local_unnamed_addr #2 align 2

declare void @_ZN3sim14MouseInterface17resetWheelEncoderERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(296), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10continuous10Continuous14curveTurnRightEv(ptr noundef nonnull align 8 dereferenceable(408)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10continuous10Continuous10turnAroundEv(ptr noundef nonnull align 8 dereferenceable(408)) local_unnamed_addr #2 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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, !12, i64 296}
!6 = !{!"_ZTSN10continuous10ContinuousE", !7, i64 0, !8, i64 8, !8, i64 12, !8, i64 16, !8, i64 20, !11, i64 24, !11, i64 28, !9, i64 32, !9, i64 288, !9, i64 293, !12, i64 296, !12, i64 297, !8, i64 300, !12, i64 304, !12, i64 305, !12, i64 306, !12, i64 307, !8, i64 308, !8, i64 312, !8, i64 316, !12, i64 320, !12, i64 321, !12, i64 322, !12, i64 323, !12, i64 324, !11, i64 328, !13, i64 332, !8, i64 336, !8, i64 340, !14, i64 344, !14, i64 352, !14, i64 360, !14, i64 368, !14, i64 376, !14, i64 384, !8, i64 392, !8, i64 396, !15, i64 400}
!7 = !{!"_ZTS15IMouseAlgorithm"}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"float", !9, i64 0}
!12 = !{!"bool", !9, i64 0}
!13 = !{!"_ZTSN10continuous10ContinuousUt_E", !9, i64 0}
!14 = !{!"double", !9, i64 0}
!15 = !{!"any pointer", !9, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!6, !15, i64 400}
!19 = !{!6, !11, i64 328}
!20 = !{!6, !12, i64 304}
!21 = !{!9, !9, i64 0}
!22 = !{!12, !12, i64 0}
!23 = !{!6, !12, i64 305}
!24 = !{!8, !8, i64 0}
!25 = !{!6, !12, i64 297}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!6, !12, i64 307}
!29 = !{!6, !8, i64 12}
!30 = !{!6, !8, i64 300}
!31 = !{!6, !8, i64 8}
!32 = !{!6, !8, i64 308}
!33 = !{!6, !13, i64 332}
!34 = !{!6, !8, i64 340}
!35 = !{!6, !8, i64 336}
!36 = !{!6, !12, i64 324}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass