; LLVM IR from yangfengzzz/fluid-engine-OpenVDB :: manual_tests.common/cnpy.ll (Z17load_the_npy_fileP8_IO_FILE)

; 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.cnpy::NpyArray" = type <{ ptr, %"class.std::vector.4", i32, i8, [3 x i8] }>
%"class.std::vector.4" = type { %"struct.std::_Vector_base.5" }
%"struct.std::_Vector_base.5" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.6" = type { i8 }

@_ZTISt13runtime_error = external constant ptr
@.str.11 = external hidden unnamed_addr constant [32 x i8], align 1

; 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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4cnpy16parse_npy_headerEP8_IO_FILERjRPjS2_Rb(ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(1)) #1

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

declare ptr @__cxa_allocate_exception(i64)

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

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr)

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3

declare void @__cxa_throw(ptr, ptr, ptr)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z17load_the_npy_fileP8_IO_FILE(ptr dead_on_unwind noalias writable sret(%"struct.cnpy::NpyArray") align 8 %0, ptr noundef %1) #1 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
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i1, align 1
  %12 = alloca %"class.std::vector.4", align 8
  %13 = alloca %"class.std::allocator.6", align 1
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #8
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN4cnpy16parse_npy_headerEP8_IO_FILERjRPjS2_Rb(ptr noundef %17, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 1 dereferenceable(1) %8)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  store i64 1, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %18

18:                                               ; preds = %32, %2
  %19 = load i32, ptr %10, align 4, !tbaa !11
  %20 = load i32, ptr %6, align 4, !tbaa !11
  %21 = icmp ult i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %35

23:                                               ; preds = %18
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = load i32, ptr %10, align 4, !tbaa !11
  %26 = zext i32 %25 to i64
  %27 = getelementptr inbounds i32, ptr %24, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !11
  %29 = zext i32 %28 to i64
  %30 = load i64, ptr %9, align 8, !tbaa !9
  %31 = mul i64 %30, %29
  store i64 %31, ptr %9, align 8, !tbaa !9
  br label %32

32:                                               ; preds = %23
  %33 = load i32, ptr %10, align 4, !tbaa !11
  %34 = add i32 %33, 1
  store i32 %34, ptr %10, align 4, !tbaa !11
  br label %18, !llvm.loop !13

35:                                               ; preds = %22
  store i1 false, ptr %11, align 1
  call void @_ZN4cnpy8NpyArrayC2Ev(ptr noundef nonnull align 8 dereferenceable(37) %0) #8
  %36 = load i32, ptr %7, align 4, !tbaa !11
  %37 = getelementptr inbounds %"struct.cnpy::NpyArray", ptr %0, i32 0, i32 2
  store i32 %36, ptr %37, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #8
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = load i32, ptr %6, align 4, !tbaa !11
  %41 = zext i32 %40 to i64
  %42 = getelementptr inbounds i32, ptr %39, i64 %41
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #8
  call void @_ZNSaIjEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #8
  invoke void @_ZNSt6vectorIjSaIjEEC2IPjvEET_S4_RKS0_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef %38, ptr noundef %42, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %43 unwind label %75

43:                                               ; preds = %35
  %44 = getelementptr inbounds %"struct.cnpy::NpyArray", ptr %0, i32 0, i32 1
  %45 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIjSaIjEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %44, ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  call void @_ZNSt15__new_allocatorIjED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #8
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = icmp eq ptr %46, null
  br i1 %47, label %49, label %48

48:                                               ; preds = %43
  call void @_ZdaPv(ptr noundef %46) #9
  br label %49

49:                                               ; preds = %48, %43
  %50 = load i64, ptr %9, align 8, !tbaa !9
  %51 = load i32, ptr %7, align 4, !tbaa !11
  %52 = zext i32 %51 to i64
  %53 = mul i64 %50, %52
  %54 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %53) #10
          to label %55 unwind label %79

55:                                               ; preds = %49
  %56 = getelementptr inbounds %"struct.cnpy::NpyArray", ptr %0, i32 0, i32 0
  store ptr %54, ptr %56, align 8, !tbaa !22
  %57 = load i8, ptr %8, align 1, !tbaa !23, !range !24, !noundef !25
  %58 = trunc i8 %57 to i1
  %59 = getelementptr inbounds %"struct.cnpy::NpyArray", ptr %0, i32 0, i32 3
  %60 = zext i1 %58 to i8
  store i8 %60, ptr %59, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %61 = getelementptr inbounds %"struct.cnpy::NpyArray", ptr %0, i32 0, i32 0
  %62 = load ptr, ptr %61, align 8, !tbaa !22
  %63 = load i32, ptr %7, align 4, !tbaa !11
  %64 = zext i32 %63 to i64
  %65 = load i64, ptr %9, align 8, !tbaa !9
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = invoke i64 @fread(ptr noundef %62, i64 noundef %64, i64 noundef %65, ptr noundef %66)
          to label %68 unwind label %83

68:                                               ; preds = %55
  store i64 %67, ptr %16, align 8, !tbaa !27
  %69 = load i64, ptr %16, align 8, !tbaa !27
  %70 = load i64, ptr %9, align 8, !tbaa !9
  %71 = icmp ne i64 %69, %70
  br i1 %71, label %72, label %91

72:                                               ; preds = %68
  %73 = call ptr @__cxa_allocate_exception(i64 16) #8
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %73, ptr noundef @.str.11)
          to label %74 unwind label %87

74:                                               ; preds = %72
  invoke void @__cxa_throw(ptr %73, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #11
          to label %102 unwind label %83

75:                                               ; preds = %35
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %14, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %15, align 4
  call void @_ZNSt15__new_allocatorIjED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #8
  br label %96

79:                                               ; preds = %49
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %14, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %15, align 4
  br label %96

83:                                               ; preds = %74, %55
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %14, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %15, align 4
  br label %93

87:                                               ; preds = %72
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %14, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %15, align 4
  call void @__cxa_free_exception(ptr %73) #8
  br label %93

91:                                               ; preds = %68
  store i1 true, ptr %11, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  %92 = load i1, ptr %11, align 1
  br i1 %92, label %95, label %94

93:                                               ; preds = %87, %83
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %96

94:                                               ; preds = %91
  call void @_ZN4cnpy8NpyArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %0) #8
  br label %95

95:                                               ; preds = %94, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  ret void

96:                                               ; preds = %93, %79, %75
  call void @_ZN4cnpy8NpyArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %0) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  br label %97

97:                                               ; preds = %96
  %98 = load ptr, ptr %14, align 8
  %99 = load i32, ptr %15, align 4
  %100 = insertvalue { ptr, i32 } poison, ptr %98, 0
  %101 = insertvalue { ptr, i32 } %100, i32 %99, 1
  resume { ptr, i32 } %101

102:                                              ; preds = %74
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4cnpy8NpyArrayC2Ev(ptr noundef nonnull align 8 dereferenceable(37)) unnamed_addr #5 align 2

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

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

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #7

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4cnpy8NpyArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(37)) unnamed_addr #5 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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 = { 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 #5 = { 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 #6 = { 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 #7 = { 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 #8 = { nounwind }
attributes #9 = { builtin nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { noreturn }

!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 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !12, i64 32}
!16 = !{!"_ZTSN4cnpy8NpyArrayE", !6, i64 0, !17, i64 8, !12, i64 32, !21, i64 36}
!17 = !{!"_ZTSSt6vectorIjSaIjEE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!"bool", !7, i64 0}
!22 = !{!16, !6, i64 0}
!23 = !{!21, !21, i64 0}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!16, !21, i64 36}
!27 = !{!28, !28, i64 0}
!28 = !{!"long", !7, i64 0}


; 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.cnpy::NpyArray" = type <{ ptr, %"class.std::vector.4", i32, i8, [3 x i8] }>
%"class.std::vector.4" = type { %"struct.std::_Vector_base.5" }
%"struct.std::_Vector_base.5" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.6" = type { i8 }

@_ZTISt13runtime_error = external constant ptr
@.str.11 = external hidden unnamed_addr constant [32 x i8], align 1

; 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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4cnpy16parse_npy_headerEP8_IO_FILERjRPjS2_Rb(ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z17load_the_npy_fileP8_IO_FILE(ptr dead_on_unwind noalias writable sret(%"struct.cnpy::NpyArray") align 8 %0, ptr noundef %1) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca %"class.std::vector.4", align 8
  %8 = alloca %"class.std::allocator.6", align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #9
  call void @_ZN4cnpy16parse_npy_headerEP8_IO_FILERjRPjS2_Rb(ptr noundef %1, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 1 dereferenceable(1) %6)
  %9 = load i32, ptr %4, align 4, !tbaa !5
  %.not21 = icmp eq i32 %9, 0
  br i1 %.not21, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %10 = load ptr, ptr %3, align 8, !tbaa !9
  %wide.trip.count = zext i32 %9 to i64
  %xtraiter = and i64 %wide.trip.count, 7
  %11 = icmp ult i32 %9, 8
  br i1 %11, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %wide.trip.count, 4294967288
  br label %22

._crit_edge.loopexit.unr-lcssa:                   ; preds = %22, %.lr.ph
  %.lcssa.ph = phi i64 [ poison, %.lr.ph ], [ %54, %22 ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next.7, %22 ]
  %.020.unr = phi i64 [ 1, %.lr.ph ], [ %54, %22 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %._crit_edge.loopexit.unr-lcssa ]
  %.020.epil = phi i64 [ %15, %.epil.preheader ], [ %.020.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %12 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv.epil
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %14 = zext i32 %13 to i64
  %15 = mul i64 %.020.epil, %14
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.epil.preheader, !llvm.loop !11

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader, %2
  %.0.lcssa = phi i64 [ 1, %2 ], [ %.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %15, %.epil.preheader ]
  call void @_ZN4cnpy8NpyArrayC2Ev(ptr noundef nonnull align 8 dereferenceable(37) %0) #9
  %16 = load i32, ptr %5, align 4, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %0, i64 32
  store i32 %16, ptr %17, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #9
  %18 = load ptr, ptr %3, align 8, !tbaa !9
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = zext i32 %19 to i64
  %21 = getelementptr inbounds i32, ptr %18, i64 %20
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #9
  call void @_ZNSaIjEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #9
  invoke void @_ZNSt6vectorIjSaIjEEC2IPjvEET_S4_RKS0_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef %18, ptr noundef %21, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %55 unwind label %73

22:                                               ; preds = %22, %.lr.ph.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.new ], [ %indvars.iv.next.7, %22 ]
  %.020 = phi i64 [ 1, %.lr.ph.new ], [ %54, %22 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.7, %22 ]
  %23 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = zext i32 %24 to i64
  %26 = mul i64 %.020, %25
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %27 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv.next
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = zext i32 %28 to i64
  %30 = mul i64 %26, %29
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %31 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv.next.1
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = zext i32 %32 to i64
  %34 = mul i64 %30, %33
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %35 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv.next.2
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = zext i32 %36 to i64
  %38 = mul i64 %34, %37
  %indvars.iv.next.3 = or disjoint i64 %indvars.iv, 4
  %39 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv.next.3
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = zext i32 %40 to i64
  %42 = mul i64 %38, %41
  %indvars.iv.next.4 = or disjoint i64 %indvars.iv, 5
  %43 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv.next.4
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = zext i32 %44 to i64
  %46 = mul i64 %42, %45
  %indvars.iv.next.5 = or disjoint i64 %indvars.iv, 6
  %47 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv.next.5
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = zext i32 %48 to i64
  %50 = mul i64 %46, %49
  %indvars.iv.next.6 = or disjoint i64 %indvars.iv, 7
  %51 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv.next.6
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = zext i32 %52 to i64
  %54 = mul i64 %50, %53
  %indvars.iv.next.7 = add nuw nsw i64 %indvars.iv, 8
  %niter.next.7 = add i64 %niter, 8
  %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %._crit_edge.loopexit.unr-lcssa, label %22, !llvm.loop !20

55:                                               ; preds = %._crit_edge
  %56 = getelementptr inbounds i8, ptr %0, i64 8
  %57 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIjSaIjEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %56, ptr noundef nonnull align 8 dereferenceable(24) %7) #9
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #9
  call void @_ZNSt15__new_allocatorIjED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #9
  %58 = load ptr, ptr %3, align 8, !tbaa !9
  %59 = icmp eq ptr %58, null
  br i1 %59, label %61, label %60

60:                                               ; preds = %55
  call void @_ZdaPv(ptr noundef nonnull %58) #10
  br label %61

61:                                               ; preds = %60, %55
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = zext i32 %62 to i64
  %64 = mul i64 %.0.lcssa, %63
  %65 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %64) #11
          to label %66 unwind label %75

66:                                               ; preds = %61
  store ptr %65, ptr %0, align 8, !tbaa !22
  %67 = load i8, ptr %6, align 1, !tbaa !23, !range !24, !noundef !25
  %68 = getelementptr inbounds i8, ptr %0, i64 36
  store i8 %67, ptr %68, align 4, !tbaa !26
  %69 = call i64 @fread(ptr noundef nonnull %65, i64 noundef %63, i64 noundef %.0.lcssa, ptr noundef %1)
  %.not = icmp eq i64 %69, %.0.lcssa
  br i1 %.not, label %81, label %70

70:                                               ; preds = %66
  %71 = call ptr @__cxa_allocate_exception(i64 16) #9
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %71, ptr noundef nonnull @.str.11)
          to label %72 unwind label %79

72:                                               ; preds = %70
  invoke void @__cxa_throw(ptr nonnull %71, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #12
          to label %83 unwind label %77

73:                                               ; preds = %._crit_edge
  %74 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIjED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #9
  br label %82

75:                                               ; preds = %61
  %76 = landingpad { ptr, i32 }
          cleanup
  br label %82

77:                                               ; preds = %72
  %78 = landingpad { ptr, i32 }
          cleanup
  br label %82

79:                                               ; preds = %70
  %80 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %71) #9
  br label %82

81:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  ret void

82:                                               ; preds = %77, %79, %75, %73
  %.pn.pn = phi { ptr, i32 } [ %76, %75 ], [ %74, %73 ], [ %78, %77 ], [ %80, %79 ]
  call void @_ZN4cnpy8NpyArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %0) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  resume { ptr, i32 } %.pn.pn

83:                                               ; preds = %72
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4cnpy8NpyArrayC2Ev(ptr noundef nonnull align 8 dereferenceable(37)) unnamed_addr #6 align 2

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

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

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #8

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4cnpy8NpyArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(37)) unnamed_addr #6 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = { 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 = { 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 #6 = { 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 #7 = { 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 #8 = { 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 #9 = { nounwind }
attributes #10 = { builtin nounwind }
attributes #11 = { builtin allocsize(0) }
attributes #12 = { noreturn }

!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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = !{!14, !6, i64 32}
!14 = !{!"_ZTSN4cnpy8NpyArrayE", !10, i64 0, !15, i64 8, !6, i64 32, !19, i64 36}
!15 = !{!"_ZTSSt6vectorIjSaIjEE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!19 = !{!"bool", !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!14, !10, i64 0}
!23 = !{!19, !19, i64 0}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!14, !19, i64 36}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass