; LLVM IR from sfu-dis/mosaicdb :: benchmarks/egen/EGenGenerateAndLoad.ll (ZN4TPCE16CGenerateAndLoad19InitHoldingAndTradeEv)

; 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.TPCE::CInputFiles" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%"class.TPCE::CGenerateAndLoad" = type { %"class.TPCE::CInputFiles", i64, i64, i64, i32, i32, i32, ptr, ptr, [512 x i8], ptr, %"class.TPCE::CLoaderSettings", i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%"class.TPCE::CLoaderSettings" = type { %"class.TPCE::CParametersWithDefaults" }
%"class.TPCE::CParametersWithDefaults" = type { ptr, %"struct.TPCE::TLoaderSettings", %"struct.TPCE::TLoaderSettingsState", %"struct.TPCE::TLoaderSettings" }
%"struct.TPCE::TLoaderSettingsState" = type { i8, i8, i8, i8, i8, i8 }
%"struct.TPCE::TLoaderSettings" = type { i64, i64, i32, i32, i64, i64 }

@.str.27 = external hidden unnamed_addr constant [35 x i8], align 1

; 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) #0

declare i32 @__gxx_personality_v0(...)

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

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

declare void @_ZN4TPCE9CTradeGenC1ENS_11CInputFilesExxxjjjb(ptr noundef nonnull align 8 dereferenceable(7356), ptr noundef, i64 noundef, i64 noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i1 noundef zeroext) unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4TPCE16CGenerateAndLoad19InitHoldingAndTradeEv(ptr noundef nonnull align 8 dereferenceable(1040) %0) #5 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.TPCE::CInputFiles", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i1, align 1
  store ptr %0, ptr %2, align 8, !tbaa !5
  %7 = load ptr, ptr %2, align 8
  %8 = getelementptr inbounds %"class.TPCE::CGenerateAndLoad", ptr %7, i32 0, i32 3
  %9 = load i64, ptr %8, align 8, !tbaa !9
  %10 = getelementptr inbounds %"class.TPCE::CGenerateAndLoad", ptr %7, i32 0, i32 4
  %11 = load i32, ptr %10, align 8, !tbaa !19
  %12 = call i32 (ptr, ...) @printf(ptr noundef @.str.27, i64 noundef %9, i32 noundef %11)
  %13 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 7360) #6
  store i1 true, ptr %6, align 1
  %14 = getelementptr inbounds %"class.TPCE::CGenerateAndLoad", ptr %7, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %3, ptr align 8 %14, i64 184, i1 false), !tbaa.struct !20
  %15 = getelementptr inbounds %"class.TPCE::CGenerateAndLoad", ptr %7, i32 0, i32 2
  %16 = load i64, ptr %15, align 8, !tbaa !21
  %17 = getelementptr inbounds %"class.TPCE::CGenerateAndLoad", ptr %7, i32 0, i32 1
  %18 = load i64, ptr %17, align 8, !tbaa !22
  %19 = getelementptr inbounds %"class.TPCE::CGenerateAndLoad", ptr %7, i32 0, i32 3
  %20 = load i64, ptr %19, align 8, !tbaa !9
  %21 = getelementptr inbounds %"class.TPCE::CGenerateAndLoad", ptr %7, i32 0, i32 4
  %22 = load i32, ptr %21, align 8, !tbaa !19
  %23 = getelementptr inbounds %"class.TPCE::CGenerateAndLoad", ptr %7, i32 0, i32 5
  %24 = load i32, ptr %23, align 4, !tbaa !23
  %25 = getelementptr inbounds %"class.TPCE::CGenerateAndLoad", ptr %7, i32 0, i32 6
  %26 = load i32, ptr %25, align 8, !tbaa !24
  invoke void @_ZN4TPCE9CTradeGenC1ENS_11CInputFilesExxxjjjb(ptr noundef nonnull align 8 dereferenceable(7356) %13, ptr noundef %3, i64 noundef %16, i64 noundef %18, i64 noundef %20, i32 noundef %22, i32 noundef %24, i32 noundef %26, i1 noundef zeroext false)
          to label %27 unwind label %29

27:                                               ; preds = %1
  store i1 false, ptr %6, align 1
  %28 = getelementptr inbounds %"class.TPCE::CGenerateAndLoad", ptr %7, i32 0, i32 34
  store ptr %13, ptr %28, align 8, !tbaa !25
  call void @_ZN4TPCE11CInputFilesD2Ev(ptr noundef nonnull align 8 dereferenceable(184) %3) #7
  ret void

29:                                               ; preds = %1
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %4, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %5, align 4
  call void @_ZN4TPCE11CInputFilesD2Ev(ptr noundef nonnull align 8 dereferenceable(184) %3) #7
  %33 = load i1, ptr %6, align 1
  br i1 %33, label %34, label %35

34:                                               ; preds = %29
  call void @_ZdlPvm(ptr noundef %13, i64 noundef 7360) #8
  br label %35

35:                                               ; preds = %34, %29
  br label %36

36:                                               ; preds = %35
  %37 = load ptr, ptr %4, align 8
  %38 = load i32, ptr %5, align 4
  %39 = insertvalue { ptr, i32 } poison, ptr %37, 0
  %40 = insertvalue { ptr, i32 } %39, i32 %38, 1
  resume { ptr, i32 } %40
}

declare i32 @printf(ptr noundef, ...) #3

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #6 = { builtin allocsize(0) }
attributes #7 = { nounwind }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 200}
!10 = !{!"_ZTSN4TPCE16CGenerateAndLoadE", !11, i64 0, !12, i64 184, !12, i64 192, !12, i64 200, !13, i64 208, !13, i64 212, !13, i64 216, !6, i64 224, !6, i64 232, !7, i64 240, !6, i64 752, !14, i64 760, !18, i64 856, !6, i64 864, !6, i64 872, !6, i64 880, !6, i64 888, !6, i64 896, !6, i64 904, !6, i64 912, !6, i64 920, !6, i64 928, !6, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !6, i64 968, !6, i64 976, !6, i64 984, !6, i64 992, !6, i64 1000, !6, i64 1008, !6, i64 1016, !6, i64 1024, !6, i64 1032}
!11 = !{!"_ZTSN4TPCE11CInputFilesE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSN4TPCE15CLoaderSettingsE", !15, i64 0}
!15 = !{!"_ZTSN4TPCE23CParametersWithDefaultsINS_15TLoaderSettingsENS_20TLoaderSettingsStateEEE", !16, i64 8, !17, i64 48, !16, i64 56}
!16 = !{!"_ZTSN4TPCE15TLoaderSettingsE", !12, i64 0, !12, i64 8, !13, i64 16, !13, i64 20, !12, i64 24, !12, i64 32}
!17 = !{!"_ZTSN4TPCE20TLoaderSettingsStateE", !18, i64 0, !18, i64 1, !18, i64 2, !18, i64 3, !18, i64 4, !18, i64 5}
!18 = !{!"bool", !7, i64 0}
!19 = !{!10, !13, i64 208}
!20 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 8, !5, i64 24, i64 8, !5, i64 32, i64 8, !5, i64 40, i64 8, !5, i64 48, i64 8, !5, i64 56, i64 8, !5, i64 64, i64 8, !5, i64 72, i64 8, !5, i64 80, i64 8, !5, i64 88, i64 8, !5, i64 96, i64 8, !5, i64 104, i64 8, !5, i64 112, i64 8, !5, i64 120, i64 8, !5, i64 128, i64 8, !5, i64 136, i64 8, !5, i64 144, i64 8, !5, i64 152, i64 8, !5, i64 160, i64 8, !5, i64 168, i64 8, !5, i64 176, i64 8, !5}
!21 = !{!10, !12, i64 192}
!22 = !{!10, !12, i64 184}
!23 = !{!10, !13, i64 212}
!24 = !{!10, !13, i64 216}
!25 = !{!10, !6, i64 1032}


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

%"class.TPCE::CInputFiles" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str.27 = external hidden unnamed_addr constant [35 x i8], align 1

; 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) #0

declare i32 @__gxx_personality_v0(...)

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

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

declare void @_ZN4TPCE9CTradeGenC1ENS_11CInputFilesExxxjjjb(ptr noundef nonnull align 8 dereferenceable(7356), ptr noundef, i64 noundef, i64 noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i1 noundef zeroext) unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4TPCE16CGenerateAndLoad19InitHoldingAndTradeEv(ptr nocapture noundef nonnull align 8 dereferenceable(1040) %0) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.TPCE::CInputFiles", align 8
  %3 = getelementptr inbounds i8, ptr %0, i64 200
  %4 = load i64, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 208
  %6 = load i32, ptr %5, align 8, !tbaa !18
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27, i64 noundef %4, i32 noundef %6)
  %8 = tail call noalias noundef nonnull dereferenceable(7360) ptr @_Znwm(i64 noundef 7360) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(184) %2, ptr noundef nonnull align 8 dereferenceable(184) %0, i64 184, i1 false), !tbaa.struct !19
  %9 = getelementptr inbounds i8, ptr %0, i64 192
  %10 = load i64, ptr %9, align 8, !tbaa !21
  %11 = getelementptr inbounds i8, ptr %0, i64 184
  %12 = load i64, ptr %11, align 8, !tbaa !22
  %13 = load i64, ptr %3, align 8, !tbaa !5
  %14 = load i32, ptr %5, align 8, !tbaa !18
  %15 = getelementptr inbounds i8, ptr %0, i64 212
  %16 = load i32, ptr %15, align 4, !tbaa !23
  %17 = getelementptr inbounds i8, ptr %0, i64 216
  %18 = load i32, ptr %17, align 8, !tbaa !24
  invoke void @_ZN4TPCE9CTradeGenC1ENS_11CInputFilesExxxjjjb(ptr noundef nonnull align 8 dereferenceable(7356) %8, ptr noundef nonnull %2, i64 noundef %10, i64 noundef %12, i64 noundef %13, i32 noundef %14, i32 noundef %16, i32 noundef %18, i1 noundef zeroext false)
          to label %19 unwind label %21

19:                                               ; preds = %1
  %20 = getelementptr inbounds i8, ptr %0, i64 1032
  store ptr %8, ptr %20, align 8, !tbaa !25
  call void @_ZN4TPCE11CInputFilesD2Ev(ptr noundef nonnull align 8 dereferenceable(184) %2) #8
  ret void

21:                                               ; preds = %1
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4TPCE11CInputFilesD2Ev(ptr noundef nonnull align 8 dereferenceable(184) %2) #8
  call void @_ZdlPvm(ptr noundef nonnull %8, i64 noundef 7360) #9
  resume { ptr, i32 } %22
}

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #6 = { nofree 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 #7 = { builtin allocsize(0) }
attributes #8 = { nounwind }
attributes #9 = { 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, !11, i64 200}
!6 = !{!"_ZTSN4TPCE16CGenerateAndLoadE", !7, i64 0, !11, i64 184, !11, i64 192, !11, i64 200, !12, i64 208, !12, i64 212, !12, i64 216, !8, i64 224, !8, i64 232, !9, i64 240, !8, i64 752, !13, i64 760, !17, i64 856, !8, i64 864, !8, i64 872, !8, i64 880, !8, i64 888, !8, i64 896, !8, i64 904, !8, i64 912, !8, i64 920, !8, i64 928, !8, i64 936, !8, i64 944, !8, i64 952, !8, i64 960, !8, i64 968, !8, i64 976, !8, i64 984, !8, i64 992, !8, i64 1000, !8, i64 1008, !8, i64 1016, !8, i64 1024, !8, i64 1032}
!7 = !{!"_ZTSN4TPCE11CInputFilesE", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !8, i64 48, !8, i64 56, !8, i64 64, !8, i64 72, !8, i64 80, !8, i64 88, !8, i64 96, !8, i64 104, !8, i64 112, !8, i64 120, !8, i64 128, !8, i64 136, !8, i64 144, !8, i64 152, !8, i64 160, !8, i64 168, !8, i64 176}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"long long", !9, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = !{!"_ZTSN4TPCE15CLoaderSettingsE", !14, i64 0}
!14 = !{!"_ZTSN4TPCE23CParametersWithDefaultsINS_15TLoaderSettingsENS_20TLoaderSettingsStateEEE", !15, i64 8, !16, i64 48, !15, i64 56}
!15 = !{!"_ZTSN4TPCE15TLoaderSettingsE", !11, i64 0, !11, i64 8, !12, i64 16, !12, i64 20, !11, i64 24, !11, i64 32}
!16 = !{!"_ZTSN4TPCE20TLoaderSettingsStateE", !17, i64 0, !17, i64 1, !17, i64 2, !17, i64 3, !17, i64 4, !17, i64 5}
!17 = !{!"bool", !9, i64 0}
!18 = !{!6, !12, i64 208}
!19 = !{i64 0, i64 8, !20, i64 8, i64 8, !20, i64 16, i64 8, !20, i64 24, i64 8, !20, i64 32, i64 8, !20, i64 40, i64 8, !20, i64 48, i64 8, !20, i64 56, i64 8, !20, i64 64, i64 8, !20, i64 72, i64 8, !20, i64 80, i64 8, !20, i64 88, i64 8, !20, i64 96, i64 8, !20, i64 104, i64 8, !20, i64 112, i64 8, !20, i64 120, i64 8, !20, i64 128, i64 8, !20, i64 136, i64 8, !20, i64 144, i64 8, !20, i64 152, i64 8, !20, i64 160, i64 8, !20, i64 168, i64 8, !20, i64 176, i64 8, !20}
!20 = !{!8, !8, i64 0}
!21 = !{!6, !11, i64 192}
!22 = !{!6, !11, i64 184}
!23 = !{!6, !12, i64 212}
!24 = !{!6, !12, i64 216}
!25 = !{!6, !8, i64 1032}


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