; LLVM IR from Tinker-Twins/3D-LIDAR-Localization :: fast_gicp/thirdparty/nvbio/contrib/htslib (kfunc)

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local double @kf_erfc(double noundef %0) #2 {
  %2 = alloca double, align 8
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %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 i32, align 4
  store double %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  store double 0x406B869EA974C7E9, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  store double 0x406BA6D5C7A28CF5, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  store double 0x405C05131CA58D35, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store double 0x4040F4D8CBB02431, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store double 0x40197EEFF2A86F23, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store double 0x3FE66989BE8EA720, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store double 0x3FA20DED0B57FBDD, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store double 0x407B869EA974C7E9, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store double 0x4088CE9CB298974E, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store double 0x4083EAAB47FA1778, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  store double 0x4072890729BA781A, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  store double 0x4055B1F78433A599, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store double 0x4030106DF11BD48F, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  store double 0x3FFC173673887D1A, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  store double 0x3FB6A09E667F3BCD, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %23 = load double, ptr %3, align 8, !tbaa !5
  %24 = call double @llvm.fabs.f64(double %23)
  %25 = fmul double %24, 0x3FF6A09E667F3BCD
  store double %25, ptr %20, align 8, !tbaa !5
  %26 = load double, ptr %20, align 8, !tbaa !5
  %27 = fcmp ogt double %26, 3.700000e+01
  br i1 %27, label %28, label %33

28:                                               ; preds = %1
  %29 = load double, ptr %3, align 8, !tbaa !5
  %30 = fcmp ogt double %29, 0.000000e+00
  %31 = zext i1 %30 to i64
  %32 = select i1 %30, double 0.000000e+00, double 2.000000e+00
  store double %32, ptr %2, align 8
  store i32 1, ptr %22, align 4
  br label %101

33:                                               ; preds = %1
  %34 = load double, ptr %20, align 8, !tbaa !5
  %35 = load double, ptr %20, align 8, !tbaa !5
  %36 = fmul double %34, %35
  %37 = fmul double %36, -5.000000e-01
  %38 = call double @exp(double noundef %37) #4
  store double %38, ptr %19, align 8, !tbaa !5
  %39 = load double, ptr %20, align 8, !tbaa !5
  %40 = fcmp olt double %39, 0x401C48C6001F0ABF
  br i1 %40, label %41, label %71

41:                                               ; preds = %33
  %42 = load double, ptr %19, align 8, !tbaa !5
  %43 = load double, ptr %20, align 8, !tbaa !5
  %44 = call double @llvm.fmuladd.f64(double 0x3FA20DED0B57FBDD, double %43, double 0x3FE66989BE8EA720)
  %45 = load double, ptr %20, align 8, !tbaa !5
  %46 = call double @llvm.fmuladd.f64(double %44, double %45, double 0x40197EEFF2A86F23)
  %47 = load double, ptr %20, align 8, !tbaa !5
  %48 = call double @llvm.fmuladd.f64(double %46, double %47, double 0x4040F4D8CBB02431)
  %49 = load double, ptr %20, align 8, !tbaa !5
  %50 = call double @llvm.fmuladd.f64(double %48, double %49, double 0x405C05131CA58D35)
  %51 = load double, ptr %20, align 8, !tbaa !5
  %52 = call double @llvm.fmuladd.f64(double %50, double %51, double 0x406BA6D5C7A28CF5)
  %53 = load double, ptr %20, align 8, !tbaa !5
  %54 = call double @llvm.fmuladd.f64(double %52, double %53, double 0x406B869EA974C7E9)
  %55 = fmul double %42, %54
  %56 = load double, ptr %20, align 8, !tbaa !5
  %57 = call double @llvm.fmuladd.f64(double 0x3FB6A09E667F3BCD, double %56, double 0x3FFC173673887D1A)
  %58 = load double, ptr %20, align 8, !tbaa !5
  %59 = call double @llvm.fmuladd.f64(double %57, double %58, double 0x4030106DF11BD48F)
  %60 = load double, ptr %20, align 8, !tbaa !5
  %61 = call double @llvm.fmuladd.f64(double %59, double %60, double 0x4055B1F78433A599)
  %62 = load double, ptr %20, align 8, !tbaa !5
  %63 = call double @llvm.fmuladd.f64(double %61, double %62, double 0x4072890729BA781A)
  %64 = load double, ptr %20, align 8, !tbaa !5
  %65 = call double @llvm.fmuladd.f64(double %63, double %64, double 0x4083EAAB47FA1778)
  %66 = load double, ptr %20, align 8, !tbaa !5
  %67 = call double @llvm.fmuladd.f64(double %65, double %66, double 0x4088CE9CB298974E)
  %68 = load double, ptr %20, align 8, !tbaa !5
  %69 = call double @llvm.fmuladd.f64(double %67, double %68, double 0x407B869EA974C7E9)
  %70 = fdiv double %55, %69
  store double %70, ptr %21, align 8, !tbaa !5
  br label %89

71:                                               ; preds = %33
  %72 = load double, ptr %19, align 8, !tbaa !5
  %73 = fdiv double %72, 0x40040D931FF62707
  %74 = load double, ptr %20, align 8, !tbaa !5
  %75 = load double, ptr %20, align 8, !tbaa !5
  %76 = load double, ptr %20, align 8, !tbaa !5
  %77 = load double, ptr %20, align 8, !tbaa !5
  %78 = load double, ptr %20, align 8, !tbaa !5
  %79 = fadd double %78, 6.500000e-01
  %80 = fdiv double 4.000000e+00, %79
  %81 = fadd double %77, %80
  %82 = fdiv double 3.000000e+00, %81
  %83 = fadd double %76, %82
  %84 = fdiv double 2.000000e+00, %83
  %85 = fadd double %75, %84
  %86 = fdiv double 1.000000e+00, %85
  %87 = fadd double %74, %86
  %88 = fdiv double %73, %87
  store double %88, ptr %21, align 8, !tbaa !5
  br label %89

89:                                               ; preds = %71, %41
  %90 = load double, ptr %3, align 8, !tbaa !5
  %91 = fcmp ogt double %90, 0.000000e+00
  br i1 %91, label %92, label %95

92:                                               ; preds = %89
  %93 = load double, ptr %21, align 8, !tbaa !5
  %94 = fmul double 2.000000e+00, %93
  br label %99

95:                                               ; preds = %89
  %96 = load double, ptr %21, align 8, !tbaa !5
  %97 = fsub double 1.000000e+00, %96
  %98 = fmul double 2.000000e+00, %97
  br label %99

99:                                               ; preds = %95, %92
  %100 = phi double [ %94, %92 ], [ %98, %95 ]
  store double %100, ptr %2, align 8
  store i32 1, ptr %22, align 4
  br label %101

101:                                              ; preds = %99, %28
  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 8, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  %102 = load double, ptr %2, align 8
  ret double %102
}

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

; Function Attrs: nounwind
declare double @exp(double noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { 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 #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 = !{!"double", !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"

; 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) uwtable
define dso_local double @kf_erfc(double noundef %0) local_unnamed_addr #1 {
  %2 = tail call double @llvm.fabs.f64(double %0)
  %3 = fmul double %2, 0x3FF6A09E667F3BCD
  %4 = fcmp ogt double %3, 3.700000e+01
  br i1 %4, label %5, label %8

5:                                                ; preds = %1
  %6 = fcmp ogt double %0, 0.000000e+00
  %7 = select i1 %6, double 0.000000e+00, double 2.000000e+00
  br label %48

8:                                                ; preds = %1
  %9 = fmul double %3, %3
  %10 = fmul double %9, -5.000000e-01
  %11 = tail call double @exp(double noundef %10) #3
  %12 = fcmp olt double %3, 0x401C48C6001F0ABF
  br i1 %12, label %13, label %29

13:                                               ; preds = %8
  %14 = tail call double @llvm.fmuladd.f64(double %3, double 0x3FA20DED0B57FBDD, double 0x3FE66989BE8EA720)
  %15 = tail call double @llvm.fmuladd.f64(double %14, double %3, double 0x40197EEFF2A86F23)
  %16 = tail call double @llvm.fmuladd.f64(double %15, double %3, double 0x4040F4D8CBB02431)
  %17 = tail call double @llvm.fmuladd.f64(double %16, double %3, double 0x405C05131CA58D35)
  %18 = tail call double @llvm.fmuladd.f64(double %17, double %3, double 0x406BA6D5C7A28CF5)
  %19 = tail call double @llvm.fmuladd.f64(double %18, double %3, double 0x406B869EA974C7E9)
  %20 = fmul double %19, %11
  %21 = tail call double @llvm.fmuladd.f64(double %3, double 0x3FB6A09E667F3BCD, double 0x3FFC173673887D1A)
  %22 = tail call double @llvm.fmuladd.f64(double %21, double %3, double 0x4030106DF11BD48F)
  %23 = tail call double @llvm.fmuladd.f64(double %22, double %3, double 0x4055B1F78433A599)
  %24 = tail call double @llvm.fmuladd.f64(double %23, double %3, double 0x4072890729BA781A)
  %25 = tail call double @llvm.fmuladd.f64(double %24, double %3, double 0x4083EAAB47FA1778)
  %26 = tail call double @llvm.fmuladd.f64(double %25, double %3, double 0x4088CE9CB298974E)
  %27 = tail call double @llvm.fmuladd.f64(double %26, double %3, double 0x407B869EA974C7E9)
  %28 = fdiv double %20, %27
  br label %44

29:                                               ; preds = %8
  %30 = fadd double %3, 6.500000e-01
  %31 = fdiv double 4.000000e+00, %30
  %32 = fadd double %3, %31
  %33 = fdiv double 3.000000e+00, %32
  %34 = fadd double %3, %33
  %35 = fdiv double 2.000000e+00, %34
  %36 = fadd double %3, %35
  %37 = insertelement <2 x double> <double poison, double 1.000000e+00>, double %11, i64 0
  %38 = insertelement <2 x double> <double 0x40040D931FF62707, double poison>, double %36, i64 1
  %39 = fdiv <2 x double> %37, %38
  %40 = extractelement <2 x double> %39, i64 1
  %41 = fadd double %3, %40
  %42 = extractelement <2 x double> %39, i64 0
  %43 = fdiv double %42, %41
  br label %44

44:                                               ; preds = %29, %13
  %.0 = phi double [ %28, %13 ], [ %43, %29 ]
  %45 = fcmp ogt double %0, 0.000000e+00
  %46 = fsub double 1.000000e+00, %.0
  %.in = select i1 %45, double %.0, double %46
  %47 = fmul double %.in, 2.000000e+00
  br label %48

48:                                               ; preds = %44, %5
  %.030 = phi double [ %7, %5 ], [ %47, %44 ]
  ret double %.030
}

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nofree nounwind willreturn memory(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 #2 = { 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 #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)"}


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