; LLVM IR from MBMS/C-CODE_FOR_MEMBRANE_BASED_MODEL :: CODE_MODEL/Membrane.ll (ZN8Membrane14knudsen_diffusER15SegmentPropertyP3HXMd)

; 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.SegmentProperty = type <{ double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, i32, [4 x i8] }>
%class.HXM = type { double, double, double, double, double, double, double, double, double, double, i32, i32, i32, i32, double, double, double, double, double, double, double, double, i32, i32 }

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN8Membrane14knudsen_diffusER15SegmentPropertyP3HXMd(ptr noundef nonnull align 8 dereferenceable(284) %0, ptr noundef %1, double noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca %struct.SegmentProperty, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store double %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 288, ptr %7) #4
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN15SegmentPropertyC2ERKS_(ptr noundef nonnull align 8 dereferenceable(284) %7, ptr noundef nonnull align 8 dereferenceable(284) %12)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = getelementptr inbounds %class.HXM, ptr %13, i32 0, i32 4
  %15 = load double, ptr %14, align 8, !tbaa !11
  store double %15, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %16 = getelementptr inbounds %struct.SegmentProperty, ptr %7, i32 0, i32 0
  %17 = load double, ptr %16, align 8, !tbaa !14
  %18 = getelementptr inbounds %struct.SegmentProperty, ptr %7, i32 0, i32 1
  %19 = load double, ptr %18, align 8, !tbaa !16
  %20 = fmul double %17, %19
  %21 = getelementptr inbounds %struct.SegmentProperty, ptr %7, i32 0, i32 2
  %22 = load double, ptr %21, align 8, !tbaa !17
  %23 = load double, ptr %8, align 8, !tbaa !9
  %24 = fmul double %22, %23
  %25 = fdiv double %20, %24
  store double %25, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %26 = load double, ptr %6, align 8, !tbaa !9
  %27 = fmul double 8.314000e+00, %26
  %28 = fdiv double 1.800000e+01, %27
  %29 = fdiv double %28, 1.000000e+03
  store double %29, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %30 = load double, ptr %9, align 8, !tbaa !9
  %31 = fmul double 1.064000e+00, %30
  %32 = load double, ptr %10, align 8, !tbaa !9
  %33 = call double @pow(double noundef %32, double noundef 5.000000e-01) #4
  %34 = fmul double %31, %33
  store double %34, ptr %11, align 8, !tbaa !9
  %35 = load double, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 288, ptr %7) #4
  ret double %35
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN15SegmentPropertyC2ERKS_(ptr noundef nonnull align 8 dereferenceable(284), ptr noundef nonnull align 8 dereferenceable(284)) unnamed_addr #2 align 2

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #3

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 #3 = { nounwind "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 #4 = { 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, !10, i64 32}
!12 = !{!"_ZTS3HXM", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !13, i64 80, !13, i64 84, !13, i64 88, !13, i64 92, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !13, i64 160, !13, i64 164}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !10, i64 0}
!15 = !{!"_ZTS15SegmentProperty", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !13, i64 280}
!16 = !{!15, !10, i64 8}
!17 = !{!15, !10, i64 16}


; 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.SegmentProperty = type <{ double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, i32, [4 x i8] }>

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZN8Membrane14knudsen_diffusER15SegmentPropertyP3HXMd(ptr noundef nonnull align 8 dereferenceable(284) %0, ptr nocapture noundef readonly %1, double noundef %2) local_unnamed_addr #0 {
  %4 = alloca %struct.SegmentProperty, align 16
  call void @llvm.lifetime.start.p0(i64 288, ptr nonnull %4) #3
  call void @_ZN15SegmentPropertyC2ERKS_(ptr noundef nonnull align 8 dereferenceable(284) %4, ptr noundef nonnull align 8 dereferenceable(284) %0)
  %5 = getelementptr inbounds i8, ptr %1, i64 32
  %6 = load double, ptr %5, align 8, !tbaa !5
  %7 = load <2 x double>, ptr %4, align 16
  %8 = getelementptr inbounds i8, ptr %4, i64 8
  %9 = load <2 x double>, ptr %8, align 8, !tbaa !11
  %10 = insertelement <2 x double> %7, double %6, i64 1
  %11 = fmul <2 x double> %10, %9
  %12 = extractelement <2 x double> %11, i64 0
  %13 = extractelement <2 x double> %11, i64 1
  %14 = fdiv double %12, %13
  %15 = fmul double %2, 8.314000e+00
  %16 = fdiv double 1.800000e+01, %15
  %17 = fdiv double %16, 1.000000e+03
  %18 = fmul double %14, 1.064000e+00
  %19 = call double @pow(double noundef %17, double noundef 5.000000e-01) #3
  %20 = fmul double %19, %18
  call void @llvm.lifetime.end.p0(i64 288, ptr nonnull %4) #3
  ret double %20
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN15SegmentPropertyC2ERKS_(ptr noundef nonnull align 8 dereferenceable(284), ptr noundef nonnull align 8 dereferenceable(284)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #2

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

attributes #0 = { mustprogress 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(write) "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, !7, i64 32}
!6 = !{!"_ZTS3HXM", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !10, i64 160, !10, i64 164}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!7, !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,VectorCombinePass