; LLVM IR from QiaoLiuHit/LSOTB-TIR :: vlfeat-0.9.19/vl (svm)

; 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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
define dso_local double @vl_svm_logistic_dca_update(double noundef %0, double noundef %1, double noundef %2, double noundef %3) #1 {
  %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 i64, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  store double %0, ptr %5, align 8, !tbaa !5
  store double %1, ptr %6, align 8, !tbaa !5
  store double %2, ptr %7, align 8, !tbaa !5
  store double %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  store double 0.000000e+00, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  store double 1.000000e+00, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store double 5.000000e-01, ptr %16, align 8, !tbaa !5
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %17

17:                                               ; preds = %50, %4
  %18 = load i64, ptr %13, align 8, !tbaa !9
  %19 = icmp slt i64 %18, 5
  br i1 %19, label %20, label %53

20:                                               ; preds = %17
  %21 = load double, ptr %16, align 8, !tbaa !5
  %22 = call double @log(double noundef %21) #4
  %23 = load double, ptr %16, align 8, !tbaa !5
  %24 = fsub double 1.000000e+00, %23
  %25 = call double @log(double noundef %24) #4
  %26 = fsub double %22, %25
  store double %26, ptr %9, align 8, !tbaa !5
  %27 = load double, ptr %7, align 8, !tbaa !5
  %28 = load double, ptr %16, align 8, !tbaa !5
  %29 = load double, ptr %8, align 8, !tbaa !5
  %30 = load double, ptr %6, align 8, !tbaa !5
  %31 = load double, ptr %7, align 8, !tbaa !5
  %32 = load double, ptr %5, align 8, !tbaa !5
  %33 = fneg double %31
  %34 = call double @llvm.fmuladd.f64(double %33, double %32, double %30)
  %35 = fmul double %29, %34
  %36 = call double @llvm.fmuladd.f64(double %27, double %28, double %35)
  %37 = load double, ptr %9, align 8, !tbaa !5
  %38 = fadd double %36, %37
  store double %38, ptr %11, align 8, !tbaa !5
  %39 = load double, ptr %11, align 8, !tbaa !5
  %40 = fcmp oge double %39, 0.000000e+00
  br i1 %40, label %41, label %43

41:                                               ; preds = %20
  %42 = load double, ptr %16, align 8, !tbaa !5
  store double %42, ptr %15, align 8, !tbaa !5
  br label %45

43:                                               ; preds = %20
  %44 = load double, ptr %16, align 8, !tbaa !5
  store double %44, ptr %14, align 8, !tbaa !5
  br label %45

45:                                               ; preds = %43, %41
  %46 = load double, ptr %14, align 8, !tbaa !5
  %47 = load double, ptr %15, align 8, !tbaa !5
  %48 = fadd double %46, %47
  %49 = fmul double 5.000000e-01, %48
  store double %49, ptr %16, align 8, !tbaa !5
  br label %50

50:                                               ; preds = %45
  %51 = load i64, ptr %13, align 8, !tbaa !9
  %52 = add nsw i64 %51, 1
  store i64 %52, ptr %13, align 8, !tbaa !9
  br label %17, !llvm.loop !11

53:                                               ; preds = %17
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %54

54:                                               ; preds = %118, %53
  %55 = load i64, ptr %13, align 8, !tbaa !9
  %56 = icmp slt i64 %55, 2
  %57 = zext i1 %56 to i32
  %58 = load double, ptr %16, align 8, !tbaa !5
  %59 = fcmp ogt double %58, 0x3CB0000000000000
  %60 = zext i1 %59 to i32
  %61 = and i32 %57, %60
  %62 = load double, ptr %16, align 8, !tbaa !5
  %63 = fcmp olt double %62, 0x3FEFFFFFFFFFFFFE
  %64 = zext i1 %63 to i32
  %65 = and i32 %61, %64
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %121

67:                                               ; preds = %54
  %68 = load double, ptr %16, align 8, !tbaa !5
  %69 = call double @log(double noundef %68) #4
  %70 = load double, ptr %16, align 8, !tbaa !5
  %71 = fsub double 1.000000e+00, %70
  %72 = call double @log(double noundef %71) #4
  %73 = fsub double %69, %72
  store double %73, ptr %9, align 8, !tbaa !5
  %74 = load double, ptr %16, align 8, !tbaa !5
  %75 = load double, ptr %16, align 8, !tbaa !5
  %76 = fsub double 1.000000e+00, %75
  %77 = fmul double %74, %76
  %78 = fdiv double 1.000000e+00, %77
  store double %78, ptr %10, align 8, !tbaa !5
  %79 = load double, ptr %7, align 8, !tbaa !5
  %80 = load double, ptr %16, align 8, !tbaa !5
  %81 = load double, ptr %8, align 8, !tbaa !5
  %82 = load double, ptr %6, align 8, !tbaa !5
  %83 = load double, ptr %7, align 8, !tbaa !5
  %84 = load double, ptr %5, align 8, !tbaa !5
  %85 = fneg double %83
  %86 = call double @llvm.fmuladd.f64(double %85, double %84, double %82)
  %87 = fmul double %81, %86
  %88 = call double @llvm.fmuladd.f64(double %79, double %80, double %87)
  %89 = load double, ptr %9, align 8, !tbaa !5
  %90 = fadd double %88, %89
  store double %90, ptr %11, align 8, !tbaa !5
  %91 = load double, ptr %7, align 8, !tbaa !5
  %92 = load double, ptr %10, align 8, !tbaa !5
  %93 = fadd double %91, %92
  store double %93, ptr %12, align 8, !tbaa !5
  %94 = load double, ptr %11, align 8, !tbaa !5
  %95 = load double, ptr %12, align 8, !tbaa !5
  %96 = fdiv double %94, %95
  %97 = load double, ptr %16, align 8, !tbaa !5
  %98 = fsub double %97, %96
  store double %98, ptr %16, align 8, !tbaa !5
  %99 = load double, ptr %16, align 8, !tbaa !5
  %100 = fcmp olt double 1.000000e+00, %99
  br i1 %100, label %101, label %102

101:                                              ; preds = %67
  br label %104

102:                                              ; preds = %67
  %103 = load double, ptr %16, align 8, !tbaa !5
  br label %104

104:                                              ; preds = %102, %101
  %105 = phi double [ 1.000000e+00, %101 ], [ %103, %102 ]
  %106 = fcmp ogt double 0.000000e+00, %105
  br i1 %106, label %107, label %108

107:                                              ; preds = %104
  br label %116

108:                                              ; preds = %104
  %109 = load double, ptr %16, align 8, !tbaa !5
  %110 = fcmp olt double 1.000000e+00, %109
  br i1 %110, label %111, label %112

111:                                              ; preds = %108
  br label %114

112:                                              ; preds = %108
  %113 = load double, ptr %16, align 8, !tbaa !5
  br label %114

114:                                              ; preds = %112, %111
  %115 = phi double [ 1.000000e+00, %111 ], [ %113, %112 ]
  br label %116

116:                                              ; preds = %114, %107
  %117 = phi double [ 0.000000e+00, %107 ], [ %115, %114 ]
  store double %117, ptr %16, align 8, !tbaa !5
  br label %118

118:                                              ; preds = %116
  %119 = load i64, ptr %13, align 8, !tbaa !9
  %120 = add nsw i64 %119, 1
  store i64 %120, ptr %13, align 8, !tbaa !9
  br label %54, !llvm.loop !13

121:                                              ; preds = %54
  %122 = load double, ptr %8, align 8, !tbaa !5
  %123 = load double, ptr %16, align 8, !tbaa !5
  %124 = load double, ptr %5, align 8, !tbaa !5
  %125 = fneg double %124
  %126 = call double @llvm.fmuladd.f64(double %122, double %123, double %125)
  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
  ret double %126
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; 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: nofree nounwind memory(write) uwtable
define dso_local double @vl_svm_logistic_dca_update(double noundef %0, double noundef %1, double noundef %2, double noundef %3) local_unnamed_addr #0 {
.preheader:
  %4 = fneg double %2
  %5 = tail call double @llvm.fmuladd.f64(double %4, double %0, double %1)
  %6 = fmul double %5, %3
  %7 = tail call double @llvm.fmuladd.f64(double %2, double 5.000000e-01, double %6)
  %8 = fcmp ult double %7, 0.000000e+00
  %.0..044 = select i1 %8, double 5.000000e-01, double 0.000000e+00
  %.042..0 = select i1 %8, double 1.000000e+00, double 5.000000e-01
  %9 = select i1 %8, double 7.500000e-01, double 2.500000e-01
  %10 = tail call double @log(double noundef %9) #3
  %11 = fsub double 1.000000e+00, %9
  %12 = tail call double @log(double noundef %11) #3
  %13 = fsub double %10, %12
  %14 = tail call double @llvm.fmuladd.f64(double %2, double %9, double %6)
  %15 = fadd double %14, %13
  %16 = fcmp ult double %15, 0.000000e+00
  %.0..044.1 = select i1 %16, double %9, double %.0..044
  %.042..0.1 = select i1 %16, double %.042..0, double %9
  %17 = fadd double %.0..044.1, %.042..0.1
  %18 = fmul double %17, 5.000000e-01
  %19 = tail call double @log(double noundef %18) #3
  %20 = fsub double 1.000000e+00, %18
  %21 = tail call double @log(double noundef %20) #3
  %22 = fsub double %19, %21
  %23 = tail call double @llvm.fmuladd.f64(double %2, double %18, double %6)
  %24 = fadd double %23, %22
  %25 = fcmp ult double %24, 0.000000e+00
  %.0..044.2 = select i1 %25, double %18, double %.0..044.1
  %.042..0.2 = select i1 %25, double %.042..0.1, double %18
  %26 = fadd double %.0..044.2, %.042..0.2
  %27 = fmul double %26, 5.000000e-01
  %28 = tail call double @log(double noundef %27) #3
  %29 = fsub double 1.000000e+00, %27
  %30 = tail call double @log(double noundef %29) #3
  %31 = fsub double %28, %30
  %32 = tail call double @llvm.fmuladd.f64(double %2, double %27, double %6)
  %33 = fadd double %32, %31
  %34 = fcmp ult double %33, 0.000000e+00
  %.0..044.3 = select i1 %34, double %27, double %.0..044.2
  %.042..0.3 = select i1 %34, double %.042..0.2, double %27
  %35 = fadd double %.0..044.3, %.042..0.3
  %36 = fmul double %35, 5.000000e-01
  %37 = tail call double @log(double noundef %36) #3
  %38 = fsub double 1.000000e+00, %36
  %39 = tail call double @log(double noundef %38) #3
  %40 = fsub double %37, %39
  %41 = tail call double @llvm.fmuladd.f64(double %2, double %36, double %6)
  %42 = fadd double %41, %40
  %43 = fcmp ult double %42, 0.000000e+00
  %.0..044.4 = select i1 %43, double %36, double %.0..044.3
  %.042..0.4 = select i1 %43, double %.042..0.3, double %36
  %44 = fadd double %.0..044.4, %.042..0.4
  %45 = fmul double %44, 5.000000e-01
  %46 = fcmp ogt double %45, 0x3CB0000000000000
  %47 = fcmp olt double %45, 0x3FEFFFFFFFFFFFFE
  %48 = and i1 %47, %46
  br i1 %48, label %.lr.ph.peel, label %._crit_edge

.lr.ph.peel:                                      ; preds = %.preheader
  %49 = tail call double @log(double noundef %45) #3
  %50 = fsub double 1.000000e+00, %45
  %51 = tail call double @log(double noundef %50) #3
  %52 = fsub double %49, %51
  %53 = fmul double %45, %50
  %54 = fdiv double 1.000000e+00, %53
  %55 = tail call double @llvm.fmuladd.f64(double %2, double %45, double %6)
  %56 = fadd double %55, %52
  %57 = fadd double %54, %2
  %58 = fdiv double %56, %57
  %59 = fsub double %45, %58
  %60 = fcmp ogt double %59, 1.000000e+00
  %61 = select i1 %60, double 1.000000e+00, double %59
  %62 = fcmp olt double %61, 0.000000e+00
  %63 = select i1 %62, double 0.000000e+00, double %61
  %64 = fcmp ogt double %63, 0x3CB0000000000000
  %65 = fcmp olt double %63, 0x3FEFFFFFFFFFFFFE
  %66 = and i1 %65, %64
  br i1 %66, label %.lr.ph.preheader.peel.newph, label %._crit_edge

.lr.ph.preheader.peel.newph:                      ; preds = %.lr.ph.peel
  %67 = fsub double 1.000000e+00, %63
  %68 = tail call double @log(double noundef %63) #3
  %69 = tail call double @log(double noundef %67) #3
  %70 = tail call double @llvm.fmuladd.f64(double %2, double %63, double %6)
  %71 = fsub double %68, %69
  %72 = fadd double %70, %71
  %73 = fmul double %63, %67
  %74 = fdiv double 1.000000e+00, %73
  %75 = fadd double %74, %2
  %76 = fdiv double %72, %75
  %77 = fsub double %63, %76
  %78 = fcmp ogt double %77, 1.000000e+00
  %79 = select i1 %78, double 1.000000e+00, double %77
  %80 = fcmp olt double %79, 0.000000e+00
  %81 = select i1 %80, double 0.000000e+00, double %79
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.peel, %.lr.ph.preheader.peel.newph, %.preheader
  %.1.lcssa = phi double [ %45, %.preheader ], [ %63, %.lr.ph.peel ], [ %81, %.lr.ph.preheader.peel.newph ]
  %82 = fneg double %0
  %83 = tail call double @llvm.fmuladd.f64(double %3, double %.1.lcssa, double %82)
  ret double %83
}

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

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

attributes #0 = { nofree nounwind 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 #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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: ADCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass