; LLVM IR from bohanwang/libpgo :: src/core/solidDeformationModel (elasticModelVolumeMaterial)

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

%"class.pgo::SolidDeformationModel::ElasticModelVolumeMaterial" = type { %"class.pgo::SolidDeformationModel::ElasticModel.base", double }
%"class.pgo::SolidDeformationModel::ElasticModel.base" = type <{ ptr, i8 }>

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare noundef double @_ZN3pgo21NonlinearOptimization11Determinant4Dim33detEPKd(ptr noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3pgo21SolidDeformationModel26ElasticModelVolumeMaterial9compute_PEPKdS3_S3_S3_S3_Pd(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) unnamed_addr #2 align 2 {
  %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
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  store ptr %6, ptr %14, align 8, !tbaa !5
  %17 = load ptr, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %18 = load ptr, ptr %10, align 8, !tbaa !5
  %19 = call noundef double @_ZN3pgo21NonlinearOptimization11Determinant4Dim33detEPKd(ptr noundef %18)
  store double %19, ptr %15, align 8, !tbaa !9
  %20 = load ptr, ptr %10, align 8, !tbaa !5
  %21 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN3pgo21NonlinearOptimization11Determinant4Dim38ddetA_dAEPKdPd(ptr noundef %20, ptr noundef %21)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  store i32 0, ptr %16, align 4, !tbaa !11
  br label %22

22:                                               ; preds = %38, %7
  %23 = load i32, ptr %16, align 4, !tbaa !11
  %24 = icmp slt i32 %23, 9
  br i1 %24, label %26, label %25

25:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  br label %41

26:                                               ; preds = %22
  %27 = load double, ptr %15, align 8, !tbaa !9
  %28 = fsub double %27, 1.000000e+00
  %29 = getelementptr inbounds %"class.pgo::SolidDeformationModel::ElasticModelVolumeMaterial", ptr %17, i32 0, i32 1
  %30 = load double, ptr %29, align 8, !tbaa !13
  %31 = fmul double %28, %30
  %32 = load ptr, ptr %14, align 8, !tbaa !5
  %33 = load i32, ptr %16, align 4, !tbaa !11
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds double, ptr %32, i64 %34
  %36 = load double, ptr %35, align 8, !tbaa !9
  %37 = fmul double %36, %31
  store double %37, ptr %35, align 8, !tbaa !9
  br label %38

38:                                               ; preds = %26
  %39 = load i32, ptr %16, align 4, !tbaa !11
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %16, align 4, !tbaa !11
  br label %22, !llvm.loop !17

41:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  ret void
}

declare void @_ZN3pgo21NonlinearOptimization11Determinant4Dim38ddetA_dAEPKdPd(ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { mustprogress 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 #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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 16}
!14 = !{!"_ZTSN3pgo21SolidDeformationModel26ElasticModelVolumeMaterialE", !15, i64 0, !10, i64 16}
!15 = !{!"_ZTSN3pgo21SolidDeformationModel12ElasticModelE", !16, i64 8}
!16 = !{!"bool", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"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"

declare noundef double @_ZN3pgo21NonlinearOptimization11Determinant4Dim33detEPKd(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3pgo21SolidDeformationModel26ElasticModelVolumeMaterial9compute_PEPKdS3_S3_S3_S3_Pd(ptr nocapture noundef nonnull readonly align 8 dereferenceable(24) %0, ptr nocapture noundef readnone %1, ptr noundef %2, ptr nocapture noundef readnone %3, ptr nocapture noundef readnone %4, ptr nocapture noundef readnone %5, ptr noundef %6) unnamed_addr #1 align 2 {
  %8 = tail call noundef double @_ZN3pgo21NonlinearOptimization11Determinant4Dim33detEPKd(ptr noundef %2)
  tail call void @_ZN3pgo21NonlinearOptimization11Determinant4Dim38ddetA_dAEPKdPd(ptr noundef %2, ptr noundef %6)
  %9 = fadd double %8, -1.000000e+00
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = load double, ptr %10, align 8, !tbaa !5
  %12 = fmul double %9, %11
  %13 = load double, ptr %6, align 8, !tbaa !12
  %14 = fmul double %13, %12
  store double %14, ptr %6, align 8, !tbaa !12
  %15 = load double, ptr %10, align 8, !tbaa !5
  %16 = fmul double %9, %15
  %17 = getelementptr inbounds i8, ptr %6, i64 8
  %18 = load double, ptr %17, align 8, !tbaa !12
  %19 = fmul double %18, %16
  store double %19, ptr %17, align 8, !tbaa !12
  %20 = load double, ptr %10, align 8, !tbaa !5
  %21 = fmul double %9, %20
  %22 = getelementptr inbounds i8, ptr %6, i64 16
  %23 = load double, ptr %22, align 8, !tbaa !12
  %24 = fmul double %23, %21
  store double %24, ptr %22, align 8, !tbaa !12
  %25 = load double, ptr %10, align 8, !tbaa !5
  %26 = fmul double %9, %25
  %27 = getelementptr inbounds i8, ptr %6, i64 24
  %28 = load double, ptr %27, align 8, !tbaa !12
  %29 = fmul double %28, %26
  store double %29, ptr %27, align 8, !tbaa !12
  %30 = load double, ptr %10, align 8, !tbaa !5
  %31 = fmul double %9, %30
  %32 = getelementptr inbounds i8, ptr %6, i64 32
  %33 = load double, ptr %32, align 8, !tbaa !12
  %34 = fmul double %33, %31
  store double %34, ptr %32, align 8, !tbaa !12
  %35 = load double, ptr %10, align 8, !tbaa !5
  %36 = fmul double %9, %35
  %37 = getelementptr inbounds i8, ptr %6, i64 40
  %38 = load double, ptr %37, align 8, !tbaa !12
  %39 = fmul double %38, %36
  store double %39, ptr %37, align 8, !tbaa !12
  %40 = load double, ptr %10, align 8, !tbaa !5
  %41 = fmul double %9, %40
  %42 = getelementptr inbounds i8, ptr %6, i64 48
  %43 = load double, ptr %42, align 8, !tbaa !12
  %44 = fmul double %43, %41
  store double %44, ptr %42, align 8, !tbaa !12
  %45 = load double, ptr %10, align 8, !tbaa !5
  %46 = fmul double %9, %45
  %47 = getelementptr inbounds i8, ptr %6, i64 56
  %48 = load double, ptr %47, align 8, !tbaa !12
  %49 = fmul double %48, %46
  store double %49, ptr %47, align 8, !tbaa !12
  %50 = load double, ptr %10, align 8, !tbaa !5
  %51 = fmul double %9, %50
  %52 = getelementptr inbounds i8, ptr %6, i64 64
  %53 = load double, ptr %52, align 8, !tbaa !12
  %54 = fmul double %53, %51
  store double %54, ptr %52, align 8, !tbaa !12
  ret void
}

declare void @_ZN3pgo21NonlinearOptimization11Determinant4Dim38ddetA_dAEPKdPd(ptr noundef, ptr noundef) local_unnamed_addr #0

attributes #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 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, !11, i64 16}
!6 = !{!"_ZTSN3pgo21SolidDeformationModel26ElasticModelVolumeMaterialE", !7, i64 0, !11, i64 16}
!7 = !{!"_ZTSN3pgo21SolidDeformationModel12ElasticModelE", !8, i64 8}
!8 = !{!"bool", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"double", !9, i64 0}
!12 = !{!11, !11, i64 0}


; Effective O3 passes: GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass