; LLVM IR from huawei-noah/bolt :: compute/tensor/src (embedding)

; 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.EmbedParamSpec = type { i32, i32, i8, i8, i32 }
%struct.TensorDesc = type { i32, i32, i32, [20 x i32] }

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z27embedding_infer_output_sizeP6Tensor14EmbedParamSpec8DataTypeS0_P8ArchInfo(ptr noundef %0, i64 %1, i64 %2, i32 noundef %3, ptr noundef %4, ptr noundef %5) #0 {
  %7 = alloca %struct.EmbedParamSpec, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %struct.TensorDesc, align 4
  %17 = alloca %struct.TensorDesc, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i8, align 1
  %23 = alloca %struct.TensorDesc, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca %struct.TensorDesc, align 8
  %27 = alloca i32, align 4
  %28 = alloca %struct.TensorDesc, align 4
  %29 = alloca %struct.TensorDesc, align 8
  %30 = getelementptr inbounds { i64, i64 }, ptr %7, i32 0, i32 0
  store i64 %1, ptr %30, align 4
  %31 = getelementptr inbounds { i64, i64 }, ptr %7, i32 0, i32 1
  store i64 %2, ptr %31, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !5
  store ptr %5, ptr %11, align 8, !tbaa !5
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %50

34:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 1, ptr %12, align 4, !tbaa !11
  %35 = load i32, ptr %12, align 4, !tbaa !11
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %49

37:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %38 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %39 = trunc i64 %38 to i32
  store i32 %39, ptr %13, align 4, !tbaa !13
  %40 = load i32, ptr %13, align 4, !tbaa !13
  %41 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %40)
  %42 = load ptr, ptr @stdout, align 8, !tbaa !5
  %43 = call i32 @fflush(ptr noundef %42)
  %44 = load i32, ptr %12, align 4, !tbaa !11
  %45 = call ptr @ee2str(i32 noundef %44)
  %46 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %45)
  %47 = load ptr, ptr @stdout, align 8, !tbaa !5
  %48 = call i32 @fflush(ptr noundef %47)
  call void @exit(i32 noundef 1) #9
  unreachable

49:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %50

50:                                               ; preds = %49, %6
  %51 = load ptr, ptr %10, align 8, !tbaa !5
  %52 = icmp eq ptr %51, null
  br i1 %52, label %53, label %69

53:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 1, ptr %14, align 4, !tbaa !11
  %54 = load i32, ptr %14, align 4, !tbaa !11
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %68

56:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %57 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %58 = trunc i64 %57 to i32
  store i32 %58, ptr %15, align 4, !tbaa !13
  %59 = load i32, ptr %15, align 4, !tbaa !13
  %60 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %59)
  %61 = load ptr, ptr @stdout, align 8, !tbaa !5
  %62 = call i32 @fflush(ptr noundef %61)
  %63 = load i32, ptr %14, align 4, !tbaa !11
  %64 = call ptr @ee2str(i32 noundef %63)
  %65 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %64)
  %66 = load ptr, ptr @stdout, align 8, !tbaa !5
  %67 = call i32 @fflush(ptr noundef %66)
  call void @exit(i32 noundef 1) #9
  unreachable

68:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %69

69:                                               ; preds = %68, %50
  call void @llvm.lifetime.start.p0(i64 92, ptr %16) #8
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %16, ptr noundef nonnull align 8 dereferenceable(32) %70)
  call void @llvm.lifetime.start.p0(i64 92, ptr %17) #8
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %17, ptr noundef nonnull align 8 dereferenceable(32) %71)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #8
  store i8 0, ptr %22, align 1, !tbaa !15
  %72 = getelementptr inbounds %struct.TensorDesc, ptr %16, i32 0, i32 2
  %73 = load i32, ptr %72, align 4, !tbaa !17
  %74 = icmp eq i32 %73, 1
  br i1 %74, label %75, label %79

75:                                               ; preds = %69
  store i8 1, ptr %22, align 1, !tbaa !15
  %76 = getelementptr inbounds %struct.TensorDesc, ptr %16, i32 0, i32 2
  store i32 2, ptr %76, align 4, !tbaa !17
  %77 = getelementptr inbounds %struct.TensorDesc, ptr %16, i32 0, i32 3
  %78 = getelementptr inbounds [20 x i32], ptr %77, i64 0, i64 1
  store i32 1, ptr %78, align 4, !tbaa !13
  br label %79

79:                                               ; preds = %75, %69
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %16, i64 92, i1 false), !tbaa.struct !20
  %80 = call noundef zeroext i8 @_Z10tensorIs2d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %23)
  %81 = icmp ne i8 %80, 0
  br i1 %81, label %92, label %82

82:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %83 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %84 = trunc i64 %83 to i32
  store i32 %84, ptr %24, align 4, !tbaa !13
  %85 = load i32, ptr %24, align 4, !tbaa !13
  %86 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %85)
  %87 = load ptr, ptr @stdout, align 8, !tbaa !5
  %88 = call i32 @fflush(ptr noundef %87)
  %89 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  %90 = load ptr, ptr @stdout, align 8, !tbaa !5
  %91 = call i32 @fflush(ptr noundef %90)
  call void @exit(i32 noundef 1) #9
  unreachable

92:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %16, i64 92, i1 false), !tbaa.struct !20
  %93 = call noundef i32 @_Z11tensor2dGet10TensorDescP8DataTypeP10DataFormatPjS4_(ptr noundef byval(%struct.TensorDesc) align 8 %26, ptr noundef %18, ptr noundef %19, ptr noundef %20, ptr noundef %21)
  store i32 %93, ptr %25, align 4, !tbaa !11
  %94 = load i32, ptr %25, align 4, !tbaa !11
  %95 = icmp ne i32 %94, 0
  br i1 %95, label %96, label %108

96:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  %97 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %98 = trunc i64 %97 to i32
  store i32 %98, ptr %27, align 4, !tbaa !13
  %99 = load i32, ptr %27, align 4, !tbaa !13
  %100 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %99)
  %101 = load ptr, ptr @stdout, align 8, !tbaa !5
  %102 = call i32 @fflush(ptr noundef %101)
  %103 = load i32, ptr %25, align 4, !tbaa !11
  %104 = call ptr @ee2str(i32 noundef %103)
  %105 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %104)
  %106 = load ptr, ptr @stdout, align 8, !tbaa !5
  %107 = call i32 @fflush(ptr noundef %106)
  call void @exit(i32 noundef 1) #9
  unreachable

108:                                              ; preds = %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.start.p0(i64 92, ptr %28) #8
  %109 = load i32, ptr %9, align 4, !tbaa !9
  %110 = load i32, ptr %20, align 4, !tbaa !13
  %111 = load i32, ptr %21, align 4, !tbaa !13
  %112 = getelementptr inbounds %struct.EmbedParamSpec, ptr %7, i32 0, i32 1
  %113 = load i32, ptr %112, align 4, !tbaa !23
  call void @_Z9tensor3df8DataType10DataFormatjjj(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %28, i32 noundef %109, i32 noundef 15, i32 noundef %110, i32 noundef %111, i32 noundef %113)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %28, i64 92, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 92, ptr %28) #8
  %114 = load i8, ptr %22, align 1, !tbaa !15, !range !25, !noundef !26
  %115 = trunc i8 %114 to i1
  br i1 %115, label %116, label %119

116:                                              ; preds = %108
  %117 = getelementptr inbounds %struct.TensorDesc, ptr %17, i32 0, i32 2
  store i32 2, ptr %117, align 4, !tbaa !17
  %118 = getelementptr inbounds %struct.TensorDesc, ptr %17, i32 0, i32 1
  store i32 14, ptr %118, align 4, !tbaa !27
  br label %119

119:                                              ; preds = %116, %108
  %120 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 4 %17, i64 92, i1 false), !tbaa.struct !20
  call void @_ZN6Tensor6resizeE10TensorDesc(ptr noundef nonnull align 8 dereferenceable(32) %120, ptr noundef byval(%struct.TensorDesc) align 8 %29)
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 92, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 92, ptr %16) #8
  ret i32 0
}

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

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

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

declare i32 @fflush(ptr noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local ptr @ee2str(i32 noundef) #4

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Tensor8get_descEv(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_Z10tensorIs2d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) #4

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z11tensor2dGet10TensorDescP8DataTypeP10DataFormatPjS4_(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z9tensor3df8DataType10DataFormatjjj(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #7

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Tensor6resizeE10TensorDesc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef byval(%struct.TensorDesc) align 8) #0 align 2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { 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 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { inlinehint 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 = !{!"_ZTS8DataType", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTS2EE", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!18, !14, i64 8}
!18 = !{!"_ZTS10TensorDesc", !10, i64 0, !19, i64 4, !14, i64 8, !7, i64 12}
!19 = !{!"_ZTS10DataFormat", !7, i64 0}
!20 = !{i64 0, i64 4, !9, i64 4, i64 4, !21, i64 8, i64 4, !13, i64 12, i64 80, !22}
!21 = !{!19, !19, i64 0}
!22 = !{!7, !7, i64 0}
!23 = !{!24, !14, i64 4}
!24 = !{!"_ZTS14EmbedParamSpec", !14, i64 0, !14, i64 4, !16, i64 8, !16, i64 9, !14, i64 12}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!18, !19, i64 4}


; 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.TensorDesc = type { i32, i32, i32, [20 x i32] }

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z27embedding_infer_output_sizeP6Tensor14EmbedParamSpec8DataTypeS0_P8ArchInfo(ptr noundef %0, i64 %1, i64 %2, i32 noundef %3, ptr noundef %4, ptr nocapture noundef readnone %5) local_unnamed_addr #0 {
  %7 = alloca %struct.TensorDesc, align 8
  %8 = alloca %struct.TensorDesc, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %struct.TensorDesc, align 4
  %.sroa.1.0.extract.shift = lshr i64 %1, 32
  %.sroa.1.0.extract.trunc = trunc nuw i64 %.sroa.1.0.extract.shift to i32
  %14 = icmp eq ptr %0, null
  br i1 %14, label %15, label %25

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

25:                                               ; preds = %6
  %26 = icmp eq ptr %4, null
  br i1 %26, label %27, label %37

27:                                               ; preds = %25
  %28 = tail call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %29 = trunc i64 %28 to i32
  %30 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %29)
  %31 = load ptr, ptr @stdout, align 8, !tbaa !5
  %32 = tail call i32 @fflush(ptr noundef %31)
  %33 = tail call ptr @ee2str(i32 noundef 1)
  %34 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %33)
  %35 = load ptr, ptr @stdout, align 8, !tbaa !5
  %36 = tail call i32 @fflush(ptr noundef %35)
  tail call void @exit(i32 noundef 1) #9
  unreachable

37:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %7) #8
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %7, ptr noundef nonnull align 8 dereferenceable(32) %0)
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %8) #8
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %8, ptr noundef nonnull align 8 dereferenceable(32) %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #8
  %38 = getelementptr inbounds i8, ptr %7, i64 8
  %39 = load i32, ptr %38, align 8, !tbaa !9
  %40 = icmp eq i32 %39, 1
  br i1 %40, label %41, label %43

41:                                               ; preds = %37
  store i32 2, ptr %38, align 8, !tbaa !9
  %42 = getelementptr inbounds i8, ptr %7, i64 16
  store i32 1, ptr %42, align 8, !tbaa !14
  br label %43

43:                                               ; preds = %41, %37
  %44 = call noundef zeroext i8 @_Z10tensorIs2d10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %7)
  %.not = icmp eq i8 %44, 0
  br i1 %.not, label %45, label %54

45:                                               ; preds = %43
  %46 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %47 = trunc i64 %46 to i32
  %48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %47)
  %49 = load ptr, ptr @stdout, align 8, !tbaa !5
  %50 = call i32 @fflush(ptr noundef %49)
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %52 = load ptr, ptr @stdout, align 8, !tbaa !5
  %53 = call i32 @fflush(ptr noundef %52)
  call void @exit(i32 noundef 1) #9
  unreachable

54:                                               ; preds = %43
  %55 = call noundef i32 @_Z11tensor2dGet10TensorDescP8DataTypeP10DataFormatPjS4_(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %7, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12)
  %.not17 = icmp eq i32 %55, 0
  br i1 %.not17, label %66, label %56

56:                                               ; preds = %54
  %57 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %58 = trunc i64 %57 to i32
  %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %58)
  %60 = load ptr, ptr @stdout, align 8, !tbaa !5
  %61 = call i32 @fflush(ptr noundef %60)
  %62 = call ptr @ee2str(i32 noundef %55)
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %62)
  %64 = load ptr, ptr @stdout, align 8, !tbaa !5
  %65 = call i32 @fflush(ptr noundef %64)
  call void @exit(i32 noundef 1) #9
  unreachable

66:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %13) #8
  %67 = load i32, ptr %11, align 4, !tbaa !14
  %68 = load i32, ptr %12, align 4, !tbaa !14
  call void @_Z9tensor3df8DataType10DataFormatjjj(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %13, i32 noundef %3, i32 noundef 15, i32 noundef %67, i32 noundef %68, i32 noundef %.sroa.1.0.extract.trunc)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(92) %8, ptr noundef nonnull align 4 dereferenceable(92) %13, i64 92, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %13) #8
  br i1 %40, label %69, label %72

69:                                               ; preds = %66
  %70 = getelementptr inbounds i8, ptr %8, i64 8
  store i32 2, ptr %70, align 8, !tbaa !9
  %71 = getelementptr inbounds i8, ptr %8, i64 4
  store i32 14, ptr %71, align 4, !tbaa !19
  br label %72

72:                                               ; preds = %69, %66
  call void @_ZN6Tensor6resizeE10TensorDesc(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull byval(%struct.TensorDesc) align 8 %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %7) #8
  ret i32 0
}

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local ptr @ee2str(i32 noundef) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Tensor8get_descEv(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_Z10tensorIs2d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) local_unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z11tensor2dGet10TensorDescP8DataTypeP10DataFormatPjS4_(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z9tensor3df8DataType10DataFormatjjj(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #7

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Tensor6resizeE10TensorDesc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef byval(%struct.TensorDesc) align 8) local_unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { 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 #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 = { 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 #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { inlinehint 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, !13, i64 8}
!10 = !{!"_ZTS10TensorDesc", !11, i64 0, !12, i64 4, !13, i64 8, !7, i64 12}
!11 = !{!"_ZTS8DataType", !7, i64 0}
!12 = !{!"_ZTS10DataFormat", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{i64 0, i64 4, !16, i64 4, i64 4, !17, i64 8, i64 4, !14, i64 12, i64 80, !18}
!16 = !{!11, !11, i64 0}
!17 = !{!12, !12, i64 0}
!18 = !{!7, !7, i64 0}
!19 = !{!10, !12, i64 4}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass