; LLVM IR from HRI-EU/Rcs :: src/RcsCore (Rcs_Mat3d)

; 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 speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #0

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @Mat3d_isDiagonal(ptr noundef %0, double noundef %1) #1 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca double, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store double %1, ptr %5, align 8, !tbaa !9
  %6 = load ptr, ptr %4, align 8, !tbaa !5
  %7 = getelementptr inbounds [3 x double], ptr %6, i64 0
  %8 = getelementptr inbounds [3 x double], ptr %7, i64 0, i64 1
  %9 = load double, ptr %8, align 8, !tbaa !9
  %10 = call double @llvm.fabs.f64(double %9)
  %11 = load double, ptr %5, align 8, !tbaa !9
  %12 = fcmp ogt double %10, %11
  br i1 %12, label %13, label %14

13:                                               ; preds = %2
  store i1 false, ptr %3, align 1
  br label %60

14:                                               ; preds = %2
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds [3 x double], ptr %15, i64 0
  %17 = getelementptr inbounds [3 x double], ptr %16, i64 0, i64 2
  %18 = load double, ptr %17, align 8, !tbaa !9
  %19 = call double @llvm.fabs.f64(double %18)
  %20 = load double, ptr %5, align 8, !tbaa !9
  %21 = fcmp ogt double %19, %20
  br i1 %21, label %22, label %23

22:                                               ; preds = %14
  store i1 false, ptr %3, align 1
  br label %60

23:                                               ; preds = %14
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds [3 x double], ptr %24, i64 1
  %26 = getelementptr inbounds [3 x double], ptr %25, i64 0, i64 0
  %27 = load double, ptr %26, align 8, !tbaa !9
  %28 = call double @llvm.fabs.f64(double %27)
  %29 = load double, ptr %5, align 8, !tbaa !9
  %30 = fcmp ogt double %28, %29
  br i1 %30, label %31, label %32

31:                                               ; preds = %23
  store i1 false, ptr %3, align 1
  br label %60

32:                                               ; preds = %23
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds [3 x double], ptr %33, i64 1
  %35 = getelementptr inbounds [3 x double], ptr %34, i64 0, i64 2
  %36 = load double, ptr %35, align 8, !tbaa !9
  %37 = call double @llvm.fabs.f64(double %36)
  %38 = load double, ptr %5, align 8, !tbaa !9
  %39 = fcmp ogt double %37, %38
  br i1 %39, label %40, label %41

40:                                               ; preds = %32
  store i1 false, ptr %3, align 1
  br label %60

41:                                               ; preds = %32
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds [3 x double], ptr %42, i64 2
  %44 = getelementptr inbounds [3 x double], ptr %43, i64 0, i64 0
  %45 = load double, ptr %44, align 8, !tbaa !9
  %46 = call double @llvm.fabs.f64(double %45)
  %47 = load double, ptr %5, align 8, !tbaa !9
  %48 = fcmp ogt double %46, %47
  br i1 %48, label %49, label %50

49:                                               ; preds = %41
  store i1 false, ptr %3, align 1
  br label %60

50:                                               ; preds = %41
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds [3 x double], ptr %51, i64 2
  %53 = getelementptr inbounds [3 x double], ptr %52, i64 0, i64 1
  %54 = load double, ptr %53, align 8, !tbaa !9
  %55 = call double @llvm.fabs.f64(double %54)
  %56 = load double, ptr %5, align 8, !tbaa !9
  %57 = fcmp ogt double %55, %56
  br i1 %57, label %58, label %59

58:                                               ; preds = %50
  store i1 false, ptr %3, align 1
  br label %60

59:                                               ; preds = %50
  store i1 true, ptr %3, align 1
  br label %60

60:                                               ; preds = %59, %58, %49, %40, %31, %22, %13
  %61 = load i1, ptr %3, align 1
  ret i1 %61
}

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

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

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local zeroext i1 @Mat3d_isDiagonal(ptr nocapture noundef readonly %0, double noundef %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = load double, ptr %3, align 8, !tbaa !5
  %5 = tail call double @llvm.fabs.f64(double %4)
  %6 = fcmp ogt double %5, %1
  br i1 %6, label %32, label %7

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  %9 = load double, ptr %8, align 8, !tbaa !5
  %10 = tail call double @llvm.fabs.f64(double %9)
  %11 = fcmp ogt double %10, %1
  br i1 %11, label %32, label %12

12:                                               ; preds = %7
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  %14 = load double, ptr %13, align 8, !tbaa !5
  %15 = tail call double @llvm.fabs.f64(double %14)
  %16 = fcmp ogt double %15, %1
  br i1 %16, label %32, label %17

17:                                               ; preds = %12
  %18 = getelementptr inbounds i8, ptr %0, i64 40
  %19 = load double, ptr %18, align 8, !tbaa !5
  %20 = tail call double @llvm.fabs.f64(double %19)
  %21 = fcmp ogt double %20, %1
  br i1 %21, label %32, label %22

22:                                               ; preds = %17
  %23 = getelementptr inbounds i8, ptr %0, i64 48
  %24 = load double, ptr %23, align 8, !tbaa !5
  %25 = tail call double @llvm.fabs.f64(double %24)
  %26 = fcmp ogt double %25, %1
  br i1 %26, label %32, label %27

27:                                               ; preds = %22
  %28 = getelementptr inbounds i8, ptr %0, i64 56
  %29 = load double, ptr %28, align 8, !tbaa !5
  %30 = tail call double @llvm.fabs.f64(double %29)
  %31 = fcmp ule double %30, %1
  br label %32

32:                                               ; preds = %27, %22, %17, %12, %7, %2
  %.0 = phi i1 [ false, %2 ], [ false, %7 ], [ false, %12 ], [ false, %17 ], [ false, %22 ], [ %31, %27 ]
  ret i1 %.0
}

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

!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