; LLVM IR from shupx/swarm_sync_sim :: src/fw_plane_sim/src/px4_lib/geo (geo)

; 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"

%struct.crosstrack_error_s = type { i8, float, float }

; Function Attrs: nounwind
declare double @sin(double noundef) #0

; Function Attrs: nounwind
declare double @cos(double noundef) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_Z29get_distance_to_next_waypointdddd(double noundef, double noundef, double noundef, double noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_Z28get_bearing_to_next_waypointdddd(double noundef, double noundef, double noundef, double noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN6matrix7wrap_piIfEET_S1_(float noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z19get_distance_to_arcP18crosstrack_error_sddddfff(ptr noundef %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, float noundef %5, float noundef %6, float noundef %7) #2 {
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i8, align 1
  %24 = alloca float, align 4
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  %28 = alloca double, align 8
  %29 = alloca double, align 8
  %30 = alloca double, align 8
  %31 = alloca double, align 8
  %32 = alloca double, align 8
  %33 = alloca float, align 4
  %34 = alloca float, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store double %1, ptr %11, align 8, !tbaa !9
  store double %2, ptr %12, align 8, !tbaa !9
  store double %3, ptr %13, align 8, !tbaa !9
  store double %4, ptr %14, align 8, !tbaa !9
  store float %5, ptr %15, align 4, !tbaa !11
  store float %6, ptr %16, align 4, !tbaa !11
  store float %7, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  store float 0.000000e+00, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  store float 0.000000e+00, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  %35 = load double, ptr %11, align 8, !tbaa !9
  %36 = load double, ptr %12, align 8, !tbaa !9
  %37 = load double, ptr %13, align 8, !tbaa !9
  %38 = load double, ptr %14, align 8, !tbaa !9
  %39 = call noundef float @_Z28get_bearing_to_next_waypointdddd(double noundef %35, double noundef %36, double noundef %37, double noundef %38)
  store float %39, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  store i32 -1, ptr %21, align 4, !tbaa !13
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.crosstrack_error_s, ptr %40, i32 0, i32 0
  store i8 0, ptr %41, align 4, !tbaa !15
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.crosstrack_error_s, ptr %42, i32 0, i32 1
  store float 0.000000e+00, ptr %43, align 4, !tbaa !18
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.crosstrack_error_s, ptr %44, i32 0, i32 2
  store float 0.000000e+00, ptr %45, align 4, !tbaa !19
  %46 = load float, ptr %15, align 4, !tbaa !11
  %47 = fcmp olt float %46, 0x3FB99999A0000000
  br i1 %47, label %48, label %50

48:                                               ; preds = %8
  %49 = load i32, ptr %21, align 4, !tbaa !13
  store i32 %49, ptr %9, align 4
  store i32 1, ptr %22, align 4
  br label %234

50:                                               ; preds = %8
  %51 = load float, ptr %17, align 4, !tbaa !11
  %52 = fcmp oge float %51, 0.000000e+00
  br i1 %52, label %53, label %64

53:                                               ; preds = %50
  %54 = load float, ptr %16, align 4, !tbaa !11
  store float %54, ptr %18, align 4, !tbaa !11
  %55 = load float, ptr %16, align 4, !tbaa !11
  %56 = load float, ptr %17, align 4, !tbaa !11
  %57 = fadd float %55, %56
  store float %57, ptr %19, align 4, !tbaa !11
  %58 = load float, ptr %19, align 4, !tbaa !11
  %59 = fcmp ogt float %58, 0x401921FB60000000
  br i1 %59, label %60, label %63

60:                                               ; preds = %53
  %61 = load float, ptr %19, align 4, !tbaa !11
  %62 = fsub float %61, 0x401921FB60000000
  store float %62, ptr %19, align 4, !tbaa !11
  br label %63

63:                                               ; preds = %60, %53
  br label %75

64:                                               ; preds = %50
  %65 = load float, ptr %16, align 4, !tbaa !11
  store float %65, ptr %19, align 4, !tbaa !11
  %66 = load float, ptr %16, align 4, !tbaa !11
  %67 = load float, ptr %17, align 4, !tbaa !11
  %68 = fsub float %66, %67
  store float %68, ptr %18, align 4, !tbaa !11
  %69 = load float, ptr %18, align 4, !tbaa !11
  %70 = fcmp olt float %69, 0.000000e+00
  br i1 %70, label %71, label %74

71:                                               ; preds = %64
  %72 = load float, ptr %18, align 4, !tbaa !11
  %73 = fadd float %72, 0x401921FB60000000
  store float %73, ptr %18, align 4, !tbaa !11
  br label %74

74:                                               ; preds = %71, %64
  br label %75

75:                                               ; preds = %74, %63
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #3
  store i8 0, ptr %23, align 1, !tbaa !20
  %76 = load float, ptr %19, align 4, !tbaa !11
  %77 = load float, ptr %18, align 4, !tbaa !11
  %78 = fcmp oge float %76, %77
  br i1 %78, label %79, label %88

79:                                               ; preds = %75
  %80 = load float, ptr %20, align 4, !tbaa !11
  %81 = load float, ptr %18, align 4, !tbaa !11
  %82 = fcmp oge float %80, %81
  br i1 %82, label %83, label %88

83:                                               ; preds = %79
  %84 = load float, ptr %20, align 4, !tbaa !11
  %85 = load float, ptr %19, align 4, !tbaa !11
  %86 = fcmp ole float %84, %85
  br i1 %86, label %87, label %88

87:                                               ; preds = %83
  store i8 1, ptr %23, align 1, !tbaa !20
  br label %88

88:                                               ; preds = %87, %83, %79, %75
  %89 = load float, ptr %19, align 4, !tbaa !11
  %90 = load float, ptr %18, align 4, !tbaa !11
  %91 = fcmp olt float %89, %90
  br i1 %91, label %92, label %101

92:                                               ; preds = %88
  %93 = load float, ptr %20, align 4, !tbaa !11
  %94 = load float, ptr %18, align 4, !tbaa !11
  %95 = fcmp ogt float %93, %94
  br i1 %95, label %100, label %96

96:                                               ; preds = %92
  %97 = load float, ptr %20, align 4, !tbaa !11
  %98 = load float, ptr %19, align 4, !tbaa !11
  %99 = fcmp olt float %97, %98
  br i1 %99, label %100, label %101

100:                                              ; preds = %96, %92
  store i8 1, ptr %23, align 1, !tbaa !20
  br label %101

101:                                              ; preds = %100, %96, %88
  %102 = load i8, ptr %23, align 1, !tbaa !20, !range !21, !noundef !22
  %103 = trunc i8 %102 to i1
  br i1 %103, label %104, label %135

104:                                              ; preds = %101
  %105 = load ptr, ptr %10, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.crosstrack_error_s, ptr %105, i32 0, i32 0
  store i8 0, ptr %106, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  %107 = load double, ptr %11, align 8, !tbaa !9
  %108 = load double, ptr %12, align 8, !tbaa !9
  %109 = load double, ptr %13, align 8, !tbaa !9
  %110 = load double, ptr %14, align 8, !tbaa !9
  %111 = call noundef float @_Z29get_distance_to_next_waypointdddd(double noundef %107, double noundef %108, double noundef %109, double noundef %110)
  store float %111, ptr %24, align 4, !tbaa !11
  %112 = load float, ptr %24, align 4, !tbaa !11
  %113 = load float, ptr %15, align 4, !tbaa !11
  %114 = fcmp ole float %112, %113
  br i1 %114, label %115, label %125

115:                                              ; preds = %104
  %116 = load float, ptr %15, align 4, !tbaa !11
  %117 = load float, ptr %24, align 4, !tbaa !11
  %118 = fsub float %116, %117
  %119 = load ptr, ptr %10, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.crosstrack_error_s, ptr %119, i32 0, i32 1
  store float %118, ptr %120, align 4, !tbaa !18
  %121 = load float, ptr %20, align 4, !tbaa !11
  %122 = fadd float %121, 0x400921FB60000000
  %123 = load ptr, ptr %10, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.crosstrack_error_s, ptr %123, i32 0, i32 2
  store float %122, ptr %124, align 4, !tbaa !19
  br label %134

125:                                              ; preds = %104
  %126 = load float, ptr %24, align 4, !tbaa !11
  %127 = load float, ptr %15, align 4, !tbaa !11
  %128 = fsub float %126, %127
  %129 = load ptr, ptr %10, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.crosstrack_error_s, ptr %129, i32 0, i32 1
  store float %128, ptr %130, align 4, !tbaa !18
  %131 = load float, ptr %20, align 4, !tbaa !11
  %132 = load ptr, ptr %10, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.crosstrack_error_s, ptr %132, i32 0, i32 2
  store float %131, ptr %133, align 4, !tbaa !19
  br label %134

134:                                              ; preds = %125, %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  br label %226

135:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  %136 = load float, ptr %15, align 4, !tbaa !11
  %137 = fpext float %136 to double
  %138 = load float, ptr %16, align 4, !tbaa !11
  %139 = fpext float %138 to double
  %140 = call double @sin(double noundef %139) #3
  %141 = fmul double %137, %140
  store double %141, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #3
  %142 = load float, ptr %15, align 4, !tbaa !11
  %143 = fpext float %142 to double
  %144 = load float, ptr %16, align 4, !tbaa !11
  %145 = fpext float %144 to double
  %146 = call double @cos(double noundef %145) #3
  %147 = fmul double %143, %146
  store double %147, ptr %26, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #3
  %148 = load float, ptr %15, align 4, !tbaa !11
  %149 = fpext float %148 to double
  %150 = load float, ptr %16, align 4, !tbaa !11
  %151 = load float, ptr %17, align 4, !tbaa !11
  %152 = fadd float %150, %151
  %153 = call noundef float @_ZN6matrix7wrap_piIfEET_S1_(float noundef %152)
  %154 = fpext float %153 to double
  %155 = call double @sin(double noundef %154) #3
  %156 = fmul double %149, %155
  store double %156, ptr %27, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #3
  %157 = load float, ptr %15, align 4, !tbaa !11
  %158 = fpext float %157 to double
  %159 = load float, ptr %16, align 4, !tbaa !11
  %160 = load float, ptr %17, align 4, !tbaa !11
  %161 = fadd float %159, %160
  %162 = call noundef float @_ZN6matrix7wrap_piIfEET_S1_(float noundef %161)
  %163 = fpext float %162 to double
  %164 = call double @cos(double noundef %163) #3
  %165 = fmul double %158, %164
  store double %165, ptr %28, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #3
  %166 = load double, ptr %12, align 8, !tbaa !9
  %167 = load double, ptr %25, align 8, !tbaa !9
  %168 = fdiv double %167, 1.111110e+05
  %169 = fadd double %166, %168
  store double %169, ptr %29, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #3
  %170 = load double, ptr %11, align 8, !tbaa !9
  %171 = load double, ptr %26, align 8, !tbaa !9
  %172 = load double, ptr %11, align 8, !tbaa !9
  %173 = call double @cos(double noundef %172) #3
  %174 = fmul double %171, %173
  %175 = fdiv double %174, 1.111110e+05
  %176 = fadd double %170, %175
  store double %176, ptr %30, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #3
  %177 = load double, ptr %12, align 8, !tbaa !9
  %178 = load double, ptr %27, align 8, !tbaa !9
  %179 = fdiv double %178, 1.111110e+05
  %180 = fadd double %177, %179
  store double %180, ptr %31, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #3
  %181 = load double, ptr %11, align 8, !tbaa !9
  %182 = load double, ptr %28, align 8, !tbaa !9
  %183 = load double, ptr %11, align 8, !tbaa !9
  %184 = call double @cos(double noundef %183) #3
  %185 = fmul double %182, %184
  %186 = fdiv double %185, 1.111110e+05
  %187 = fadd double %181, %186
  store double %187, ptr %32, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #3
  %188 = load double, ptr %11, align 8, !tbaa !9
  %189 = load double, ptr %12, align 8, !tbaa !9
  %190 = load double, ptr %30, align 8, !tbaa !9
  %191 = load double, ptr %29, align 8, !tbaa !9
  %192 = call noundef float @_Z29get_distance_to_next_waypointdddd(double noundef %188, double noundef %189, double noundef %190, double noundef %191)
  store float %192, ptr %33, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #3
  %193 = load double, ptr %11, align 8, !tbaa !9
  %194 = load double, ptr %12, align 8, !tbaa !9
  %195 = load double, ptr %32, align 8, !tbaa !9
  %196 = load double, ptr %31, align 8, !tbaa !9
  %197 = call noundef float @_Z29get_distance_to_next_waypointdddd(double noundef %193, double noundef %194, double noundef %195, double noundef %196)
  store float %197, ptr %34, align 4, !tbaa !11
  %198 = load float, ptr %33, align 4, !tbaa !11
  %199 = load float, ptr %34, align 4, !tbaa !11
  %200 = fcmp olt float %198, %199
  br i1 %200, label %201, label %212

201:                                              ; preds = %135
  %202 = load float, ptr %33, align 4, !tbaa !11
  %203 = load ptr, ptr %10, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.crosstrack_error_s, ptr %203, i32 0, i32 1
  store float %202, ptr %204, align 4, !tbaa !18
  %205 = load double, ptr %11, align 8, !tbaa !9
  %206 = load double, ptr %12, align 8, !tbaa !9
  %207 = load double, ptr %30, align 8, !tbaa !9
  %208 = load double, ptr %29, align 8, !tbaa !9
  %209 = call noundef float @_Z28get_bearing_to_next_waypointdddd(double noundef %205, double noundef %206, double noundef %207, double noundef %208)
  %210 = load ptr, ptr %10, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.crosstrack_error_s, ptr %210, i32 0, i32 2
  store float %209, ptr %211, align 4, !tbaa !19
  br label %225

212:                                              ; preds = %135
  %213 = load ptr, ptr %10, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.crosstrack_error_s, ptr %213, i32 0, i32 0
  store i8 1, ptr %214, align 4, !tbaa !15
  %215 = load float, ptr %34, align 4, !tbaa !11
  %216 = load ptr, ptr %10, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.crosstrack_error_s, ptr %216, i32 0, i32 1
  store float %215, ptr %217, align 4, !tbaa !18
  %218 = load double, ptr %11, align 8, !tbaa !9
  %219 = load double, ptr %12, align 8, !tbaa !9
  %220 = load double, ptr %32, align 8, !tbaa !9
  %221 = load double, ptr %31, align 8, !tbaa !9
  %222 = call noundef float @_Z28get_bearing_to_next_waypointdddd(double noundef %218, double noundef %219, double noundef %220, double noundef %221)
  %223 = load ptr, ptr %10, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.crosstrack_error_s, ptr %223, i32 0, i32 2
  store float %222, ptr %224, align 4, !tbaa !19
  br label %225

225:                                              ; preds = %212, %201
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  br label %226

226:                                              ; preds = %225, %134
  %227 = load ptr, ptr %10, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.crosstrack_error_s, ptr %227, i32 0, i32 2
  %229 = load float, ptr %228, align 4, !tbaa !19
  %230 = call noundef float @_ZN6matrix7wrap_piIfEET_S1_(float noundef %229)
  %231 = load ptr, ptr %10, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.crosstrack_error_s, ptr %231, i32 0, i32 2
  store float %230, ptr %232, align 4, !tbaa !19
  store i32 0, ptr %21, align 4, !tbaa !13
  %233 = load i32, ptr %21, align 4, !tbaa !13
  store i32 %233, ptr %9, align 4
  store i32 1, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #3
  br label %234

234:                                              ; preds = %226, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  %235 = load i32, ptr %9, align 4
  ret i32 %235
}

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !17, i64 0}
!16 = !{!"_ZTS18crosstrack_error_s", !17, i64 0, !12, i64 4, !12, i64 8}
!17 = !{!"bool", !7, i64 0}
!18 = !{!16, !12, i64 4}
!19 = !{!16, !12, i64 8}
!20 = !{!17, !17, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}


; 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"

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_Z29get_distance_to_next_waypointdddd(double noundef, double noundef, double noundef, double noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_Z28get_bearing_to_next_waypointdddd(double noundef, double noundef, double noundef, double noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN6matrix7wrap_piIfEET_S1_(float noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -1, 1) i32 @_Z19get_distance_to_arcP18crosstrack_error_sddddfff(ptr nocapture noundef writeonly %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, float noundef %5, float noundef %6, float noundef %7) local_unnamed_addr #1 {
  %9 = tail call noundef float @_Z28get_bearing_to_next_waypointdddd(double noundef %1, double noundef %2, double noundef %3, double noundef %4)
  store i8 0, ptr %0, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 4
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  store <2 x float> zeroinitializer, ptr %10, align 4, !tbaa !11
  %12 = fcmp olt float %5, 0x3FB99999A0000000
  br i1 %12, label %78, label %13

13:                                               ; preds = %8
  %14 = fcmp ult float %7, 0.000000e+00
  br i1 %14, label %20, label %15

15:                                               ; preds = %13
  %16 = fadd float %6, %7
  %17 = fcmp ogt float %16, 0x401921FB60000000
  br i1 %17, label %18, label %25

18:                                               ; preds = %15
  %19 = fadd float %16, 0xC01921FB60000000
  br label %25

20:                                               ; preds = %13
  %21 = fsub float %6, %7
  %22 = fcmp olt float %21, 0.000000e+00
  br i1 %22, label %23, label %25

23:                                               ; preds = %20
  %24 = fadd float %21, 0x401921FB60000000
  br label %25

25:                                               ; preds = %20, %23, %15, %18
  %.099 = phi float [ %19, %18 ], [ %16, %15 ], [ %6, %23 ], [ %6, %20 ]
  %.098 = phi float [ %6, %18 ], [ %6, %15 ], [ %24, %23 ], [ %21, %20 ]
  %26 = fcmp oge float %.099, %.098
  %27 = fcmp oge float %9, %.098
  %or.cond.not120 = and i1 %26, %27
  %28 = fcmp ole float %9, %.099
  %or.cond116.not = and i1 %28, %or.cond.not120
  %29 = fcmp olt float %.099, %.098
  %30 = fcmp ogt float %9, %.098
  %31 = fcmp olt float %9, %.099
  %or.cond117 = or i1 %31, %30
  %32 = and i1 %29, %or.cond117
  %narrow = or i1 %32, %or.cond116.not
  br i1 %narrow, label %33, label %41

33:                                               ; preds = %25
  %34 = tail call noundef float @_Z29get_distance_to_next_waypointdddd(double noundef %1, double noundef %2, double noundef %3, double noundef %4)
  %35 = fcmp ugt float %34, %5
  br i1 %35, label %39, label %36

36:                                               ; preds = %33
  %37 = fsub float %5, %34
  store float %37, ptr %10, align 4, !tbaa !12
  %38 = fadd float %9, 0x400921FB60000000
  br label %76

39:                                               ; preds = %33
  %40 = fsub float %34, %5
  store float %40, ptr %10, align 4, !tbaa !12
  br label %76

41:                                               ; preds = %25
  %42 = fpext float %5 to double
  %43 = fpext float %6 to double
  %44 = tail call double @sin(double noundef %43) #2
  %45 = fmul double %44, %42
  %46 = tail call double @cos(double noundef %43) #2
  %47 = fmul double %46, %42
  %48 = fadd float %6, %7
  %49 = tail call noundef float @_ZN6matrix7wrap_piIfEET_S1_(float noundef %48)
  %50 = fpext float %49 to double
  %51 = tail call double @sin(double noundef %50) #2
  %52 = fmul double %51, %42
  %53 = tail call noundef float @_ZN6matrix7wrap_piIfEET_S1_(float noundef %48)
  %54 = fpext float %53 to double
  %55 = tail call double @cos(double noundef %54) #2
  %56 = fmul double %55, %42
  %57 = fdiv double %45, 1.111110e+05
  %58 = fadd double %57, %2
  %59 = tail call double @cos(double noundef %1) #2
  %60 = fmul double %47, %59
  %61 = fdiv double %60, 1.111110e+05
  %62 = fadd double %61, %1
  %63 = fdiv double %52, 1.111110e+05
  %64 = fadd double %63, %2
  %65 = tail call double @cos(double noundef %1) #2
  %66 = fmul double %56, %65
  %67 = fdiv double %66, 1.111110e+05
  %68 = fadd double %67, %1
  %69 = tail call noundef float @_Z29get_distance_to_next_waypointdddd(double noundef %1, double noundef %2, double noundef %62, double noundef %58)
  %70 = tail call noundef float @_Z29get_distance_to_next_waypointdddd(double noundef %1, double noundef %2, double noundef %68, double noundef %64)
  %71 = fcmp olt float %69, %70
  br i1 %71, label %72, label %74

72:                                               ; preds = %41
  store float %69, ptr %10, align 4, !tbaa !12
  %73 = tail call noundef float @_Z28get_bearing_to_next_waypointdddd(double noundef %1, double noundef %2, double noundef %62, double noundef %58)
  br label %76

74:                                               ; preds = %41
  store i8 1, ptr %0, align 4, !tbaa !5
  store float %70, ptr %10, align 4, !tbaa !12
  %75 = tail call noundef float @_Z28get_bearing_to_next_waypointdddd(double noundef %1, double noundef %2, double noundef %68, double noundef %64)
  br label %76

76:                                               ; preds = %72, %74, %36, %39
  %storemerge115 = phi float [ %9, %39 ], [ %38, %36 ], [ %75, %74 ], [ %73, %72 ]
  store float %storemerge115, ptr %11, align 4, !tbaa !13
  %77 = tail call noundef float @_ZN6matrix7wrap_piIfEET_S1_(float noundef %storemerge115)
  store float %77, ptr %11, align 4, !tbaa !13
  br label %78

78:                                               ; preds = %8, %76
  %.0 = phi i32 [ 0, %76 ], [ -1, %8 ]
  ret i32 %.0
}

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTS18crosstrack_error_s", !7, i64 0, !10, i64 4, !10, i64 8}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!10, !10, i64 0}
!12 = !{!6, !10, i64 4}
!13 = !{!6, !10, i64 8}


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