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

%struct.anon = type { i64, i64, i64, i64, i64, i64 }
%struct.anon.0 = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double }

@itcom1_ = external hidden global %struct.anon, align 8
@itcom3_ = external hidden global %struct.anon.0, align 8
@parcon_.ip = external hidden global i64, align 8
@parcon_.rhoold = external hidden global double, align 8

; Function Attrs: nounwind uwtable
define dso_local i32 @parcon_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7) #0 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  store ptr %7, ptr %16, align 8, !tbaa !5
  %17 = load i64, ptr @itcom1_, align 8, !tbaa !9
  %18 = load i64, ptr getelementptr inbounds (%struct.anon, ptr @itcom1_, i32 0, i32 1), align 8, !tbaa !12
  %19 = sub nsw i64 %17, %18
  store i64 %19, ptr @parcon_.ip, align 8, !tbaa !13
  %20 = load double, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 10), align 8, !tbaa !14
  store double %20, ptr @parcon_.rhoold, align 8, !tbaa !17
  %21 = load double, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 6), align 8, !tbaa !18
  %22 = load ptr, ptr %14, align 8, !tbaa !5
  store double %21, ptr %22, align 8, !tbaa !17
  %23 = load ptr, ptr %16, align 8, !tbaa !5
  %24 = load i64, ptr %23, align 8, !tbaa !13
  %25 = icmp sle i64 %24, 2
  br i1 %25, label %26, label %33

26:                                               ; preds = %8
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = load double, ptr %27, align 8, !tbaa !17
  %29 = load double, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 3), align 8, !tbaa !19
  %30 = fdiv double %28, %29
  %31 = fsub double 1.000000e+00, %30
  %32 = fdiv double 1.000000e+00, %31
  store double %32, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 6), align 8, !tbaa !18
  br label %33

33:                                               ; preds = %26, %8
  %34 = load ptr, ptr %16, align 8, !tbaa !5
  %35 = load i64, ptr %34, align 8, !tbaa !13
  %36 = icmp eq i64 %35, 3
  br i1 %36, label %37, label %42

37:                                               ; preds = %33
  %38 = load double, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 3), align 8, !tbaa !19
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = load double, ptr %39, align 8, !tbaa !17
  %41 = fdiv double %38, %40
  store double %41, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 6), align 8, !tbaa !18
  br label %42

42:                                               ; preds = %37, %33
  store double 1.000000e+00, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 10), align 8, !tbaa !14
  %43 = load i64, ptr @parcon_.ip, align 8, !tbaa !13
  %44 = icmp ne i64 %43, 0
  br i1 %44, label %45, label %71

45:                                               ; preds = %42
  %46 = load i64, ptr getelementptr inbounds (%struct.anon, ptr @itcom1_, i32 0, i32 2), align 8, !tbaa !20
  %47 = icmp ne i64 %46, 0
  br i1 %47, label %48, label %57

48:                                               ; preds = %45
  %49 = load double, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 6), align 8, !tbaa !18
  %50 = load ptr, ptr %15, align 8, !tbaa !5
  %51 = load double, ptr %50, align 8, !tbaa !17
  %52 = fmul double %49, %51
  %53 = load double, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 4), align 8, !tbaa !21
  %54 = fdiv double %52, %53
  %55 = fsub double 1.000000e+00, %54
  %56 = fdiv double 1.000000e+00, %55
  store double %56, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 10), align 8, !tbaa !14
  br label %70

57:                                               ; preds = %45
  %58 = load double, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 6), align 8, !tbaa !18
  %59 = load double, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 3), align 8, !tbaa !19
  %60 = fmul double %58, %59
  %61 = load ptr, ptr %14, align 8, !tbaa !5
  %62 = load double, ptr %61, align 8, !tbaa !17
  %63 = load double, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 4), align 8, !tbaa !21
  %64 = fmul double %62, %63
  %65 = load double, ptr @parcon_.rhoold, align 8, !tbaa !17
  %66 = fmul double %64, %65
  %67 = fdiv double %60, %66
  %68 = fsub double 1.000000e+00, %67
  %69 = fdiv double 1.000000e+00, %68
  store double %69, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 10), align 8, !tbaa !14
  br label %70

70:                                               ; preds = %57, %48
  br label %71

71:                                               ; preds = %70, %42
  %72 = load double, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 3), align 8, !tbaa !19
  store double %72, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 4), align 8, !tbaa !21
  %73 = load double, ptr @parcon_.rhoold, align 8, !tbaa !17
  %74 = load ptr, ptr %15, align 8, !tbaa !5
  store double %73, ptr %74, align 8, !tbaa !17
  %75 = load double, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 10), align 8, !tbaa !14
  %76 = load double, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 6), align 8, !tbaa !18
  %77 = fmul double %75, %76
  %78 = load ptr, ptr %10, align 8, !tbaa !5
  store double %77, ptr %78, align 8, !tbaa !17
  %79 = load double, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 10), align 8, !tbaa !14
  %80 = load ptr, ptr %11, align 8, !tbaa !5
  store double %79, ptr %80, align 8, !tbaa !17
  %81 = load double, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 10), align 8, !tbaa !14
  %82 = fsub double 1.000000e+00, %81
  %83 = load ptr, ptr %12, align 8, !tbaa !5
  store double %82, ptr %83, align 8, !tbaa !17
  %84 = load double, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 10), align 8, !tbaa !14
  %85 = load double, ptr getelementptr inbounds (%struct.anon.0, ptr @itcom3_, i32 0, i32 6), align 8, !tbaa !18
  %86 = fsub double 1.000000e+00, %85
  %87 = fmul double %84, %86
  %88 = load ptr, ptr %13, align 8, !tbaa !5
  store double %87, ptr %88, align 8, !tbaa !17
  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, !11, i64 0}
!10 = !{!"", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40}
!11 = !{!"long", !7, i64 0}
!12 = !{!10, !11, i64 8}
!13 = !{!11, !11, i64 0}
!14 = !{!15, !16, i64 80}
!15 = !{!"", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !16, i64 72, !16, i64 80, !16, i64 88, !16, i64 96, !16, i64 104, !16, i64 112, !16, i64 120, !16, i64 128, !16, i64 136, !16, i64 144, !16, i64 152}
!16 = !{!"double", !7, i64 0}
!17 = !{!16, !16, i64 0}
!18 = !{!15, !16, i64 48}
!19 = !{!15, !16, i64 24}
!20 = !{!10, !11, i64 16}
!21 = !{!15, !16, i64 32}


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

%struct.anon = type { i64, i64, i64, i64, i64, i64 }
%struct.anon.0 = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double }

@itcom1_ = external hidden local_unnamed_addr global %struct.anon, align 8
@itcom3_ = external hidden local_unnamed_addr global %struct.anon.0, align 8
@parcon_.ip = external hidden local_unnamed_addr global i64, align 8
@parcon_.rhoold = external hidden local_unnamed_addr global double, align 8

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable
define dso_local noundef i32 @parcon_(ptr nocapture noundef readonly %0, ptr nocapture noundef writeonly %1, ptr nocapture noundef writeonly %2, ptr nocapture noundef writeonly %3, ptr nocapture noundef writeonly %4, ptr nocapture noundef %5, ptr nocapture noundef %6, ptr nocapture noundef readonly %7) local_unnamed_addr #0 {
  %9 = load i64, ptr @itcom1_, align 8, !tbaa !5
  %10 = load i64, ptr getelementptr inbounds (i8, ptr @itcom1_, i64 8), align 8, !tbaa !10
  %11 = sub nsw i64 %9, %10
  store i64 %11, ptr @parcon_.ip, align 8, !tbaa !11
  %12 = load double, ptr getelementptr inbounds (i8, ptr @itcom3_, i64 80), align 8, !tbaa !12
  store double %12, ptr @parcon_.rhoold, align 8, !tbaa !15
  %13 = load double, ptr getelementptr inbounds (i8, ptr @itcom3_, i64 48), align 8, !tbaa !16
  store double %13, ptr %5, align 8, !tbaa !15
  %14 = load i64, ptr %7, align 8, !tbaa !11
  %15 = icmp slt i64 %14, 3
  br i1 %15, label %.thread, label %21

.thread:                                          ; preds = %8
  %16 = load double, ptr %0, align 8, !tbaa !15
  %17 = load double, ptr getelementptr inbounds (i8, ptr @itcom3_, i64 24), align 8, !tbaa !17
  %18 = fdiv double %16, %17
  %19 = fsub double 1.000000e+00, %18
  %20 = fdiv double 1.000000e+00, %19
  br label %.sink.split

21:                                               ; preds = %8
  %22 = icmp eq i64 %14, 3
  br i1 %22, label %23, label %27

23:                                               ; preds = %21
  %24 = load double, ptr getelementptr inbounds (i8, ptr @itcom3_, i64 24), align 8, !tbaa !17
  %25 = load double, ptr %0, align 8, !tbaa !15
  %26 = fdiv double %24, %25
  br label %.sink.split

.sink.split:                                      ; preds = %23, %.thread
  %.sink = phi double [ %20, %.thread ], [ %26, %23 ]
  store double %.sink, ptr getelementptr inbounds (i8, ptr @itcom3_, i64 48), align 8, !tbaa !16
  br label %27

27:                                               ; preds = %.sink.split, %21
  %28 = phi double [ %13, %21 ], [ %.sink, %.sink.split ]
  store double 1.000000e+00, ptr getelementptr inbounds (i8, ptr @itcom3_, i64 80), align 8, !tbaa !12
  %.not = icmp eq i64 %9, %10
  br i1 %.not, label %49, label %29

29:                                               ; preds = %27
  %30 = load i64, ptr getelementptr inbounds (i8, ptr @itcom1_, i64 16), align 8, !tbaa !18
  %.not12 = icmp eq i64 %30, 0
  br i1 %.not12, label %36, label %31

31:                                               ; preds = %29
  %32 = load double, ptr %6, align 8, !tbaa !15
  %33 = fmul double %28, %32
  %34 = load double, ptr getelementptr inbounds (i8, ptr @itcom3_, i64 32), align 8, !tbaa !19
  %35 = fdiv double %33, %34
  br label %.sink.split13

36:                                               ; preds = %29
  %37 = load double, ptr %5, align 8, !tbaa !15
  %38 = load <2 x double>, ptr getelementptr inbounds (i8, ptr @itcom3_, i64 24), align 8, !tbaa !15
  %39 = insertelement <2 x double> poison, double %28, i64 0
  %40 = insertelement <2 x double> %39, double %37, i64 1
  %41 = fmul <2 x double> %40, %38
  %42 = load double, ptr @parcon_.rhoold, align 8, !tbaa !15
  %43 = extractelement <2 x double> %41, i64 1
  %44 = fmul double %43, %42
  %45 = extractelement <2 x double> %41, i64 0
  %46 = fdiv double %45, %44
  br label %.sink.split13

.sink.split13:                                    ; preds = %36, %31
  %.sink16 = phi double [ %35, %31 ], [ %46, %36 ]
  %47 = fsub double 1.000000e+00, %.sink16
  %48 = fdiv double 1.000000e+00, %47
  store double %48, ptr getelementptr inbounds (i8, ptr @itcom3_, i64 80), align 8, !tbaa !12
  br label %49

49:                                               ; preds = %.sink.split13, %27
  %50 = load double, ptr getelementptr inbounds (i8, ptr @itcom3_, i64 24), align 8, !tbaa !17
  store double %50, ptr getelementptr inbounds (i8, ptr @itcom3_, i64 32), align 8, !tbaa !19
  %51 = load double, ptr @parcon_.rhoold, align 8, !tbaa !15
  store double %51, ptr %6, align 8, !tbaa !15
  %52 = load double, ptr getelementptr inbounds (i8, ptr @itcom3_, i64 80), align 8, !tbaa !12
  %53 = load double, ptr getelementptr inbounds (i8, ptr @itcom3_, i64 48), align 8, !tbaa !16
  %54 = fmul double %52, %53
  store double %54, ptr %1, align 8, !tbaa !15
  %55 = load double, ptr getelementptr inbounds (i8, ptr @itcom3_, i64 80), align 8, !tbaa !12
  store double %55, ptr %2, align 8, !tbaa !15
  %56 = fsub double 1.000000e+00, %55
  store double %56, ptr %3, align 8, !tbaa !15
  %57 = load double, ptr getelementptr inbounds (i8, ptr @itcom3_, i64 80), align 8, !tbaa !12
  %58 = load double, ptr getelementptr inbounds (i8, ptr @itcom3_, i64 48), align 8, !tbaa !16
  %59 = fsub double 1.000000e+00, %58
  %60 = fmul double %57, %59
  store double %60, ptr %4, align 8, !tbaa !15
  ret i32 0
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) 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, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !14, i64 80}
!13 = !{!"", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !14, i64 96, !14, i64 104, !14, i64 112, !14, i64 120, !14, i64 128, !14, i64 136, !14, i64 144, !14, i64 152}
!14 = !{!"double", !8, i64 0}
!15 = !{!14, !14, i64 0}
!16 = !{!13, !14, i64 48}
!17 = !{!13, !14, i64 24}
!18 = !{!6, !7, i64 16}
!19 = !{!13, !14, i64 32}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass