; LLVM IR from AllAlgorithms/c :: algorithms/math/quadratic-eq (quadratic-eq-solver)

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

@.str = external hidden unnamed_addr constant [32 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca float, align 4
  %3 = alloca float, align 4
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store float 0.000000e+00, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store float 0.000000e+00, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store float 0.000000e+00, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store float 0.000000e+00, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store float 0.000000e+00, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store float 0.000000e+00, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store float 0.000000e+00, ptr %8, align 4, !tbaa !5
  %9 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %2)
  %11 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %3)
  %13 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %4)
  %15 = load float, ptr %3, align 4, !tbaa !5
  %16 = load float, ptr %3, align 4, !tbaa !5
  %17 = load float, ptr %2, align 4, !tbaa !5
  %18 = fmul float 4.000000e+00, %17
  %19 = load float, ptr %4, align 4, !tbaa !5
  %20 = fmul float %18, %19
  %21 = fneg float %20
  %22 = call float @llvm.fmuladd.f32(float %15, float %16, float %21)
  store float %22, ptr %5, align 4, !tbaa !5
  %23 = load float, ptr %5, align 4, !tbaa !5
  %24 = fcmp oeq float %23, 0.000000e+00
  br i1 %24, label %25, label %37

25:                                               ; preds = %0
  %26 = load float, ptr %3, align 4, !tbaa !5
  %27 = fneg float %26
  %28 = load float, ptr %2, align 4, !tbaa !5
  %29 = fmul float 2.000000e+00, %28
  %30 = fdiv float %27, %29
  store float %30, ptr %6, align 4, !tbaa !5
  %31 = load float, ptr %6, align 4, !tbaa !5
  store float %31, ptr %7, align 4, !tbaa !5
  %32 = load float, ptr %6, align 4, !tbaa !5
  %33 = fpext float %32 to double
  %34 = load float, ptr %7, align 4, !tbaa !5
  %35 = fpext float %34 to double
  %36 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, double noundef %33, double noundef %35)
  br label %95

37:                                               ; preds = %0
  %38 = load float, ptr %5, align 4, !tbaa !5
  %39 = fcmp ogt float %38, 0.000000e+00
  br i1 %39, label %40, label %70

40:                                               ; preds = %37
  %41 = load float, ptr %3, align 4, !tbaa !5
  %42 = fneg float %41
  %43 = fpext float %42 to double
  %44 = load float, ptr %5, align 4, !tbaa !5
  %45 = fpext float %44 to double
  %46 = call double @sqrt(double noundef %45) #5
  %47 = fadd double %43, %46
  %48 = load float, ptr %2, align 4, !tbaa !5
  %49 = fmul float 2.000000e+00, %48
  %50 = fpext float %49 to double
  %51 = fdiv double %47, %50
  %52 = fptrunc double %51 to float
  store float %52, ptr %6, align 4, !tbaa !5
  %53 = load float, ptr %3, align 4, !tbaa !5
  %54 = fneg float %53
  %55 = fpext float %54 to double
  %56 = load float, ptr %5, align 4, !tbaa !5
  %57 = fpext float %56 to double
  %58 = call double @sqrt(double noundef %57) #5
  %59 = fsub double %55, %58
  %60 = load float, ptr %2, align 4, !tbaa !5
  %61 = fmul float 2.000000e+00, %60
  %62 = fpext float %61 to double
  %63 = fdiv double %59, %62
  %64 = fptrunc double %63 to float
  store float %64, ptr %7, align 4, !tbaa !5
  %65 = load float, ptr %6, align 4, !tbaa !5
  %66 = fpext float %65 to double
  %67 = load float, ptr %7, align 4, !tbaa !5
  %68 = fpext float %67 to double
  %69 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, double noundef %66, double noundef %68)
  br label %94

70:                                               ; preds = %37
  %71 = load float, ptr %3, align 4, !tbaa !5
  %72 = fneg float %71
  %73 = load float, ptr %2, align 4, !tbaa !5
  %74 = fmul float 2.000000e+00, %73
  %75 = fdiv float %72, %74
  store float %75, ptr %6, align 4, !tbaa !5
  %76 = load float, ptr %6, align 4, !tbaa !5
  store float %76, ptr %7, align 4, !tbaa !5
  %77 = load float, ptr %5, align 4, !tbaa !5
  %78 = fneg float %77
  %79 = fpext float %78 to double
  %80 = call double @sqrt(double noundef %79) #5
  %81 = load float, ptr %2, align 4, !tbaa !5
  %82 = fmul float 2.000000e+00, %81
  %83 = fpext float %82 to double
  %84 = fdiv double %80, %83
  %85 = fptrunc double %84 to float
  store float %85, ptr %8, align 4, !tbaa !5
  %86 = load float, ptr %6, align 4, !tbaa !5
  %87 = fpext float %86 to double
  %88 = load float, ptr %7, align 4, !tbaa !5
  %89 = fpext float %88 to double
  %90 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, double noundef %87, double noundef %89)
  %91 = load float, ptr %8, align 4, !tbaa !5
  %92 = fpext float %91 to double
  %93 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, double noundef %92)
  br label %94

94:                                               ; preds = %70, %40
  br label %95

95:                                               ; preds = %94, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  ret i32 0
}

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

declare i32 @printf(ptr noundef, ...) #2

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #3

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


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

@.str = external hidden unnamed_addr constant [32 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca float, align 4
  %2 = alloca float, align 4
  %3 = alloca float, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  store float 0.000000e+00, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  store float 0.000000e+00, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  store float 0.000000e+00, ptr %3, align 4, !tbaa !5
  %4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1)
  %6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2)
  %8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %3)
  %10 = load float, ptr %2, align 4, !tbaa !5
  %11 = load float, ptr %1, align 4, !tbaa !5
  %12 = load float, ptr %3, align 4, !tbaa !5
  %13 = fmul float %11, -4.000000e+00
  %14 = fmul float %13, %12
  %15 = call float @llvm.fmuladd.f32(float %10, float %10, float %14)
  %16 = fcmp oeq float %15, 0.000000e+00
  br i1 %16, label %17, label %23

17:                                               ; preds = %0
  %18 = fneg float %10
  %19 = fmul float %11, 2.000000e+00
  %20 = fdiv float %18, %19
  %21 = fpext float %20 to double
  %22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, double noundef %21, double noundef %21)
  br label %64

23:                                               ; preds = %0
  %24 = fcmp ogt float %15, 0.000000e+00
  %25 = fneg float %10
  br i1 %24, label %26, label %49

26:                                               ; preds = %23
  %27 = fpext float %25 to double
  %28 = fpext float %15 to double
  %29 = call double @sqrt(double noundef %28) #5
  %30 = fadd double %29, %27
  %31 = load float, ptr %1, align 4, !tbaa !5
  %32 = fmul float %31, 2.000000e+00
  %33 = fpext float %32 to double
  %34 = fdiv double %30, %33
  %35 = fptrunc double %34 to float
  %36 = load float, ptr %2, align 4, !tbaa !5
  %37 = fneg float %36
  %38 = fpext float %37 to double
  %39 = call double @sqrt(double noundef %28) #5
  %40 = fsub double %38, %39
  %41 = load float, ptr %1, align 4, !tbaa !5
  %42 = fmul float %41, 2.000000e+00
  %43 = fpext float %42 to double
  %44 = fdiv double %40, %43
  %45 = fptrunc double %44 to float
  %46 = fpext float %35 to double
  %47 = fpext float %45 to double
  %48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, double noundef %46, double noundef %47)
  br label %64

49:                                               ; preds = %23
  %50 = fmul float %11, 2.000000e+00
  %51 = fdiv float %25, %50
  %52 = fneg float %15
  %53 = fpext float %52 to double
  %54 = call double @sqrt(double noundef %53) #5
  %55 = load float, ptr %1, align 4, !tbaa !5
  %56 = fmul float %55, 2.000000e+00
  %57 = fpext float %56 to double
  %58 = fdiv double %54, %57
  %59 = fptrunc double %58 to float
  %60 = fpext float %51 to double
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, double noundef %60, double noundef %60)
  %62 = fpext float %59 to double
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, double noundef %62)
  br label %64

64:                                               ; preds = %26, %49, %17
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #3

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

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

attributes #0 = { nofree 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree 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 #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #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, !6, i64 0}
!6 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


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