; LLVM IR from siconos/siconos :: externals/SOL/lumod-c (lumod_sparse)

; 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 void @elmgen(ptr noundef %0, ptr noundef %1, double noundef %2, ptr noundef %3, ptr noundef %4) #1 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store double %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  store double 0.000000e+00, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  store double 1.000000e+00, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %14 = load double, ptr %8, align 8, !tbaa !9
  %15 = fmul double %14, 1.000000e-04
  store double %15, ptr %13, align 8, !tbaa !9
  %16 = load double, ptr %11, align 8, !tbaa !9
  %17 = load ptr, ptr %9, align 8, !tbaa !5
  store double %16, ptr %17, align 8, !tbaa !9
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = load double, ptr %18, align 8, !tbaa !9
  %20 = call double @llvm.fabs.f64(double %19)
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  %22 = load double, ptr %21, align 8, !tbaa !9
  %23 = call double @llvm.fabs.f64(double %22)
  %24 = fcmp oge double %20, %23
  br i1 %24, label %25, label %45

25:                                               ; preds = %5
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = load double, ptr %26, align 8, !tbaa !9
  %28 = call double @llvm.fabs.f64(double %27)
  %29 = load double, ptr %13, align 8, !tbaa !9
  %30 = fcmp ole double %28, %29
  br i1 %30, label %31, label %36

31:                                               ; preds = %25
  %32 = load double, ptr %11, align 8, !tbaa !9
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  store double %32, ptr %33, align 8, !tbaa !9
  %34 = load double, ptr %11, align 8, !tbaa !9
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  store double %34, ptr %35, align 8, !tbaa !9
  br label %44

36:                                               ; preds = %25
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = load double, ptr %37, align 8, !tbaa !9
  %39 = fneg double %38
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = load double, ptr %40, align 8, !tbaa !9
  %42 = fdiv double %39, %41
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  store double %42, ptr %43, align 8, !tbaa !9
  br label %44

44:                                               ; preds = %36, %31
  br label %71

45:                                               ; preds = %5
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = load double, ptr %46, align 8, !tbaa !9
  %48 = call double @llvm.fabs.f64(double %47)
  %49 = load double, ptr %13, align 8, !tbaa !9
  %50 = fcmp ole double %48, %49
  br i1 %50, label %51, label %56

51:                                               ; preds = %45
  %52 = load double, ptr %11, align 8, !tbaa !9
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  store double %52, ptr %53, align 8, !tbaa !9
  %54 = load double, ptr %11, align 8, !tbaa !9
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  store double %54, ptr %55, align 8, !tbaa !9
  br label %70

56:                                               ; preds = %45
  %57 = load double, ptr %12, align 8, !tbaa !9
  %58 = fneg double %57
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  store double %58, ptr %59, align 8, !tbaa !9
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = load double, ptr %60, align 8, !tbaa !9
  %62 = fneg double %61
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = load double, ptr %63, align 8, !tbaa !9
  %65 = fdiv double %62, %64
  %66 = load ptr, ptr %10, align 8, !tbaa !5
  store double %65, ptr %66, align 8, !tbaa !9
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = load double, ptr %67, align 8, !tbaa !9
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  store double %68, ptr %69, align 8, !tbaa !9
  br label %70

70:                                               ; preds = %56, %51
  br label %71

71:                                               ; preds = %70, %44
  %72 = load double, ptr %11, align 8, !tbaa !9
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  store double %72, ptr %73, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  ret void
}

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

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 }

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}


; 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 norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @elmgen(ptr nocapture noundef %0, ptr nocapture noundef %1, double noundef %2, ptr nocapture noundef writeonly %3, ptr nocapture noundef writeonly %4) local_unnamed_addr #0 {
  %6 = fmul double %2, 1.000000e-04
  store double 0.000000e+00, ptr %3, align 8, !tbaa !5
  %7 = load double, ptr %0, align 8, !tbaa !5
  %8 = tail call double @llvm.fabs.f64(double %7)
  %9 = load double, ptr %1, align 8, !tbaa !5
  %10 = tail call double @llvm.fabs.f64(double %9)
  %11 = fcmp ult double %8, %10
  br i1 %11, label %18, label %12

12:                                               ; preds = %5
  %13 = fcmp ugt double %8, %6
  br i1 %13, label %15, label %14

14:                                               ; preds = %12
  store double 0.000000e+00, ptr %4, align 8, !tbaa !5
  store double 0.000000e+00, ptr %0, align 8, !tbaa !5
  br label %27

15:                                               ; preds = %12
  %16 = fneg double %9
  %17 = fdiv double %16, %7
  store double %17, ptr %4, align 8, !tbaa !5
  br label %27

18:                                               ; preds = %5
  %19 = fcmp ugt double %10, %6
  br i1 %19, label %21, label %20

20:                                               ; preds = %18
  store double 0.000000e+00, ptr %4, align 8, !tbaa !5
  store double 0.000000e+00, ptr %0, align 8, !tbaa !5
  br label %27

21:                                               ; preds = %18
  store double -1.000000e+00, ptr %3, align 8, !tbaa !5
  %22 = load double, ptr %0, align 8, !tbaa !5
  %23 = fneg double %22
  %24 = load double, ptr %1, align 8, !tbaa !5
  %25 = fdiv double %23, %24
  store double %25, ptr %4, align 8, !tbaa !5
  %26 = load double, ptr %1, align 8, !tbaa !5
  store double %26, ptr %0, align 8, !tbaa !5
  br label %27

27:                                               ; preds = %20, %21, %14, %15
  store double 0.000000e+00, ptr %1, align 8, !tbaa !5
  ret void
}

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

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

!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"}


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