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

; 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 nounwind uwtable
declare dso_local void @_ZN9TInitInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(752)) unnamed_addr #0 align 2

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

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

declare i32 @__gxx_personality_v0(...)

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

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

22:                                               ; preds = %2
  %23 = getelementptr inbounds %class.COrgan, ptr %7, i32 0, i32 5
  store ptr %21, ptr %23, align 8, !tbaa !30
  %24 = getelementptr inbounds %class.COrgan, ptr %7, i32 0, i32 13
  store double 0.000000e+00, ptr %24, align 8, !tbaa !31
  %25 = getelementptr inbounds %class.COrgan, ptr %7, i32 0, i32 14
  store double 0.000000e+00, ptr %25, align 8, !tbaa !32
  ret void

26:                                               ; preds = %2
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %5, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %6, align 4
  call void @_ZdlPvm(ptr noundef %21, i64 noundef 72) #7
  br label %30

30:                                               ; preds = %26
  %31 = load ptr, ptr %5, align 8
  %32 = load i32, ptr %6, align 4
  %33 = insertvalue { ptr, i32 } poison, ptr %31, 0
  %34 = insertvalue { ptr, i32 } %33, i32 %32, 1
  resume { ptr, i32 } %34
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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 = { 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 #2 = { "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 = { 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 #4 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"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 = !{i64 0, i64 255, !12, i64 255, i64 255, !12, i64 512, i64 4, !13, i64 516, i64 4, !13, i64 520, i64 8, !15, i64 528, i64 8, !15, i64 536, i64 8, !15, i64 544, i64 8, !15, i64 552, i64 4, !13, i64 556, i64 4, !13, i64 560, i64 4, !13, i64 568, i64 8, !15, i64 576, i64 4, !13, i64 584, i64 8, !15, i64 592, i64 1, !17, i64 600, i64 8, !15, i64 608, i64 8, !15, i64 616, i64 8, !15, i64 624, i64 8, !15, i64 632, i64 8, !15, i64 640, i64 8, !15, i64 648, i64 8, !15, i64 656, i64 8, !15, i64 664, i64 8, !15, i64 672, i64 8, !15, i64 680, i64 8, !15, i64 688, i64 8, !15, i64 696, i64 8, !15, i64 704, i64 8, !15, i64 712, i64 8, !15, i64 720, i64 8, !15, i64 728, i64 8, !15, i64 736, i64 8, !15, i64 744, i64 8, !15}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!20, !16, i64 824}
!20 = !{!"_ZTS6COrgan", !16, i64 8, !16, i64 16, !21, i64 24, !6, i64 776, !6, i64 784, !16, i64 792, !16, i64 800, !16, i64 808, !16, i64 816, !16, i64 824, !16, i64 832, !16, i64 840, !16, i64 848, !16, i64 856}
!21 = !{!"_ZTS9TInitInfo", !7, i64 0, !7, i64 255, !14, i64 512, !14, i64 516, !16, i64 520, !16, i64 528, !16, i64 536, !16, i64 544, !14, i64 552, !14, i64 556, !14, i64 560, !16, i64 568, !14, i64 576, !16, i64 584, !18, i64 592, !16, i64 600, !16, i64 608, !16, i64 616, !16, i64 624, !16, i64 632, !16, i64 640, !16, i64 648, !16, i64 656, !16, i64 664, !16, i64 672, !16, i64 680, !16, i64 688, !16, i64 696, !16, i64 704, !16, i64 712, !16, i64 720, !16, i64 728, !16, i64 736, !16, i64 744}
!22 = !{!20, !16, i64 16}
!23 = !{!20, !16, i64 816}
!24 = !{!20, !16, i64 8}
!25 = !{!20, !16, i64 808}
!26 = !{!20, !16, i64 800}
!27 = !{!20, !16, i64 792}
!28 = !{!20, !16, i64 840}
!29 = !{!20, !16, i64 832}
!30 = !{!20, !6, i64 784}
!31 = !{!20, !16, i64 848}
!32 = !{!20, !16, 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 nounwind uwtable
declare dso_local void @_ZN9TInitInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(752)) unnamed_addr #0 align 2

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6COrganC2ERK9TInitInfo(ptr noundef nonnull align 8 dereferenceable(864) %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(752) %1) unnamed_addr #4 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
  %3 = getelementptr inbounds i8, ptr %0, i64 24
  tail call void @_ZN9TInitInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(752) %3)
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(752) %3, ptr noundef nonnull align 8 dereferenceable(752) %1, i64 752, i1 false), !tbaa.struct !8
  %4 = getelementptr inbounds i8, ptr %0, i64 816
  store <2 x double> <double 0.000000e+00, double 2.500000e+01>, ptr %4, align 8, !tbaa !13
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  store <2 x double> <double 4.000000e-01, double 0.000000e+00>, ptr %5, align 8, !tbaa !13
  %6 = getelementptr inbounds i8, ptr %0, i64 792
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %6, i8 0, i64 24, i1 false)
  %7 = getelementptr inbounds i8, ptr %0, i64 832
  store <2 x double> <double 5.000000e+01, double 1.000000e+01>, ptr %7, align 8, !tbaa !13
  %8 = getelementptr inbounds i8, ptr %0, i64 784
  store ptr null, ptr %8, align 8, !tbaa !17
  %9 = tail call noalias noundef nonnull dereferenceable(72) ptr @_Znwm(i64 noundef 72) #7
  invoke void @_ZN12CThermalTimeC1Ev(ptr noundef nonnull align 8 dereferenceable(72) %9)
          to label %10 unwind label %12

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

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


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