; LLVM IR from flashlight/flashlight :: flashlight/fl/tensor/backend/jit/eval (Evaluator)

; 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.std::vector.109" = type { %"struct.std::_Vector_base.110" }
%"struct.std::_Vector_base.110" = type { %"struct.std::_Vector_base<fl::Index, std::allocator<fl::Index>>::_Vector_impl" }
%"struct.std::_Vector_base<fl::Index, std::allocator<fl::Index>>::_Vector_impl" = type { %"struct.std::_Vector_base<fl::Index, std::allocator<fl::Index>>::_Vector_impl_data" }
%"struct.std::_Vector_base<fl::Index, std::allocator<fl::Index>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.114" = type { ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"struct.fl::Index" = type { i32, [4 x i8], %"class.std::variant.115" }
%"class.std::variant.115" = type { %"struct.std::__detail::__variant::_Variant_base.base.132", [7 x i8] }
%"struct.std::__detail::__variant::_Variant_base.base.132" = type { %"struct.std::__detail::__variant::_Move_assign_base.base.131" }
%"struct.std::__detail::__variant::_Move_assign_base.base.131" = type { %"struct.std::__detail::__variant::_Copy_assign_base.base.130" }
%"struct.std::__detail::__variant::_Copy_assign_base.base.130" = type { %"struct.std::__detail::__variant::_Move_ctor_base.base.129" }
%"struct.std::__detail::__variant::_Move_ctor_base.base.129" = type { %"struct.std::__detail::__variant::_Copy_ctor_base.base.128" }
%"struct.std::__detail::__variant::_Copy_ctor_base.base.128" = type { %"struct.std::__detail::__variant::_Variant_storage.base.127" }
%"struct.std::__detail::__variant::_Variant_storage.base.127" = type <{ %"union.std::__detail::__variant::_Variadic_union.122", i8 }>
%"union.std::__detail::__variant::_Variadic_union.122" = type { %"union.std::__detail::__variant::_Variadic_union.123" }
%"union.std::__detail::__variant::_Variadic_union.123" = type { %"struct.std::__detail::__variant::_Uninitialized.124" }
%"struct.std::__detail::__variant::_Uninitialized.124" = type { %"class.fl::range" }
%"class.fl::range" = type { i64, %"class.std::optional", i64 }
%"class.std::optional" = type { %"struct.std::_Optional_base" }
%"struct.std::_Optional_base" = type { %"struct.std::_Optional_payload" }
%"struct.std::_Optional_payload" = type { %"struct.std::_Optional_payload_base.base", [7 x i8] }
%"struct.std::_Optional_payload_base.base" = type <{ %"union.std::_Optional_payload_base<long long>::_Storage", i8 }>
%"union.std::_Optional_payload_base<long long>::_Storage" = type { i64 }

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN2fl4NodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) #1 align 2

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZNK2fl4Node9getResultEv(ptr noundef nonnull align 8 dereferenceable(152)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNKRSt8optionalIN2fl6TensorEE5valueEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2fl9Evaluator21unwrapTensorInIndicesERKSt6vectorINS_5IndexESaIS2_EE(ptr dead_on_unwind noalias writable sret(%"class.std::vector.109") align 8 %0, ptr noundef nonnull align 8 dereferenceable(152) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i1, align 1
  %8 = alloca ptr, align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.114", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.114", align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::shared_ptr", align 8
  %15 = alloca %"struct.fl::Index", align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %16 = load ptr, ptr %5, align 8
  store i1 false, ptr %7, align 1
  call void @_ZNSt6vectorIN2fl5IndexESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %17, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %18 = load ptr, ptr %8, align 8, !tbaa !5
  %19 = call ptr @_ZNKSt6vectorIN2fl5IndexESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #5
  %20 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.114", ptr %9, i32 0, i32 0
  store ptr %19, ptr %20, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = call ptr @_ZNKSt6vectorIN2fl5IndexESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  %23 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.114", ptr %10, i32 0, i32 0
  store ptr %22, ptr %23, align 8
  br label %24

24:                                               ; preds = %69, %3
  %25 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN2fl5IndexESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  br i1 %25, label %27, label %26

26:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %72

27:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %28 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN2fl5IndexESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  store ptr %28, ptr %11, align 8, !tbaa !5
  %29 = load ptr, ptr %11, align 8, !tbaa !5
  %30 = invoke noundef i32 @_ZNK2fl5Index4typeEv(ptr noundef nonnull align 8 dereferenceable(48) %29)
          to label %31 unwind label %47

31:                                               ; preds = %27
  %32 = icmp eq i32 %30, 0
  br i1 %32, label %33, label %65

33:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #5
  %34 = load ptr, ptr %11, align 8, !tbaa !5
  %35 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK2fl5Index3getINS_6TensorEEERKT_v(ptr noundef nonnull align 8 dereferenceable(48) %34)
          to label %36 unwind label %51

36:                                               ; preds = %33
  %37 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN2fl15toJitTensorBaseERKNS_6TensorE(ptr noundef nonnull align 8 dereferenceable(16) %35)
          to label %38 unwind label %51

38:                                               ; preds = %36
  invoke void @_ZNK2fl13JitTensorBase4nodeEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %14, ptr noundef nonnull align 8 dereferenceable(24) %37)
          to label %39 unwind label %51

39:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 48, ptr %15) #5
  %40 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN2fl4NodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %14) #5
  %41 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK2fl4Node9getResultEv(ptr noundef nonnull align 8 dereferenceable(152) %40)
          to label %42 unwind label %55

42:                                               ; preds = %39
  %43 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNKRSt8optionalIN2fl6TensorEE5valueEv(ptr noundef nonnull align 8 dereferenceable(24) %41)
          to label %44 unwind label %55

44:                                               ; preds = %42
  invoke void @_ZN2fl5IndexC1ERKNS_6TensorE(ptr noundef nonnull align 8 dereferenceable(48) %15, ptr noundef nonnull align 8 dereferenceable(16) %43)
          to label %45 unwind label %55

45:                                               ; preds = %44
  invoke void @_ZNSt6vectorIN2fl5IndexESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(48) %15)
          to label %46 unwind label %59

46:                                               ; preds = %45
  call void @_ZN2fl5IndexD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %15) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %15) #5
  call void @_ZNSt12__shared_ptrIN2fl4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #5
  br label %68

47:                                               ; preds = %65, %27
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %12, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %13, align 4
  br label %71

51:                                               ; preds = %38, %36, %33
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %12, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %13, align 4
  br label %64

55:                                               ; preds = %44, %42, %39
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %12, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %13, align 4
  br label %63

59:                                               ; preds = %45
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %12, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %13, align 4
  call void @_ZN2fl5IndexD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %15) #5
  br label %63

63:                                               ; preds = %59, %55
  call void @llvm.lifetime.end.p0(i64 48, ptr %15) #5
  call void @_ZNSt12__shared_ptrIN2fl4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #5
  br label %64

64:                                               ; preds = %63, %51
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #5
  br label %71

65:                                               ; preds = %31
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIN2fl5IndexESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(48) %66)
          to label %67 unwind label %47

67:                                               ; preds = %65
  br label %68

68:                                               ; preds = %67, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %69

69:                                               ; preds = %68
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN2fl5IndexESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  br label %24

71:                                               ; preds = %64, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @_ZNSt6vectorIN2fl5IndexESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %76

72:                                               ; preds = %26
  store i1 true, ptr %7, align 1
  %73 = load i1, ptr %7, align 1
  br i1 %73, label %75, label %74

74:                                               ; preds = %72
  call void @_ZNSt6vectorIN2fl5IndexESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %75

75:                                               ; preds = %74, %72
  ret void

76:                                               ; preds = %71
  %77 = load ptr, ptr %12, align 8
  %78 = load i32, ptr %13, align 4
  %79 = insertvalue { ptr, i32 } poison, ptr %77, 0
  %80 = insertvalue { ptr, i32 } %79, i32 %78, 1
  resume { ptr, i32 } %80
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt6vectorIN2fl5IndexESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt6vectorIN2fl5IndexESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKN2fl5IndexESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN2fl5IndexESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

declare noundef i32 @_ZNK2fl5Index4typeEv(ptr noundef nonnull align 8 dereferenceable(48)) #2

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN2fl15toJitTensorBaseERKNS_6TensorE(ptr noundef nonnull align 8 dereferenceable(16)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK2fl5Index3getINS_6TensorEEERKT_v(ptr noundef nonnull align 8 dereferenceable(48)) #3 align 2

declare void @_ZNK2fl13JitTensorBase4nodeEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8, ptr noundef nonnull align 8 dereferenceable(24)) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN2fl5IndexESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(48)) #3 align 2

declare void @_ZN2fl5IndexC1ERKNS_6TensorE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN2fl5IndexD2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN2fl5IndexESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(48)) #3 align 2

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

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

attributes #0 = { nocallback nofree nosync 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 = { "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 = { 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 #4 = { inlinehint 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 #5 = { 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"}


; 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.std::vector.109" = type { %"struct.std::_Vector_base.110" }
%"struct.std::_Vector_base.110" = type { %"struct.std::_Vector_base<fl::Index, std::allocator<fl::Index>>::_Vector_impl" }
%"struct.std::_Vector_base<fl::Index, std::allocator<fl::Index>>::_Vector_impl" = type { %"struct.std::_Vector_base<fl::Index, std::allocator<fl::Index>>::_Vector_impl_data" }
%"struct.std::_Vector_base<fl::Index, std::allocator<fl::Index>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.114" = type { ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"struct.fl::Index" = type { i32, [4 x i8], %"class.std::variant.115" }
%"class.std::variant.115" = type { %"struct.std::__detail::__variant::_Variant_base.base.132", [7 x i8] }
%"struct.std::__detail::__variant::_Variant_base.base.132" = type { %"struct.std::__detail::__variant::_Move_assign_base.base.131" }
%"struct.std::__detail::__variant::_Move_assign_base.base.131" = type { %"struct.std::__detail::__variant::_Copy_assign_base.base.130" }
%"struct.std::__detail::__variant::_Copy_assign_base.base.130" = type { %"struct.std::__detail::__variant::_Move_ctor_base.base.129" }
%"struct.std::__detail::__variant::_Move_ctor_base.base.129" = type { %"struct.std::__detail::__variant::_Copy_ctor_base.base.128" }
%"struct.std::__detail::__variant::_Copy_ctor_base.base.128" = type { %"struct.std::__detail::__variant::_Variant_storage.base.127" }
%"struct.std::__detail::__variant::_Variant_storage.base.127" = type <{ %"union.std::__detail::__variant::_Variadic_union.122", i8 }>
%"union.std::__detail::__variant::_Variadic_union.122" = type { %"union.std::__detail::__variant::_Variadic_union.123" }
%"union.std::__detail::__variant::_Variadic_union.123" = type { %"struct.std::__detail::__variant::_Uninitialized.124" }
%"struct.std::__detail::__variant::_Uninitialized.124" = type { %"class.fl::range" }
%"class.fl::range" = type { i64, %"class.std::optional", i64 }
%"class.std::optional" = type { %"struct.std::_Optional_base" }
%"struct.std::_Optional_base" = type { %"struct.std::_Optional_payload" }
%"struct.std::_Optional_payload" = type { %"struct.std::_Optional_payload_base.base", [7 x i8] }
%"struct.std::_Optional_payload_base.base" = type <{ %"union.std::_Optional_payload_base<long long>::_Storage", i8 }>
%"union.std::_Optional_payload_base<long long>::_Storage" = type { i64 }

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN2fl4NodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1 align 2

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZNK2fl4Node9getResultEv(ptr noundef nonnull align 8 dereferenceable(152)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNKRSt8optionalIN2fl6TensorEE5valueEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2fl9Evaluator21unwrapTensorInIndicesERKSt6vectorINS_5IndexESaIS2_EE(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::vector.109") align 8 %0, ptr nocapture noundef nonnull readnone align 8 dereferenceable(152) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.__gnu_cxx::__normal_iterator.114", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.114", align 8
  %6 = alloca %"class.std::shared_ptr", align 8
  %7 = alloca %"struct.fl::Index", align 8
  tail call void @_ZNSt6vectorIN2fl5IndexESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %8 = tail call ptr @_ZNKSt6vectorIN2fl5IndexESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  store ptr %8, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %9 = tail call ptr @_ZNKSt6vectorIN2fl5IndexESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  store ptr %9, ptr %5, align 8
  %10 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN2fl5IndexESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br i1 %10, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %39, %3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  ret void

.lr.ph:                                           ; preds = %3, %39
  %11 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN2fl5IndexESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %12 = invoke noundef i32 @_ZNK2fl5Index4typeEv(ptr noundef nonnull align 8 dereferenceable(48) %11)
          to label %13 unwind label %28

13:                                               ; preds = %.lr.ph
  %14 = icmp eq i32 %12, 0
  br i1 %14, label %15, label %38

15:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %16 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK2fl5Index3getINS_6TensorEEERKT_v(ptr noundef nonnull align 8 dereferenceable(48) %11)
          to label %17 unwind label %30

17:                                               ; preds = %15
  %18 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN2fl15toJitTensorBaseERKNS_6TensorE(ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %19 unwind label %30

19:                                               ; preds = %17
  invoke void @_ZNK2fl13JitTensorBase4nodeEv(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %6, ptr noundef nonnull align 8 dereferenceable(24) %18)
          to label %20 unwind label %30

20:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #5
  %21 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN2fl4NodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  %22 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK2fl4Node9getResultEv(ptr noundef nonnull align 8 dereferenceable(152) %21)
          to label %23 unwind label %32

23:                                               ; preds = %20
  %24 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNKRSt8optionalIN2fl6TensorEE5valueEv(ptr noundef nonnull align 8 dereferenceable(24) %22)
          to label %25 unwind label %32

25:                                               ; preds = %23
  invoke void @_ZN2fl5IndexC1ERKNS_6TensorE(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(16) %24)
          to label %26 unwind label %32

26:                                               ; preds = %25
  invoke void @_ZNSt6vectorIN2fl5IndexESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(48) %7)
          to label %27 unwind label %34

27:                                               ; preds = %26
  call void @_ZN2fl5IndexD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #5
  call void @_ZNSt12__shared_ptrIN2fl4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  br label %39

28:                                               ; preds = %38, %.lr.ph
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %42

30:                                               ; preds = %19, %17, %15
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %37

32:                                               ; preds = %25, %23, %20
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %36

34:                                               ; preds = %26
  %35 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN2fl5IndexD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #5
  br label %36

36:                                               ; preds = %34, %32
  %.pn = phi { ptr, i32 } [ %35, %34 ], [ %33, %32 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #5
  call void @_ZNSt12__shared_ptrIN2fl4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  br label %37

37:                                               ; preds = %36, %30
  %.pn.pn = phi { ptr, i32 } [ %.pn, %36 ], [ %31, %30 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  br label %42

38:                                               ; preds = %13
  invoke void @_ZNSt6vectorIN2fl5IndexESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(48) %11)
          to label %39 unwind label %28

39:                                               ; preds = %38, %27
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN2fl5IndexESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %41 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN2fl5IndexESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br i1 %41, label %.lr.ph, label %._crit_edge

42:                                               ; preds = %37, %28
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %37 ], [ %29, %28 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @_ZNSt6vectorIN2fl5IndexESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  resume { ptr, i32 } %.pn.pn.pn
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt6vectorIN2fl5IndexESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt6vectorIN2fl5IndexESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKN2fl5IndexESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN2fl5IndexESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

declare noundef i32 @_ZNK2fl5Index4typeEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN2fl15toJitTensorBaseERKNS_6TensorE(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK2fl5Index3getINS_6TensorEEERKT_v(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #3 align 2

declare void @_ZNK2fl13JitTensorBase4nodeEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN2fl5IndexESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #3 align 2

declare void @_ZN2fl5IndexC1ERKNS_6TensorE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN2fl5IndexD2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN2fl5IndexESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN2fl5IndexESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync 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 = { "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 = { 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 #4 = { inlinehint 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 #5 = { 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)"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass