; LLVM IR from USDA-ARS-ACSL/MAIZSIM :: Crop source/organ.ll (ZN6COrganC2Ev)

; 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.COrgan = type { ptr, double, double, %struct.TInitInfo, ptr, ptr, double, double, double, double, double, double, double, double, double }
%struct.TInitInfo = type { [255 x i8], [255 x i8], i32, i32, double, double, double, double, i32, i32, i32, double, i32, double, i8, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double }

@_ZTV6COrgan = external dso_local unnamed_addr constant { [18 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6COrganC2Ev(ptr noundef nonnull align 8 dereferenceable(864) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  store ptr getelementptr inbounds inrange(-16, 128) ({ [18 x ptr] }, ptr @_ZTV6COrgan, i32 0, i32 0, i32 2), ptr %5, align 8, !tbaa !9
  %6 = getelementptr inbounds %class.COrgan, ptr %5, i32 0, i32 3
  call void @_ZN9TInitInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(752) %6)
  %7 = getelementptr inbounds %class.COrgan, ptr %5, i32 0, i32 8
  store double 0.000000e+00, ptr %7, align 8, !tbaa !11
  %8 = getelementptr inbounds %class.COrgan, ptr %5, i32 0, i32 7
  store double 0.000000e+00, ptr %8, align 8, !tbaa !17
  %9 = getelementptr inbounds %class.COrgan, ptr %5, i32 0, i32 6
  store double 0.000000e+00, ptr %9, align 8, !tbaa !18
  %10 = getelementptr inbounds %class.COrgan, ptr %5, i32 0, i32 2
  store double 0.000000e+00, ptr %10, align 8, !tbaa !19
  %11 = getelementptr inbounds %class.COrgan, ptr %5, i32 0, i32 9
  store double 0.000000e+00, ptr %11, align 8, !tbaa !20
  %12 = getelementptr inbounds %class.COrgan, ptr %5, i32 0, i32 1
  store double 4.000000e-01, ptr %12, align 8, !tbaa !21
  %13 = getelementptr inbounds %class.COrgan, ptr %5, i32 0, i32 10
  store double 2.500000e+01, ptr %13, align 8, !tbaa !22
  %14 = getelementptr inbounds %class.COrgan, ptr %5, i32 0, i32 12
  store double 1.000000e+01, ptr %14, align 8, !tbaa !23
  %15 = getelementptr inbounds %class.COrgan, ptr %5, i32 0, i32 11
  store double 5.000000e+01, ptr %15, align 8, !tbaa !24
  %16 = getelementptr inbounds %class.COrgan, ptr %5, i32 0, i32 5
  store ptr null, ptr %16, align 8, !tbaa !25
  %17 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 72) #5
  invoke void @_ZN12CThermalTimeC1Ev(ptr noundef nonnull align 8 dereferenceable(72) %17)
          to label %18 unwind label %22

18:                                               ; preds = %1
  %19 = getelementptr inbounds %class.COrgan, ptr %5, i32 0, i32 5
  store ptr %17, ptr %19, align 8, !tbaa !25
  %20 = getelementptr inbounds %class.COrgan, ptr %5, i32 0, i32 13
  store double 0.000000e+00, ptr %20, align 8, !tbaa !26
  %21 = getelementptr inbounds %class.COrgan, ptr %5, i32 0, i32 14
  store double 0.000000e+00, ptr %21, align 8, !tbaa !27
  ret void

22:                                               ; preds = %1
  %23 = landingpad { ptr, i32 }
          cleanup
  %24 = extractvalue { ptr, i32 } %23, 0
  store ptr %24, ptr %3, align 8
  %25 = extractvalue { ptr, i32 } %23, 1
  store i32 %25, ptr %4, align 4
  call void @_ZdlPvm(ptr noundef %17, i64 noundef 72) #6
  br label %26

26:                                               ; preds = %22
  %27 = load ptr, ptr %3, align 8
  %28 = load i32, ptr %4, align 4
  %29 = insertvalue { ptr, i32 } poison, ptr %27, 0
  %30 = insertvalue { ptr, i32 } %29, i32 %28, 1
  resume { ptr, i32 } %30
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9TInitInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(752)) unnamed_addr #1 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #2

declare void @_ZN12CThermalTimeC1Ev(ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #4

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 = { 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 #2 = { nobuiltin allocsize(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 = { "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 = { nobuiltin 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 #5 = { builtin allocsize(0) }
attributes #6 = { builtin 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !13, i64 808}
!12 = !{!"_ZTS6COrgan", !13, i64 8, !13, i64 16, !14, i64 24, !6, i64 776, !6, i64 784, !13, i64 792, !13, i64 800, !13, i64 808, !13, i64 816, !13, i64 824, !13, i64 832, !13, i64 840, !13, i64 848, !13, i64 856}
!13 = !{!"double", !7, i64 0}
!14 = !{!"_ZTS9TInitInfo", !7, i64 0, !7, i64 255, !15, i64 512, !15, i64 516, !13, i64 520, !13, i64 528, !13, i64 536, !13, i64 544, !15, i64 552, !15, i64 556, !15, i64 560, !13, i64 568, !15, i64 576, !13, i64 584, !16, i64 592, !13, i64 600, !13, i64 608, !13, i64 616, !13, i64 624, !13, i64 632, !13, i64 640, !13, i64 648, !13, i64 656, !13, i64 664, !13, i64 672, !13, i64 680, !13, i64 688, !13, i64 696, !13, i64 704, !13, i64 712, !13, i64 720, !13, i64 728, !13, i64 736, !13, i64 744}
!15 = !{!"int", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!12, !13, i64 800}
!18 = !{!12, !13, i64 792}
!19 = !{!12, !13, i64 16}
!20 = !{!12, !13, i64 816}
!21 = !{!12, !13, i64 8}
!22 = !{!12, !13, i64 824}
!23 = !{!12, !13, i64 840}
!24 = !{!12, !13, i64 832}
!25 = !{!12, !6, i64 784}
!26 = !{!12, !13, i64 848}
!27 = !{!12, !13, i64 856}


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

@_ZTV6COrgan = external dso_local unnamed_addr constant { [18 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6COrganC2Ev(ptr noundef nonnull align 8 dereferenceable(864) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  store ptr getelementptr inbounds inrange(-16, 128) (i8, ptr @_ZTV6COrgan, i64 16), ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 24
  tail call void @_ZN9TInitInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(752) %2)
  %3 = getelementptr inbounds i8, ptr %0, i64 792
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %3, i8 0, i64 32, i1 false)
  store <2 x double> <double 4.000000e-01, double 0.000000e+00>, ptr %4, align 8, !tbaa !8
  %5 = getelementptr inbounds i8, ptr %0, i64 824
  %6 = getelementptr inbounds i8, ptr %0, i64 840
  store double 1.000000e+01, ptr %6, align 8, !tbaa !11
  store <2 x double> <double 2.500000e+01, double 5.000000e+01>, ptr %5, align 8, !tbaa !8
  %7 = getelementptr inbounds i8, ptr %0, i64 784
  store ptr null, ptr %7, align 8, !tbaa !17
  %8 = tail call noalias noundef nonnull dereferenceable(72) ptr @_Znwm(i64 noundef 72) #6
  invoke void @_ZN12CThermalTimeC1Ev(ptr noundef nonnull align 8 dereferenceable(72) %8)
          to label %9 unwind label %11

9:                                                ; preds = %1
  store ptr %8, ptr %7, align 8, !tbaa !17
  %10 = getelementptr inbounds i8, ptr %0, i64 848
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %10, i8 0, i64 16, i1 false)
  ret void

11:                                               ; preds = %1
  %12 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %8, i64 noundef 72) #7
  resume { ptr, i32 } %12
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9TInitInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(752)) unnamed_addr #1 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #2

declare void @_ZN12CThermalTimeC1Ev(ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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 = { 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 #2 = { nobuiltin allocsize(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 = { "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 = { nobuiltin 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { builtin allocsize(0) }
attributes #7 = { builtin 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"double", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !9, i64 840}
!12 = !{!"_ZTS6COrgan", !9, i64 8, !9, i64 16, !13, i64 24, !16, i64 776, !16, i64 784, !9, i64 792, !9, i64 800, !9, i64 808, !9, i64 816, !9, i64 824, !9, i64 832, !9, i64 840, !9, i64 848, !9, i64 856}
!13 = !{!"_ZTS9TInitInfo", !10, i64 0, !10, i64 255, !14, i64 512, !14, i64 516, !9, i64 520, !9, i64 528, !9, i64 536, !9, i64 544, !14, i64 552, !14, i64 556, !14, i64 560, !9, i64 568, !14, i64 576, !9, i64 584, !15, i64 592, !9, i64 600, !9, i64 608, !9, i64 616, !9, i64 624, !9, i64 632, !9, i64 640, !9, i64 648, !9, i64 656, !9, i64 664, !9, i64 672, !9, i64 680, !9, i64 688, !9, i64 696, !9, i64 704, !9, i64 712, !9, i64 720, !9, i64 728, !9, i64 736, !9, i64 744}
!14 = !{!"int", !10, i64 0}
!15 = !{!"bool", !10, i64 0}
!16 = !{!"any pointer", !10, i64 0}
!17 = !{!12, !16, i64 784}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InstCombinePass,MemCpyOptPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass