; LLVM IR from InsightSoftwareConsortium/ITK :: Modules/Numerics/FEM/src (dsrc2c)

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

@c__0 = external hidden global i64, align 8
@c_b21 = external hidden global double, align 8
@sbini_.i = external hidden global i64, align 8

; Function Attrs: nounwind uwtable
declare dso_local i32 @ivfill_(ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @vfill_(ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @sbini_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #0 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  store i64 0, ptr @sbini_.i, align 8, !tbaa !9
  br label %13

13:                                               ; preds = %25, %6
  %14 = load i64, ptr @sbini_.i, align 8, !tbaa !9
  %15 = load ptr, ptr %7, align 8, !tbaa !5
  %16 = load i64, ptr %15, align 8, !tbaa !9
  %17 = icmp slt i64 %14, %16
  br i1 %17, label %18, label %28

18:                                               ; preds = %13
  %19 = load i64, ptr @sbini_.i, align 8, !tbaa !9
  %20 = sub nsw i64 0, %19
  %21 = sub nsw i64 %20, 1
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  %23 = load i64, ptr @sbini_.i, align 8, !tbaa !9
  %24 = getelementptr inbounds i64, ptr %22, i64 %23
  store i64 %21, ptr %24, align 8, !tbaa !9
  br label %25

25:                                               ; preds = %18
  %26 = load i64, ptr @sbini_.i, align 8, !tbaa !9
  %27 = add nsw i64 %26, 1
  store i64 %27, ptr @sbini_.i, align 8, !tbaa !9
  br label %13, !llvm.loop !11

28:                                               ; preds = %13
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = load i64, ptr %29, align 8, !tbaa !9
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = load i64, ptr %32, align 8, !tbaa !9
  %34 = getelementptr inbounds i64, ptr %31, i64 %33
  store i64 %30, ptr %34, align 8, !tbaa !9
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = call i32 @ivfill_(ptr noundef %35, ptr noundef %36, ptr noundef @c__0)
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = load ptr, ptr %12, align 8, !tbaa !5
  %40 = call i32 @ivfill_(ptr noundef %38, ptr noundef %39, ptr noundef @c__0)
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = load ptr, ptr %11, align 8, !tbaa !5
  %43 = call i32 @vfill_(ptr noundef %41, ptr noundef %42, ptr noundef @c_b21)
  ret i32 0
}

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

!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 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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

@c__0 = external hidden global i64, align 8
@c_b21 = external hidden global double, align 8
@sbini_.i = external hidden local_unnamed_addr global i64, align 8

; Function Attrs: nounwind uwtable
declare dso_local i32 @ivfill_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @vfill_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @sbini_(ptr nocapture noundef readonly %0, ptr noundef %1, ptr nocapture noundef writeonly %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #0 {
  store i64 0, ptr @sbini_.i, align 8, !tbaa !5
  %7 = load i64, ptr %0, align 8, !tbaa !5
  %8 = icmp sgt i64 %7, 0
  br i1 %8, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %6, %.lr.ph
  %storemerge12 = phi i64 [ %12, %.lr.ph ], [ 0, %6 ]
  %9 = xor i64 %storemerge12, -1
  %10 = getelementptr inbounds i64, ptr %2, i64 %storemerge12
  store i64 %9, ptr %10, align 8, !tbaa !5
  %11 = load i64, ptr @sbini_.i, align 8, !tbaa !5
  %12 = add nsw i64 %11, 1
  store i64 %12, ptr @sbini_.i, align 8, !tbaa !5
  %13 = load i64, ptr %0, align 8, !tbaa !5
  %14 = icmp slt i64 %12, %13
  br i1 %14, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %6
  %.lcssa = phi i64 [ %7, %6 ], [ %13, %.lr.ph ]
  %15 = load i64, ptr %1, align 8, !tbaa !5
  %16 = getelementptr inbounds i64, ptr %2, i64 %.lcssa
  store i64 %15, ptr %16, align 8, !tbaa !5
  %17 = tail call i32 @ivfill_(ptr noundef nonnull %1, ptr noundef %3, ptr noundef nonnull @c__0)
  %18 = tail call i32 @ivfill_(ptr noundef nonnull %1, ptr noundef %5, ptr noundef nonnull @c__0)
  %19 = tail call i32 @vfill_(ptr noundef nonnull %1, ptr noundef %4, ptr noundef nonnull @c_b21)
  ret i32 0
}

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

!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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass