; LLVM IR from huawei-noah/bolt :: inference/examples/automatic_speech_recognition (asr_convolution_transformer)

; 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.Tensor = type { %"class.std::shared_ptr", %"class.std::shared_ptr.5" }
%"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 }
%"class.std::shared_ptr.5" = type { %"class.std::__shared_ptr.6" }
%"class.std::__shared_ptr.6" = type { ptr, %"class.std::__shared_count" }
%struct.TensorDesc = type { i32, i32, i32, [20 x i32] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Tensor, std::allocator<Tensor>>::_Vector_impl" }
%"struct.std::_Vector_base<Tensor, std::allocator<Tensor>>::_Vector_impl" = type { %"struct.std::_Vector_base<Tensor, std::allocator<Tensor>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Tensor, std::allocator<Tensor>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [20 x i8], align 1
@stdout = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(92) ptr @_ZNSt6vectorI10TensorDescSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

; Function Attrs: nounwind
declare i64 @syscall(i64 noundef, ...) #5

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

declare i32 @fflush(ptr noundef) #4

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI6TensorSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(32)) #7 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL14read_file_dataP8_IO_FILE10TensorDesc(ptr dead_on_unwind noalias writable sret(%class.Tensor) align 8, ptr noundef, ptr noundef byval(%struct.TensorDesc) align 8) #7

declare i32 @fclose(ptr noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8load_seqNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt6vectorI10TensorDescSaIS6_EE(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef %1, ptr noundef %2) #7 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 ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %struct.TensorDesc, align 4
  %16 = alloca i32, align 4
  %17 = alloca %class.Tensor, align 8
  %18 = alloca %struct.TensorDesc, 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
  store i1 false, ptr %7, align 1
  call void @_ZNSt6vectorI6TensorSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %19 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  %20 = invoke noalias ptr @fopen(ptr noundef %19, ptr noundef @.str)
          to label %21 unwind label %39

21:                                               ; preds = %3
  store ptr %20, ptr %8, align 8, !tbaa !5
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %47

24:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  %25 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %26 = trunc i64 %25 to i32
  store i32 %26, ptr %11, align 4, !tbaa !9
  %27 = load i32, ptr %11, align 4, !tbaa !9
  %28 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %27)
          to label %29 unwind label %43

29:                                               ; preds = %24
  %30 = load ptr, ptr @stdout, align 8, !tbaa !5
  %31 = invoke i32 @fflush(ptr noundef %30)
          to label %32 unwind label %43

32:                                               ; preds = %29
  %33 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  %34 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %33)
          to label %35 unwind label %43

35:                                               ; preds = %32
  %36 = load ptr, ptr @stdout, align 8, !tbaa !5
  %37 = invoke i32 @fflush(ptr noundef %36)
          to label %38 unwind label %43

38:                                               ; preds = %35
  call void @exit(i32 noundef 1) #9
  unreachable

39:                                               ; preds = %99, %3
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %9, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %10, align 4
  br label %104

43:                                               ; preds = %35, %32, %29, %24
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %9, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %104

47:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %86, %47
  %49 = load i32, ptr %12, align 4, !tbaa !9
  %50 = zext i32 %49 to i64
  %51 = call noundef i64 @_ZNKSt6vectorI10TensorDescSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  %52 = icmp ult i64 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %48
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %99

54:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !9
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = invoke i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %55, ptr noundef @.str.3, ptr noundef %14)
          to label %57 unwind label %70

57:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 92, ptr %15) #8
  %58 = load i32, ptr %12, align 4, !tbaa !9
  %59 = zext i32 %58 to i64
  %60 = call noundef nonnull align 4 dereferenceable(92) ptr @_ZNSt6vectorI10TensorDescSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %59) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %60, i64 92, i1 false), !tbaa.struct !11
  %61 = load i32, ptr %14, align 4, !tbaa !9
  %62 = getelementptr inbounds %struct.TensorDesc, ptr %15, i32 0, i32 3
  %63 = getelementptr inbounds [20 x i32], ptr %62, i64 0, i64 0
  store i32 %61, ptr %63, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 1, ptr %16, align 4, !tbaa !9
  br label %64

64:                                               ; preds = %79, %57
  %65 = load i32, ptr %16, align 4, !tbaa !9
  %66 = getelementptr inbounds %struct.TensorDesc, ptr %15, i32 0, i32 2
  %67 = load i32, ptr %66, align 4, !tbaa !17
  %68 = icmp ult i32 %65, %67
  br i1 %68, label %74, label %69

69:                                               ; preds = %64
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %82

70:                                               ; preds = %54
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %9, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %10, align 4
  br label %98

74:                                               ; preds = %64
  %75 = getelementptr inbounds %struct.TensorDesc, ptr %15, i32 0, i32 3
  %76 = load i32, ptr %16, align 4, !tbaa !9
  %77 = zext i32 %76 to i64
  %78 = getelementptr inbounds [20 x i32], ptr %75, i64 0, i64 %77
  store i32 1, ptr %78, align 4, !tbaa !9
  br label %79

79:                                               ; preds = %74
  %80 = load i32, ptr %16, align 4, !tbaa !9
  %81 = add i32 %80, 1
  store i32 %81, ptr %16, align 4, !tbaa !9
  br label %64, !llvm.loop !19

82:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #8
  %83 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %15, i64 92, i1 false), !tbaa.struct !11
  invoke void @_ZL14read_file_dataP8_IO_FILE10TensorDesc(ptr dead_on_unwind writable sret(%class.Tensor) align 8 %17, ptr noundef %83, ptr noundef byval(%struct.TensorDesc) align 8 %18)
          to label %84 unwind label %89

84:                                               ; preds = %82
  invoke void @_ZNSt6vectorI6TensorSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(32) %17)
          to label %85 unwind label %93

85:                                               ; preds = %84
  call void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 92, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %12, align 4, !tbaa !9
  %88 = add i32 %87, 1
  store i32 %88, ptr %12, align 4, !tbaa !9
  br label %48, !llvm.loop !21

89:                                               ; preds = %82
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %9, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %10, align 4
  br label %97

93:                                               ; preds = %84
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %9, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %10, align 4
  call void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #8
  br label %97

97:                                               ; preds = %93, %89
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 92, ptr %15) #8
  br label %98

98:                                               ; preds = %97, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %104

99:                                               ; preds = %53
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = invoke i32 @fclose(ptr noundef %100)
          to label %102 unwind label %39

102:                                              ; preds = %99
  store i1 true, ptr %7, align 1
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  %103 = load i1, ptr %7, align 1
  br i1 %103, label %106, label %105

104:                                              ; preds = %98, %43, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @_ZNSt6vectorI6TensorSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #8
  br label %107

105:                                              ; preds = %102
  call void @_ZNSt6vectorI6TensorSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #8
  br label %106

106:                                              ; preds = %105, %102
  ret void

107:                                              ; preds = %104
  %108 = load ptr, ptr %9, align 8
  %109 = load i32, ptr %10, align 4
  %110 = insertvalue { ptr, i32 } poison, ptr %108, 0
  %111 = insertvalue { ptr, i32 } %110, i32 %109, 1
  resume { ptr, i32 } %111
}

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) #4

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { "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 "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 = { noreturn 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 = { 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 #8 = { nounwind }
attributes #9 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{i64 0, i64 4, !12, i64 4, i64 4, !14, i64 8, i64 4, !9, i64 12, i64 80, !16}
!12 = !{!13, !13, i64 0}
!13 = !{!"_ZTS8DataType", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"_ZTS10DataFormat", !7, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !10, i64 8}
!18 = !{!"_ZTS10TensorDesc", !13, i64 0, !15, i64 4, !10, i64 8, !7, i64 12}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}


; 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.Tensor = type { %"class.std::shared_ptr", %"class.std::shared_ptr.5" }
%"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 }
%"class.std::shared_ptr.5" = type { %"class.std::__shared_ptr.6" }
%"class.std::__shared_ptr.6" = type { ptr, %"class.std::__shared_count" }
%struct.TensorDesc = type { i32, i32, i32, [20 x i32] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Tensor, std::allocator<Tensor>>::_Vector_impl" }
%"struct.std::_Vector_base<Tensor, std::allocator<Tensor>>::_Vector_impl" = type { %"struct.std::_Vector_base<Tensor, std::allocator<Tensor>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Tensor, std::allocator<Tensor>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [20 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(92) ptr @_ZNSt6vectorI10TensorDescSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: nounwind
declare i64 @syscall(i64 noundef, ...) local_unnamed_addr #5

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

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #6

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL14read_file_dataP8_IO_FILE10TensorDesc(ptr dead_on_unwind noalias writable sret(%class.Tensor) align 8, ptr noundef, ptr noundef byval(%struct.TensorDesc) align 8) local_unnamed_addr #7

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8load_seqNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt6vectorI10TensorDescSaIS6_EE(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::vector") align 8 %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #7 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca %struct.TensorDesc, align 8
  %6 = alloca %class.Tensor, align 8
  tail call void @_ZNSt6vectorI6TensorSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #9
  %7 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #9
  %8 = tail call noalias ptr @fopen(ptr noundef %7, ptr noundef nonnull @.str)
  %9 = icmp eq ptr %8, null
  br i1 %9, label %13, label %.preheader

.preheader:                                       ; preds = %3
  %10 = tail call noundef i64 @_ZNKSt6vectorI10TensorDescSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  %.not = icmp eq i64 %10, 0
  br i1 %.not, label %._crit_edge24, label %.lr.ph23

.lr.ph23:                                         ; preds = %.preheader
  %11 = getelementptr inbounds i8, ptr %5, i64 12
  %12 = getelementptr inbounds i8, ptr %5, i64 8
  br label %24

13:                                               ; preds = %3
  %14 = tail call i64 (i64, ...) @syscall(i64 noundef 186) #9
  %15 = trunc i64 %14 to i32
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %15)
  %17 = load ptr, ptr @stdout, align 8, !tbaa !5
  %18 = tail call i32 @fflush(ptr noundef %17)
  %19 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #9
  %20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %19)
  %21 = load ptr, ptr @stdout, align 8, !tbaa !5
  %22 = tail call i32 @fflush(ptr noundef %21)
  tail call void @exit(i32 noundef 1) #10
  unreachable

._crit_edge24:                                    ; preds = %40, %.preheader
  %23 = call i32 @fclose(ptr noundef nonnull %8)
  ret void

24:                                               ; preds = %.lr.ph23, %40
  %25 = phi i64 [ 0, %.lr.ph23 ], [ %42, %40 ]
  %.01322 = phi i32 [ 0, %.lr.ph23 ], [ %41, %40 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  store i32 0, ptr %4, align 4, !tbaa !9
  %26 = invoke i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %8, ptr noundef nonnull @.str.3, ptr noundef nonnull %4)
          to label %27 unwind label %36

27:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %5) #9
  %28 = call noundef nonnull align 4 dereferenceable(92) ptr @_ZNSt6vectorI10TensorDescSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %25) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(92) %5, ptr noundef nonnull align 4 dereferenceable(92) %28, i64 92, i1 false), !tbaa.struct !11
  %29 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %29, ptr %11, align 4, !tbaa !9
  %30 = load i32, ptr %12, align 8, !tbaa !17
  %31 = icmp ugt i32 %30, 1
  br i1 %31, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %27
  %wide.trip.count = zext i32 %30 to i64
  %32 = add nsw i64 %wide.trip.count, -1
  %min.iters.check = icmp ult i32 %30, 9
  br i1 %min.iters.check, label %.lr.ph.preheader26, label %vector.ph

.lr.ph.preheader26:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %32, -8
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %33 = getelementptr inbounds [20 x i32], ptr %11, i64 0, i64 %offset.idx
  %34 = getelementptr inbounds i8, ptr %33, i64 16
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %33, align 8, !tbaa !9
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %34, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 8
  %35 = icmp eq i64 %index.next, %n.vec
  br i1 %35, label %middle.block, label %vector.body, !llvm.loop !19

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %32, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader26

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %27
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #9
  invoke void @_ZL14read_file_dataP8_IO_FILE10TensorDesc(ptr dead_on_unwind nonnull writable sret(%class.Tensor) align 8 %6, ptr noundef nonnull %8, ptr noundef nonnull byval(%struct.TensorDesc) align 8 %5)
          to label %39 unwind label %45

36:                                               ; preds = %24
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %50

.lr.ph:                                           ; preds = %.lr.ph.preheader26, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader26 ]
  %38 = getelementptr inbounds [20 x i32], ptr %11, i64 0, i64 %indvars.iv
  store i32 1, ptr %38, align 4, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !23

39:                                               ; preds = %._crit_edge
  invoke void @_ZNSt6vectorI6TensorSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %40 unwind label %47

40:                                               ; preds = %39
  call void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  %41 = add i32 %.01322, 1
  %42 = zext i32 %41 to i64
  %43 = call noundef i64 @_ZNKSt6vectorI10TensorDescSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  %44 = icmp ugt i64 %43, %42
  br i1 %44, label %24, label %._crit_edge24, !llvm.loop !24

45:                                               ; preds = %._crit_edge
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %49

47:                                               ; preds = %39
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #9
  br label %49

49:                                               ; preds = %47, %45
  %.pn = phi { ptr, i32 } [ %48, %47 ], [ %46, %45 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %5) #9
  br label %50

50:                                               ; preds = %49, %36
  %.pn.pn = phi { ptr, i32 } [ %.pn, %49 ], [ %37, %36 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @_ZNSt6vectorI6TensorSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #9
  resume { ptr, i32 } %.pn.pn
}

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #8

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { 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 #6 = { noreturn 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 = { 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 #8 = { "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 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{i64 0, i64 4, !12, i64 4, i64 4, !14, i64 8, i64 4, !9, i64 12, i64 80, !16}
!12 = !{!13, !13, i64 0}
!13 = !{!"_ZTS8DataType", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"_ZTS10DataFormat", !7, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !10, i64 8}
!18 = !{!"_ZTS10TensorDesc", !13, i64 0, !15, i64 4, !10, i64 8, !7, i64 12}
!19 = distinct !{!19, !20, !21, !22}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!"llvm.loop.isvectorized", i32 1}
!22 = !{!"llvm.loop.unroll.runtime.disable"}
!23 = distinct !{!23, !20, !22, !21}
!24 = distinct !{!24, !20}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass