; LLVM IR from bbenligiray/stag :: src/ED/LineSegment.ll (Z28ComputeAngleBetweenTwoLines2P11LineSegmentS0_PdPi)

; 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.LineSegment = type { double, double, i32, double, double, double, double, i32, i32, i32 }

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

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

; Function Attrs: nounwind
declare double @acos(double noundef) #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_Z28ComputeAngleBetweenTwoLines2P11LineSegmentS0_PdPi(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.LineSegment, ptr %23, i32 0, i32 3
  %25 = load double, ptr %24, align 8, !tbaa !9
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.LineSegment, ptr %26, i32 0, i32 3
  %28 = load double, ptr %27, align 8, !tbaa !9
  %29 = fsub double %25, %28
  store double %29, ptr %9, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.LineSegment, ptr %30, i32 0, i32 4
  %32 = load double, ptr %31, align 8, !tbaa !14
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.LineSegment, ptr %33, i32 0, i32 4
  %35 = load double, ptr %34, align 8, !tbaa !14
  %36 = fsub double %32, %35
  store double %36, ptr %10, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %37 = load double, ptr %9, align 8, !tbaa !13
  %38 = load double, ptr %9, align 8, !tbaa !13
  %39 = load double, ptr %10, align 8, !tbaa !13
  %40 = load double, ptr %10, align 8, !tbaa !13
  %41 = fmul double %39, %40
  %42 = call double @llvm.fmuladd.f64(double %37, double %38, double %41)
  %43 = call double @sqrt(double noundef %42) #4
  store double %43, ptr %11, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %44 = load double, ptr %11, align 8, !tbaa !13
  store double %44, ptr %12, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !15
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.LineSegment, ptr %45, i32 0, i32 3
  %47 = load double, ptr %46, align 8, !tbaa !9
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.LineSegment, ptr %48, i32 0, i32 5
  %50 = load double, ptr %49, align 8, !tbaa !16
  %51 = fsub double %47, %50
  store double %51, ptr %9, align 8, !tbaa !13
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.LineSegment, ptr %52, i32 0, i32 4
  %54 = load double, ptr %53, align 8, !tbaa !14
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.LineSegment, ptr %55, i32 0, i32 6
  %57 = load double, ptr %56, align 8, !tbaa !17
  %58 = fsub double %54, %57
  store double %58, ptr %10, align 8, !tbaa !13
  %59 = load double, ptr %9, align 8, !tbaa !13
  %60 = load double, ptr %9, align 8, !tbaa !13
  %61 = load double, ptr %10, align 8, !tbaa !13
  %62 = load double, ptr %10, align 8, !tbaa !13
  %63 = fmul double %61, %62
  %64 = call double @llvm.fmuladd.f64(double %59, double %60, double %63)
  %65 = call double @sqrt(double noundef %64) #4
  store double %65, ptr %11, align 8, !tbaa !13
  %66 = load double, ptr %11, align 8, !tbaa !13
  %67 = load double, ptr %12, align 8, !tbaa !13
  %68 = fcmp olt double %66, %67
  br i1 %68, label %69, label %71

69:                                               ; preds = %4
  %70 = load double, ptr %11, align 8, !tbaa !13
  store double %70, ptr %12, align 8, !tbaa !13
  store i32 1, ptr %13, align 4, !tbaa !15
  br label %71

71:                                               ; preds = %69, %4
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.LineSegment, ptr %72, i32 0, i32 5
  %74 = load double, ptr %73, align 8, !tbaa !16
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.LineSegment, ptr %75, i32 0, i32 3
  %77 = load double, ptr %76, align 8, !tbaa !9
  %78 = fsub double %74, %77
  store double %78, ptr %9, align 8, !tbaa !13
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.LineSegment, ptr %79, i32 0, i32 6
  %81 = load double, ptr %80, align 8, !tbaa !17
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.LineSegment, ptr %82, i32 0, i32 4
  %84 = load double, ptr %83, align 8, !tbaa !14
  %85 = fsub double %81, %84
  store double %85, ptr %10, align 8, !tbaa !13
  %86 = load double, ptr %9, align 8, !tbaa !13
  %87 = load double, ptr %9, align 8, !tbaa !13
  %88 = load double, ptr %10, align 8, !tbaa !13
  %89 = load double, ptr %10, align 8, !tbaa !13
  %90 = fmul double %88, %89
  %91 = call double @llvm.fmuladd.f64(double %86, double %87, double %90)
  %92 = call double @sqrt(double noundef %91) #4
  store double %92, ptr %11, align 8, !tbaa !13
  %93 = load double, ptr %11, align 8, !tbaa !13
  %94 = load double, ptr %12, align 8, !tbaa !13
  %95 = fcmp olt double %93, %94
  br i1 %95, label %96, label %98

96:                                               ; preds = %71
  %97 = load double, ptr %11, align 8, !tbaa !13
  store double %97, ptr %12, align 8, !tbaa !13
  store i32 2, ptr %13, align 4, !tbaa !15
  br label %98

98:                                               ; preds = %96, %71
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.LineSegment, ptr %99, i32 0, i32 5
  %101 = load double, ptr %100, align 8, !tbaa !16
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.LineSegment, ptr %102, i32 0, i32 5
  %104 = load double, ptr %103, align 8, !tbaa !16
  %105 = fsub double %101, %104
  store double %105, ptr %9, align 8, !tbaa !13
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.LineSegment, ptr %106, i32 0, i32 6
  %108 = load double, ptr %107, align 8, !tbaa !17
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.LineSegment, ptr %109, i32 0, i32 6
  %111 = load double, ptr %110, align 8, !tbaa !17
  %112 = fsub double %108, %111
  store double %112, ptr %10, align 8, !tbaa !13
  %113 = load double, ptr %9, align 8, !tbaa !13
  %114 = load double, ptr %9, align 8, !tbaa !13
  %115 = load double, ptr %10, align 8, !tbaa !13
  %116 = load double, ptr %10, align 8, !tbaa !13
  %117 = fmul double %115, %116
  %118 = call double @llvm.fmuladd.f64(double %113, double %114, double %117)
  %119 = call double @sqrt(double noundef %118) #4
  store double %119, ptr %11, align 8, !tbaa !13
  %120 = load double, ptr %11, align 8, !tbaa !13
  %121 = load double, ptr %12, align 8, !tbaa !13
  %122 = fcmp olt double %120, %121
  br i1 %122, label %123, label %125

123:                                              ; preds = %98
  %124 = load double, ptr %11, align 8, !tbaa !13
  store double %124, ptr %12, align 8, !tbaa !13
  store i32 3, ptr %13, align 4, !tbaa !15
  br label %125

125:                                              ; preds = %123, %98
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = icmp ne ptr %126, null
  br i1 %127, label %128, label %131

128:                                              ; preds = %125
  %129 = load double, ptr %12, align 8, !tbaa !13
  %130 = load ptr, ptr %7, align 8, !tbaa !5
  store double %129, ptr %130, align 8, !tbaa !13
  br label %131

131:                                              ; preds = %128, %125
  %132 = load ptr, ptr %8, align 8, !tbaa !5
  %133 = icmp ne ptr %132, null
  br i1 %133, label %134, label %137

134:                                              ; preds = %131
  %135 = load i32, ptr %13, align 4, !tbaa !15
  %136 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 %135, ptr %136, align 4, !tbaa !15
  br label %137

137:                                              ; preds = %134, %131
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %138 = load i32, ptr %13, align 4, !tbaa !15
  switch i32 %138, label %255 [
    i32 0, label %139
    i32 1, label %168
    i32 2, label %197
    i32 3, label %226
  ]

139:                                              ; preds = %137
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.LineSegment, ptr %140, i32 0, i32 5
  %142 = load double, ptr %141, align 8, !tbaa !16
  %143 = load ptr, ptr %5, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.LineSegment, ptr %143, i32 0, i32 3
  %145 = load double, ptr %144, align 8, !tbaa !9
  %146 = fsub double %142, %145
  store double %146, ptr %14, align 8, !tbaa !13
  %147 = load ptr, ptr %5, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.LineSegment, ptr %147, i32 0, i32 6
  %149 = load double, ptr %148, align 8, !tbaa !17
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.LineSegment, ptr %150, i32 0, i32 4
  %152 = load double, ptr %151, align 8, !tbaa !14
  %153 = fsub double %149, %152
  store double %153, ptr %15, align 8, !tbaa !13
  %154 = load ptr, ptr %6, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.LineSegment, ptr %154, i32 0, i32 5
  %156 = load double, ptr %155, align 8, !tbaa !16
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.LineSegment, ptr %157, i32 0, i32 3
  %159 = load double, ptr %158, align 8, !tbaa !9
  %160 = fsub double %156, %159
  store double %160, ptr %16, align 8, !tbaa !13
  %161 = load ptr, ptr %6, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.LineSegment, ptr %161, i32 0, i32 6
  %163 = load double, ptr %162, align 8, !tbaa !17
  %164 = load ptr, ptr %6, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.LineSegment, ptr %164, i32 0, i32 4
  %166 = load double, ptr %165, align 8, !tbaa !14
  %167 = fsub double %163, %166
  store double %167, ptr %17, align 8, !tbaa !13
  br label %255

168:                                              ; preds = %137
  %169 = load ptr, ptr %5, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.LineSegment, ptr %169, i32 0, i32 5
  %171 = load double, ptr %170, align 8, !tbaa !16
  %172 = load ptr, ptr %5, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.LineSegment, ptr %172, i32 0, i32 3
  %174 = load double, ptr %173, align 8, !tbaa !9
  %175 = fsub double %171, %174
  store double %175, ptr %14, align 8, !tbaa !13
  %176 = load ptr, ptr %5, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.LineSegment, ptr %176, i32 0, i32 6
  %178 = load double, ptr %177, align 8, !tbaa !17
  %179 = load ptr, ptr %5, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.LineSegment, ptr %179, i32 0, i32 4
  %181 = load double, ptr %180, align 8, !tbaa !14
  %182 = fsub double %178, %181
  store double %182, ptr %15, align 8, !tbaa !13
  %183 = load ptr, ptr %6, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.LineSegment, ptr %183, i32 0, i32 3
  %185 = load double, ptr %184, align 8, !tbaa !9
  %186 = load ptr, ptr %6, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.LineSegment, ptr %186, i32 0, i32 5
  %188 = load double, ptr %187, align 8, !tbaa !16
  %189 = fsub double %185, %188
  store double %189, ptr %16, align 8, !tbaa !13
  %190 = load ptr, ptr %6, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.LineSegment, ptr %190, i32 0, i32 4
  %192 = load double, ptr %191, align 8, !tbaa !14
  %193 = load ptr, ptr %6, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.LineSegment, ptr %193, i32 0, i32 6
  %195 = load double, ptr %194, align 8, !tbaa !17
  %196 = fsub double %192, %195
  store double %196, ptr %17, align 8, !tbaa !13
  br label %255

197:                                              ; preds = %137
  %198 = load ptr, ptr %5, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.LineSegment, ptr %198, i32 0, i32 3
  %200 = load double, ptr %199, align 8, !tbaa !9
  %201 = load ptr, ptr %5, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.LineSegment, ptr %201, i32 0, i32 5
  %203 = load double, ptr %202, align 8, !tbaa !16
  %204 = fsub double %200, %203
  store double %204, ptr %14, align 8, !tbaa !13
  %205 = load ptr, ptr %5, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.LineSegment, ptr %205, i32 0, i32 4
  %207 = load double, ptr %206, align 8, !tbaa !14
  %208 = load ptr, ptr %5, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.LineSegment, ptr %208, i32 0, i32 6
  %210 = load double, ptr %209, align 8, !tbaa !17
  %211 = fsub double %207, %210
  store double %211, ptr %15, align 8, !tbaa !13
  %212 = load ptr, ptr %6, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.LineSegment, ptr %212, i32 0, i32 5
  %214 = load double, ptr %213, align 8, !tbaa !16
  %215 = load ptr, ptr %6, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.LineSegment, ptr %215, i32 0, i32 3
  %217 = load double, ptr %216, align 8, !tbaa !9
  %218 = fsub double %214, %217
  store double %218, ptr %16, align 8, !tbaa !13
  %219 = load ptr, ptr %6, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.LineSegment, ptr %219, i32 0, i32 6
  %221 = load double, ptr %220, align 8, !tbaa !17
  %222 = load ptr, ptr %6, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.LineSegment, ptr %222, i32 0, i32 4
  %224 = load double, ptr %223, align 8, !tbaa !14
  %225 = fsub double %221, %224
  store double %225, ptr %17, align 8, !tbaa !13
  br label %255

226:                                              ; preds = %137
  %227 = load ptr, ptr %5, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.LineSegment, ptr %227, i32 0, i32 3
  %229 = load double, ptr %228, align 8, !tbaa !9
  %230 = load ptr, ptr %5, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.LineSegment, ptr %230, i32 0, i32 5
  %232 = load double, ptr %231, align 8, !tbaa !16
  %233 = fsub double %229, %232
  store double %233, ptr %14, align 8, !tbaa !13
  %234 = load ptr, ptr %5, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.LineSegment, ptr %234, i32 0, i32 4
  %236 = load double, ptr %235, align 8, !tbaa !14
  %237 = load ptr, ptr %5, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.LineSegment, ptr %237, i32 0, i32 6
  %239 = load double, ptr %238, align 8, !tbaa !17
  %240 = fsub double %236, %239
  store double %240, ptr %15, align 8, !tbaa !13
  %241 = load ptr, ptr %6, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.LineSegment, ptr %241, i32 0, i32 3
  %243 = load double, ptr %242, align 8, !tbaa !9
  %244 = load ptr, ptr %6, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.LineSegment, ptr %244, i32 0, i32 5
  %246 = load double, ptr %245, align 8, !tbaa !16
  %247 = fsub double %243, %246
  store double %247, ptr %16, align 8, !tbaa !13
  %248 = load ptr, ptr %6, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.LineSegment, ptr %248, i32 0, i32 4
  %250 = load double, ptr %249, align 8, !tbaa !14
  %251 = load ptr, ptr %6, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.LineSegment, ptr %251, i32 0, i32 6
  %253 = load double, ptr %252, align 8, !tbaa !17
  %254 = fsub double %250, %253
  store double %254, ptr %17, align 8, !tbaa !13
  br label %255

255:                                              ; preds = %226, %197, %168, %139, %137
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %256 = load double, ptr %14, align 8, !tbaa !13
  %257 = load double, ptr %14, align 8, !tbaa !13
  %258 = load double, ptr %15, align 8, !tbaa !13
  %259 = load double, ptr %15, align 8, !tbaa !13
  %260 = fmul double %258, %259
  %261 = call double @llvm.fmuladd.f64(double %256, double %257, double %260)
  %262 = call double @sqrt(double noundef %261) #4
  store double %262, ptr %18, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %263 = load double, ptr %16, align 8, !tbaa !13
  %264 = load double, ptr %16, align 8, !tbaa !13
  %265 = load double, ptr %17, align 8, !tbaa !13
  %266 = load double, ptr %17, align 8, !tbaa !13
  %267 = fmul double %265, %266
  %268 = call double @llvm.fmuladd.f64(double %263, double %264, double %267)
  %269 = call double @sqrt(double noundef %268) #4
  store double %269, ptr %19, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %270 = load double, ptr %14, align 8, !tbaa !13
  %271 = load double, ptr %16, align 8, !tbaa !13
  %272 = load double, ptr %15, align 8, !tbaa !13
  %273 = load double, ptr %17, align 8, !tbaa !13
  %274 = fmul double %272, %273
  %275 = call double @llvm.fmuladd.f64(double %270, double %271, double %274)
  store double %275, ptr %20, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %276 = load double, ptr %20, align 8, !tbaa !13
  %277 = load double, ptr %18, align 8, !tbaa !13
  %278 = load double, ptr %19, align 8, !tbaa !13
  %279 = fmul double %277, %278
  %280 = fdiv double %276, %279
  store double %280, ptr %21, align 8, !tbaa !13
  %281 = load double, ptr %21, align 8, !tbaa !13
  %282 = fcmp olt double %281, -1.000000e+00
  br i1 %282, label %283, label %284

283:                                              ; preds = %255
  store double -1.000000e+00, ptr %21, align 8, !tbaa !13
  br label %289

284:                                              ; preds = %255
  %285 = load double, ptr %21, align 8, !tbaa !13
  %286 = fcmp ogt double %285, 1.000000e+00
  br i1 %286, label %287, label %288

287:                                              ; preds = %284
  store double 1.000000e+00, ptr %21, align 8, !tbaa !13
  br label %288

288:                                              ; preds = %287, %284
  br label %289

289:                                              ; preds = %288, %283
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %290 = load double, ptr %21, align 8, !tbaa !13
  %291 = call double @acos(double noundef %290) #4
  store double %291, ptr %22, align 8, !tbaa !13
  %292 = load double, ptr %22, align 8, !tbaa !13
  %293 = fdiv double %292, 3.141590e+00
  %294 = fmul double %293, 1.800000e+02
  store double %294, ptr %22, align 8, !tbaa !13
  %295 = load double, ptr %22, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  ret double %295
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #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, !11, i64 24}
!10 = !{!"_ZTS11LineSegment", !11, i64 0, !11, i64 8, !12, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !12, i64 56, !12, i64 60, !12, i64 64}
!11 = !{!"double", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !11, i64 32}
!15 = !{!12, !12, i64 0}
!16 = !{!10, !11, i64 40}
!17 = !{!10, !11, i64 48}


; 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 nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #0

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(readwrite, inaccessiblemem: write) uwtable
define dso_local noundef double @_Z28ComputeAngleBetweenTwoLines2P11LineSegmentS0_PdPi(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr noundef writeonly %2, ptr noundef writeonly %3) local_unnamed_addr #2 {
  %5 = getelementptr inbounds i8, ptr %0, i64 24
  %6 = load double, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %1, i64 24
  %8 = load double, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 32
  %10 = load double, ptr %9, align 8, !tbaa !11
  %11 = getelementptr inbounds i8, ptr %1, i64 32
  %12 = load double, ptr %11, align 8, !tbaa !11
  %13 = getelementptr inbounds i8, ptr %1, i64 40
  %14 = load double, ptr %13, align 8, !tbaa !12
  %15 = getelementptr inbounds i8, ptr %1, i64 48
  %16 = load double, ptr %15, align 8, !tbaa !13
  %17 = insertelement <2 x double> poison, double %6, i64 0
  %18 = shufflevector <2 x double> %17, <2 x double> poison, <2 x i32> zeroinitializer
  %19 = insertelement <2 x double> poison, double %14, i64 0
  %20 = insertelement <2 x double> %19, double %8, i64 1
  %21 = fsub <2 x double> %18, %20
  %22 = insertelement <2 x double> poison, double %10, i64 0
  %23 = shufflevector <2 x double> %22, <2 x double> poison, <2 x i32> zeroinitializer
  %24 = insertelement <2 x double> poison, double %16, i64 0
  %25 = insertelement <2 x double> %24, double %12, i64 1
  %26 = fsub <2 x double> %23, %25
  %27 = fmul <2 x double> %26, %26
  %28 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %21, <2 x double> %21, <2 x double> %27)
  %29 = tail call <2 x double> @llvm.sqrt.v2f64(<2 x double> %28)
  %30 = extractelement <2 x double> %29, i64 0
  %31 = extractelement <2 x double> %29, i64 1
  %32 = fcmp olt double %30, %31
  %.0105 = zext i1 %32 to i32
  %.0100 = select i1 %32, double %30, double %31
  %33 = getelementptr inbounds i8, ptr %0, i64 40
  %34 = load double, ptr %33, align 8, !tbaa !12
  %35 = fsub double %34, %8
  %36 = getelementptr inbounds i8, ptr %0, i64 48
  %37 = load double, ptr %36, align 8, !tbaa !13
  %38 = fsub double %37, %12
  %39 = fmul double %38, %38
  %40 = tail call double @llvm.fmuladd.f64(double %35, double %35, double %39)
  %sqrt116 = tail call double @llvm.sqrt.f64(double %40)
  %41 = fcmp olt double %sqrt116, %.0100
  %.1106 = select i1 %41, i32 2, i32 %.0105
  %.1 = select i1 %41, double %sqrt116, double %.0100
  %42 = fsub double %34, %14
  %43 = fsub double %37, %16
  %44 = fmul double %43, %43
  %45 = tail call double @llvm.fmuladd.f64(double %42, double %42, double %44)
  %sqrt = tail call double @llvm.sqrt.f64(double %45)
  %46 = fcmp olt double %sqrt, %.1
  %.2107 = select i1 %46, i32 3, i32 %.1106
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %48, label %47

47:                                               ; preds = %4
  %.2 = select i1 %46, double %sqrt, double %.1
  store double %.2, ptr %2, align 8, !tbaa !14
  br label %48

48:                                               ; preds = %47, %4
  %.not115 = icmp eq ptr %3, null
  br i1 %.not115, label %50, label %49

49:                                               ; preds = %48
  store i32 %.2107, ptr %3, align 4, !tbaa !15
  br label %50

50:                                               ; preds = %49, %48
  switch i32 %.2107, label %default.unreachable121 [
    i32 0, label %54
    i32 1, label %51
    i32 2, label %52
    i32 3, label %53
  ]

51:                                               ; preds = %50
  br label %54

52:                                               ; preds = %50
  br label %54

53:                                               ; preds = %50
  br label %54

default.unreachable121:                           ; preds = %50
  unreachable

54:                                               ; preds = %50, %53, %52, %51
  %.sink133 = phi ptr [ %5, %53 ], [ %5, %52 ], [ %33, %51 ], [ %33, %50 ]
  %.sink132 = phi ptr [ %33, %53 ], [ %33, %52 ], [ %5, %51 ], [ %5, %50 ]
  %.sink130 = phi ptr [ %9, %53 ], [ %9, %52 ], [ %36, %51 ], [ %36, %50 ]
  %.sink129 = phi ptr [ %36, %53 ], [ %36, %52 ], [ %9, %51 ], [ %9, %50 ]
  %.sink127 = phi ptr [ %7, %53 ], [ %13, %52 ], [ %7, %51 ], [ %13, %50 ]
  %.sink126 = phi ptr [ %13, %53 ], [ %7, %52 ], [ %13, %51 ], [ %7, %50 ]
  %.sink124 = phi ptr [ %11, %53 ], [ %15, %52 ], [ %11, %51 ], [ %15, %50 ]
  %.sink123 = phi ptr [ %15, %53 ], [ %11, %52 ], [ %15, %51 ], [ %11, %50 ]
  %55 = load double, ptr %.sink133, align 8, !tbaa !14
  %56 = load double, ptr %.sink132, align 8, !tbaa !14
  %57 = load double, ptr %.sink130, align 8, !tbaa !14
  %58 = load double, ptr %.sink129, align 8, !tbaa !14
  %59 = load double, ptr %.sink127, align 8, !tbaa !14
  %60 = load double, ptr %.sink126, align 8, !tbaa !14
  %61 = load double, ptr %.sink124, align 8, !tbaa !14
  %62 = load double, ptr %.sink123, align 8, !tbaa !14
  %63 = insertelement <2 x double> poison, double %55, i64 0
  %64 = insertelement <2 x double> %63, double %59, i64 1
  %65 = insertelement <2 x double> poison, double %56, i64 0
  %66 = insertelement <2 x double> %65, double %60, i64 1
  %67 = fsub <2 x double> %64, %66
  %68 = insertelement <2 x double> poison, double %57, i64 0
  %69 = insertelement <2 x double> %68, double %61, i64 1
  %70 = insertelement <2 x double> poison, double %58, i64 0
  %71 = insertelement <2 x double> %70, double %62, i64 1
  %72 = fsub <2 x double> %69, %71
  %73 = fmul <2 x double> %72, %72
  %74 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %67, <2 x double> %67, <2 x double> %73)
  %75 = tail call <2 x double> @llvm.sqrt.v2f64(<2 x double> %74)
  %shift = shufflevector <2 x double> %72, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %76 = fmul <2 x double> %72, %shift
  %77 = extractelement <2 x double> %76, i64 0
  %78 = extractelement <2 x double> %67, i64 0
  %79 = extractelement <2 x double> %67, i64 1
  %80 = tail call double @llvm.fmuladd.f64(double %78, double %79, double %77)
  %shift134 = shufflevector <2 x double> %75, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %81 = fmul <2 x double> %75, %shift134
  %82 = extractelement <2 x double> %81, i64 0
  %83 = fdiv double %80, %82
  %84 = fcmp olt double %83, -1.000000e+00
  br i1 %84, label %88, label %85

85:                                               ; preds = %54
  %86 = fcmp ogt double %83, 1.000000e+00
  br i1 %86, label %87, label %88

87:                                               ; preds = %85
  br label %88

88:                                               ; preds = %54, %85, %87
  %.0 = phi double [ 1.000000e+00, %87 ], [ %83, %85 ], [ -1.000000e+00, %54 ]
  %89 = tail call double @acos(double noundef %.0) #4
  %90 = fdiv double %89, 3.141590e+00
  %91 = fmul double %90, 1.800000e+02
  ret double %91
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.sqrt.v2f64(<2 x double>) #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 #2 = { mustprogress nofree nounwind willreturn memory(readwrite, inaccessiblemem: write) 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !7, i64 24}
!6 = !{!"_ZTS11LineSegment", !7, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !10, i64 56, !10, i64 60, !10, i64 64}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 32}
!12 = !{!6, !7, i64 40}
!13 = !{!6, !7, i64 48}
!14 = !{!7, !7, i64 0}
!15 = !{!10, !10, i64 0}


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass