; LLVM IR from apple/turicreate :: src/external/boost/boost_1_68_0/libs/hana/example/lazy (functor)

; 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.boost::hana::transform_t" = type { i8 }
%"struct.boost::hana::make_t" = type { i8 }
%"struct.boost::hana::lazy_apply_t.1" = type { %"struct.boost::hana::basic_tuple.2" }
%"struct.boost::hana::basic_tuple.2" = type { %"struct.boost::hana::detail::basic_tuple_impl.3" }
%"struct.boost::hana::detail::basic_tuple_impl.3" = type { %"struct._hana::ebo.4", %"struct._hana::ebo.5" }
%"struct._hana::ebo.4" = type { %"struct.boost::hana::placeholder_detail::divide_left" }
%"struct.boost::hana::placeholder_detail::divide_left" = type { i32 }
%"struct._hana::ebo.5" = type { i32 }
%"struct.boost::hana::lazy_value_t" = type { %"struct.boost::hana::basic_tuple.6" }
%"struct.boost::hana::basic_tuple.6" = type { %"struct.boost::hana::detail::basic_tuple_impl.7" }
%"struct.boost::hana::detail::basic_tuple_impl.7" = type { %"struct._hana::ebo.4" }
%"struct.boost::hana::placeholder_detail::placeholder" = type { i8 }
%"struct.boost::hana::placeholder_detail::times_right" = type { i32 }
%"struct.boost::hana::lazy_apply_t" = type { %"struct.boost::hana::basic_tuple" }
%"struct.boost::hana::basic_tuple" = type { %"struct.boost::hana::detail::basic_tuple_impl" }
%"struct.boost::hana::detail::basic_tuple_impl" = type { %"struct._hana::ebo", %"struct._hana::ebo.0" }
%"struct._hana::ebo" = type { %"struct.boost::hana::_compose" }
%"struct.boost::hana::_compose" = type { %"struct.boost::hana::placeholder_detail::times_right", [4 x i8] }
%"struct._hana::ebo.0" = type { %"struct.boost::hana::lazy_apply_t.1" }

@_ZN5boost4hanaL9transformE = external hidden constant %"struct.boost::hana::transform_t", align 1
@_ZN5boost4hanaL9make_lazyE = external hidden constant %"struct.boost::hana::make_t", align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca %"struct.boost::hana::lazy_apply_t.1", align 4
  %2 = alloca %"struct.boost::hana::lazy_value_t", align 4
  %3 = alloca %"struct.boost::hana::placeholder_detail::divide_left", align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.boost::hana::placeholder_detail::placeholder", align 1
  %6 = alloca i32, align 4
  %7 = alloca %"struct.boost::hana::placeholder_detail::times_right", align 4
  %8 = alloca %"struct.boost::hana::placeholder_detail::placeholder", align 1
  %9 = alloca i32, align 4
  %10 = alloca %"struct.boost::hana::lazy_apply_t", align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 4, ptr %4, align 4, !tbaa !5
  %11 = call i32 @_ZN5boost4hana18placeholder_detaildvIiEEDcOT_NS1_11placeholderE(ptr noundef nonnull align 4 dereferenceable(4) %4)
  %12 = getelementptr inbounds %"struct.boost::hana::placeholder_detail::divide_left", ptr %3, i32 0, i32 0
  store i32 %11, ptr %12, align 4
  %13 = call i32 @_ZNK5boost4hana6make_tINS0_8lazy_tagEEclIJNS0_18placeholder_detail11divide_leftIiEEEEEDcDpOT_(ptr noundef nonnull align 1 dereferenceable(1) @_ZN5boost4hanaL9make_lazyE, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %14 = getelementptr inbounds %"struct.boost::hana::lazy_value_t", ptr %2, i32 0, i32 0
  %15 = getelementptr inbounds %"struct.boost::hana::basic_tuple.6", ptr %14, i32 0, i32 0
  %16 = getelementptr inbounds %"struct.boost::hana::detail::basic_tuple_impl.7", ptr %15, i32 0, i32 0
  %17 = getelementptr inbounds %"struct._hana::ebo.4", ptr %16, i32 0, i32 0
  %18 = getelementptr inbounds %"struct.boost::hana::placeholder_detail::divide_left", ptr %17, i32 0, i32 0
  store i32 %13, ptr %18, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 0, ptr %6, align 4, !tbaa !5
  %19 = call i64 @_ZNO5boost4hana12lazy_value_tINS0_18placeholder_detail11divide_leftIiEEEclIJiEEENS0_12lazy_apply_tI18__make_integer_seqISt16integer_sequencemXsZT_EES4_JDpNS0_6detail5decayIT_NSt16remove_referenceISD_E4typeEE4typeEEEEDpOSD_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %20 = getelementptr inbounds %"struct.boost::hana::lazy_apply_t.1", ptr %1, i32 0, i32 0
  %21 = getelementptr inbounds %"struct.boost::hana::basic_tuple.2", ptr %20, i32 0, i32 0
  store i64 %19, ptr %21, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 3, ptr %9, align 4, !tbaa !5
  %22 = call i32 @_ZN5boost4hana18placeholder_detailmlIiEEDcNS1_11placeholderEOT_(ptr noundef nonnull align 4 dereferenceable(4) %9)
  %23 = getelementptr inbounds %"struct.boost::hana::placeholder_detail::times_right", ptr %7, i32 0, i32 0
  store i32 %22, ptr %23, align 4
  %24 = call { i32, i64 } @_ZNK5boost4hana11transform_tclINS0_12lazy_apply_tISt16integer_sequenceImJLm0EEENS0_18placeholder_detail11divide_leftIiEEJiEEENS6_11times_rightIiEEEEDaOT_OT0_(ptr noundef nonnull align 1 dereferenceable(1) @_ZN5boost4hanaL9transformE, ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %25 = getelementptr inbounds %"struct.boost::hana::lazy_apply_t", ptr %10, i32 0, i32 0
  %26 = getelementptr inbounds %"struct.boost::hana::basic_tuple", ptr %25, i32 0, i32 0
  %27 = getelementptr inbounds { i32, i64 }, ptr %26, i32 0, i32 0
  %28 = extractvalue { i32, i64 } %24, 0
  store i32 %28, ptr %27, align 4
  %29 = getelementptr inbounds { i32, i64 }, ptr %26, i32 0, i32 1
  %30 = extractvalue { i32, i64 } %24, 1
  store i64 %30, ptr %29, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #3
  ret i32 0
}

; Function Attrs: mustprogress uwtable
declare dso_local { i32, i64 } @_ZNK5boost4hana11transform_tclINS0_12lazy_apply_tISt16integer_sequenceImJLm0EEENS0_18placeholder_detail11divide_leftIiEEJiEEENS6_11times_rightIiEEEEDaOT_OT0_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZNK5boost4hana6make_tINS0_8lazy_tagEEclIJNS0_18placeholder_detail11divide_leftIiEEEEEDcDpOT_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZN5boost4hana18placeholder_detaildvIiEEDcOT_NS1_11placeholderE(ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNO5boost4hana12lazy_value_tINS0_18placeholder_detail11divide_leftIiEEEclIJiEEENS0_12lazy_apply_tI18__make_integer_seqISt16integer_sequencemXsZT_EES4_JDpNS0_6detail5decayIT_NSt16remove_referenceISD_E4typeEE4typeEEEEDpOSD_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZN5boost4hana18placeholder_detailmlIiEEDcNS1_11placeholderEOT_(ptr noundef nonnull align 4 dereferenceable(4)) #1

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

attributes #0 = { mustprogress norecurse 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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; 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.boost::hana::transform_t" = type { i8 }
%"struct.boost::hana::make_t" = type { i8 }
%"struct.boost::hana::lazy_apply_t.1" = type { %"struct.boost::hana::basic_tuple.2" }
%"struct.boost::hana::basic_tuple.2" = type { %"struct.boost::hana::detail::basic_tuple_impl.3" }
%"struct.boost::hana::detail::basic_tuple_impl.3" = type { %"struct._hana::ebo.4", %"struct._hana::ebo.5" }
%"struct._hana::ebo.4" = type { %"struct.boost::hana::placeholder_detail::divide_left" }
%"struct.boost::hana::placeholder_detail::divide_left" = type { i32 }
%"struct._hana::ebo.5" = type { i32 }
%"struct.boost::hana::lazy_value_t" = type { %"struct.boost::hana::basic_tuple.6" }
%"struct.boost::hana::basic_tuple.6" = type { %"struct.boost::hana::detail::basic_tuple_impl.7" }
%"struct.boost::hana::detail::basic_tuple_impl.7" = type { %"struct._hana::ebo.4" }
%"struct.boost::hana::placeholder_detail::times_right" = type { i32 }

@_ZN5boost4hanaL9transformE = external hidden constant %"struct.boost::hana::transform_t", align 1
@_ZN5boost4hanaL9make_lazyE = external hidden constant %"struct.boost::hana::make_t", align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %"struct.boost::hana::lazy_apply_t.1", align 8
  %2 = alloca %"struct.boost::hana::lazy_value_t", align 4
  %3 = alloca %"struct.boost::hana::placeholder_detail::divide_left", align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.boost::hana::placeholder_detail::times_right", align 4
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  store i32 4, ptr %4, align 4, !tbaa !5
  %8 = call i32 @_ZN5boost4hana18placeholder_detaildvIiEEDcOT_NS1_11placeholderE(ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i32 %8, ptr %3, align 4
  %9 = call i32 @_ZNK5boost4hana6make_tINS0_8lazy_tagEEclIJNS0_18placeholder_detail11divide_leftIiEEEEEDcDpOT_(ptr noundef nonnull align 1 dereferenceable(1) @_ZN5boost4hanaL9make_lazyE, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i32 %9, ptr %2, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  store i32 0, ptr %5, align 4, !tbaa !5
  %10 = call i64 @_ZNO5boost4hana12lazy_value_tINS0_18placeholder_detail11divide_leftIiEEEclIJiEEENS0_12lazy_apply_tI18__make_integer_seqISt16integer_sequencemXsZT_EES4_JDpNS0_6detail5decayIT_NSt16remove_referenceISD_E4typeEE4typeEEEEDpOSD_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i64 %10, ptr %1, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  store i32 3, ptr %7, align 4, !tbaa !5
  %11 = call i32 @_ZN5boost4hana18placeholder_detailmlIiEEDcNS1_11placeholderEOT_(ptr noundef nonnull align 4 dereferenceable(4) %7)
  store i32 %11, ptr %6, align 4
  %12 = call { i32, i64 } @_ZNK5boost4hana11transform_tclINS0_12lazy_apply_tISt16integer_sequenceImJLm0EEENS0_18placeholder_detail11divide_leftIiEEJiEEENS6_11times_rightIiEEEEDaOT_OT0_(ptr noundef nonnull align 1 dereferenceable(1) @_ZN5boost4hanaL9transformE, ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #3
  ret i32 0
}

; Function Attrs: mustprogress uwtable
declare dso_local { i32, i64 } @_ZNK5boost4hana11transform_tclINS0_12lazy_apply_tISt16integer_sequenceImJLm0EEENS0_18placeholder_detail11divide_leftIiEEJiEEENS6_11times_rightIiEEEEDaOT_OT0_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZNK5boost4hana6make_tINS0_8lazy_tagEEclIJNS0_18placeholder_detail11divide_leftIiEEEEEDcDpOT_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZN5boost4hana18placeholder_detaildvIiEEDcOT_NS1_11placeholderE(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNO5boost4hana12lazy_value_tINS0_18placeholder_detail11divide_leftIiEEEclIJiEEENS0_12lazy_apply_tI18__make_integer_seqISt16integer_sequencemXsZT_EES4_JDpNS0_6detail5decayIT_NSt16remove_referenceISD_E4typeEE4typeEEEEDpOSD_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZN5boost4hana18placeholder_detailmlIiEEDcNS1_11placeholderEOT_(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

attributes #0 = { mustprogress norecurse 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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass