; LLVM IR from huawei-noah/bolt :: compute/tensor/src/select.ll (Z6select6TensorS_S_S_P8ArchInfo)

; 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.TensorDesc = type { i32, i32, i32, [20 x i32] }
%class.Tensor = type { %"class.std::shared_ptr", %"class.std::shared_ptr.0" }
%"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.0" = type { %"class.std::__shared_ptr.1" }
%"class.std::__shared_ptr.1" = type { ptr, %"class.std::__shared_count" }
%struct.ArchInfo = type { i32, ptr }

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z6select6TensorS_S_S_P8ArchInfo(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #0 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %struct.TensorDesc, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %class.Tensor, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca %class.Tensor, align 8
  %19 = alloca ptr, align 8
  %20 = alloca %class.Tensor, align 8
  %21 = alloca %struct.TensorDesc, align 4
  %22 = alloca ptr, align 8
  %23 = alloca %class.Tensor, align 8
  %24 = alloca i32, align 4
  %25 = alloca %struct.TensorDesc, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.ArchInfo, ptr %28, i32 0, i32 0
  %30 = load i32, ptr %29, align 8, !tbaa !9
  store i32 %30, ptr %11, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 92, ptr %12) #9
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %12, ptr noundef nonnull align 8 dereferenceable(32) %0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  call void @_ZN6TensorC2ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef nonnull align 8 dereferenceable(32) %0) #9
  %31 = load i32, ptr %11, align 4, !tbaa !12
  %32 = invoke noundef ptr @_Z19get_ptr_from_tensor6Tensor4Arch(ptr noundef %14, i32 noundef %31)
          to label %33 unwind label %57

33:                                               ; preds = %5
  call void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #9
  store ptr %32, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #9
  call void @_ZN6TensorC2ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef nonnull align 8 dereferenceable(32) %1) #9
  %34 = load i32, ptr %11, align 4, !tbaa !12
  %35 = invoke noundef ptr @_Z19get_ptr_from_tensor6Tensor4Arch(ptr noundef %18, i32 noundef %34)
          to label %36 unwind label %61

36:                                               ; preds = %33
  call void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #9
  store ptr %35, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #9
  call void @_ZN6TensorC2ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 8 dereferenceable(32) %2) #9
  %37 = load i32, ptr %11, align 4, !tbaa !12
  %38 = invoke noundef ptr @_Z19get_ptr_from_tensor6Tensor4Arch(ptr noundef %20, i32 noundef %37)
          to label %39 unwind label %65

39:                                               ; preds = %36
  call void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #9
  store ptr %38, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 92, ptr %21) #9
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %21, ptr noundef nonnull align 8 dereferenceable(32) %3)
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #9
  call void @_ZN6TensorC2ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %23, ptr noundef nonnull align 8 dereferenceable(32) %3) #9
  %40 = load i32, ptr %11, align 4, !tbaa !12
  %41 = invoke noundef ptr @_Z19get_ptr_from_tensor6Tensor4Arch(ptr noundef %23, i32 noundef %40)
          to label %42 unwind label %69

42:                                               ; preds = %39
  call void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %23) #9
  store ptr %41, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %21, i64 92, i1 false), !tbaa.struct !13
  %43 = call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %25)
  store i32 %43, ptr %24, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #9
  store i32 51, ptr %26, align 4, !tbaa !21
  %44 = getelementptr inbounds %struct.TensorDesc, ptr %12, i32 0, i32 0
  %45 = load i32, ptr %44, align 4, !tbaa !23
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %73, label %47

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #9
  %48 = call i64 (i64, ...) @syscall(i64 noundef 186) #9
  %49 = trunc i64 %48 to i32
  store i32 %49, ptr %27, align 4, !tbaa !18
  %50 = load i32, ptr %27, align 4, !tbaa !18
  %51 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %50)
  %52 = load ptr, ptr @stdout, align 8, !tbaa !5
  %53 = call i32 @fflush(ptr noundef %52)
  %54 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %55 = load ptr, ptr @stdout, align 8, !tbaa !5
  %56 = call i32 @fflush(ptr noundef %55)
  call void @exit(i32 noundef 1) #10
  unreachable

57:                                               ; preds = %5
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %15, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %16, align 4
  call void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #9
  br label %118

61:                                               ; preds = %33
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %15, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %16, align 4
  call void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #9
  br label %117

65:                                               ; preds = %36
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %15, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %16, align 4
  call void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #9
  br label %116

69:                                               ; preds = %39
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %15, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %16, align 4
  call void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 92, ptr %21) #9
  br label %116

73:                                               ; preds = %42
  %74 = load i32, ptr %11, align 4, !tbaa !12
  %75 = icmp eq i32 %74, 1
  br i1 %75, label %103, label %76

76:                                               ; preds = %73
  %77 = load i32, ptr %11, align 4, !tbaa !12
  %78 = icmp eq i32 %77, 8
  br i1 %78, label %103, label %79

79:                                               ; preds = %76
  %80 = load i32, ptr %11, align 4, !tbaa !12
  %81 = icmp eq i32 %80, 9
  br i1 %81, label %103, label %82

82:                                               ; preds = %79
  %83 = load i32, ptr %11, align 4, !tbaa !12
  %84 = icmp eq i32 %83, 10
  br i1 %84, label %103, label %85

85:                                               ; preds = %82
  %86 = load i32, ptr %11, align 4, !tbaa !12
  %87 = icmp eq i32 %86, 9
  br i1 %87, label %103, label %88

88:                                               ; preds = %85
  %89 = load i32, ptr %11, align 4, !tbaa !12
  %90 = icmp eq i32 %89, 10
  br i1 %90, label %103, label %91

91:                                               ; preds = %88
  %92 = load i32, ptr %11, align 4, !tbaa !12
  %93 = icmp eq i32 %92, 5
  br i1 %93, label %103, label %94

94:                                               ; preds = %91
  %95 = load i32, ptr %11, align 4, !tbaa !12
  %96 = icmp eq i32 %95, 6
  br i1 %96, label %103, label %97

97:                                               ; preds = %94
  %98 = load i32, ptr %11, align 4, !tbaa !12
  %99 = icmp eq i32 %98, 4
  br i1 %99, label %103, label %100

100:                                              ; preds = %97
  %101 = load i32, ptr %11, align 4, !tbaa !12
  %102 = icmp eq i32 %101, 3
  br i1 %102, label %103, label %114

103:                                              ; preds = %100, %97, %94, %91, %88, %85, %82, %79, %76, %73
  %104 = getelementptr inbounds %struct.TensorDesc, ptr %21, i32 0, i32 0
  %105 = load i32, ptr %104, align 4, !tbaa !23
  switch i32 %105, label %112 [
    i32 6, label %106
  ]

106:                                              ; preds = %103
  %107 = load ptr, ptr %13, align 8, !tbaa !5
  %108 = load ptr, ptr %17, align 8, !tbaa !5
  %109 = load ptr, ptr %19, align 8, !tbaa !5
  %110 = load ptr, ptr %22, align 8, !tbaa !5
  %111 = load i32, ptr %24, align 4, !tbaa !18
  call void @_Z13select_kernelIffEvPhPT_S2_S2_j(ptr noundef %107, ptr noundef %108, ptr noundef %109, ptr noundef %110, i32 noundef %111)
  store i32 0, ptr %26, align 4, !tbaa !21
  br label %113

112:                                              ; preds = %103
  br label %113

113:                                              ; preds = %112, %106
  br label %114

114:                                              ; preds = %113, %100
  %115 = load i32, ptr %26, align 4, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 92, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 92, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  ret i32 %115

116:                                              ; preds = %69, %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  br label %117

117:                                              ; preds = %116, %61
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  br label %118

118:                                              ; preds = %117, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 92, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  br label %119

119:                                              ; preds = %118
  %120 = load ptr, ptr %15, align 8
  %121 = load i32, ptr %16, align 4
  %122 = insertvalue { ptr, i32 } poison, ptr %120, 0
  %123 = insertvalue { ptr, i32 } %122, i32 %121, 1
  resume { ptr, i32 } %123
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.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 uwtable
declare dso_local noundef ptr @_Z19get_ptr_from_tensor6Tensor4Arch(ptr noundef, i32 noundef) #2

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

declare i32 @__gxx_personality_v0(...)

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) #3

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

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

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

declare i32 @fflush(ptr noundef) #6

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z13select_kernelIffEvPhPT_S2_S2_j(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #8

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

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 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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 #8 = { 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 #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, !11, i64 0}
!10 = !{!"_ZTS8ArchInfo", !11, i64 0, !6, i64 8}
!11 = !{!"_ZTS4Arch", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{i64 0, i64 4, !14, i64 4, i64 4, !16, i64 8, i64 4, !18, i64 12, i64 80, !20}
!14 = !{!15, !15, i64 0}
!15 = !{!"_ZTS8DataType", !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"_ZTS10DataFormat", !7, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"int", !7, i64 0}
!20 = !{!7, !7, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"_ZTS2EE", !7, i64 0}
!23 = !{!24, !15, i64 0}
!24 = !{!"_ZTS10TensorDesc", !15, i64 0, !17, i64 4, !19, i64 8, !7, i64 12}


; 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] }
%class.Tensor = type { %"class.std::shared_ptr", %"class.std::shared_ptr.0" }
%"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.0" = type { %"class.std::__shared_ptr.1" }
%"class.std::__shared_ptr.1" = type { ptr, %"class.std::__shared_count" }

@.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 [23 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 52) i32 @_Z6select6TensorS_S_S_P8ArchInfo(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr nocapture noundef readonly %4) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %6 = alloca %struct.TensorDesc, align 4
  %7 = alloca %class.Tensor, align 8
  %8 = alloca %class.Tensor, align 8
  %9 = alloca %class.Tensor, align 8
  %10 = alloca %struct.TensorDesc, align 8
  %11 = alloca %class.Tensor, align 8
  %12 = load i32, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %6) #8
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %6, ptr noundef nonnull align 8 dereferenceable(32) %0)
  call void @_ZN6TensorC2ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) %0) #8
  %13 = invoke noundef ptr @_Z19get_ptr_from_tensor6Tensor4Arch(ptr noundef nonnull %7, i32 noundef %12)
          to label %14 unwind label %33

14:                                               ; preds = %5
  call void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #8
  call void @_ZN6TensorC2ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  %15 = invoke noundef ptr @_Z19get_ptr_from_tensor6Tensor4Arch(ptr noundef nonnull %8, i32 noundef %12)
          to label %16 unwind label %35

16:                                               ; preds = %14
  call void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #8
  call void @_ZN6TensorC2ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %2) #8
  %17 = invoke noundef ptr @_Z19get_ptr_from_tensor6Tensor4Arch(ptr noundef nonnull %9, i32 noundef %12)
          to label %18 unwind label %37

18:                                               ; preds = %16
  call void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %10) #8
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %10, ptr noundef nonnull align 8 dereferenceable(32) %3)
  call void @_ZN6TensorC2ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(32) %3) #8
  %19 = invoke noundef ptr @_Z19get_ptr_from_tensor6Tensor4Arch(ptr noundef nonnull %11, i32 noundef %12)
          to label %20 unwind label %39

20:                                               ; preds = %18
  call void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #8
  %21 = call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %10)
  %22 = load i32, ptr %6, align 4, !tbaa !11
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %41, label %24

24:                                               ; preds = %20
  %25 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %26 = trunc i64 %25 to i32
  %27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %26)
  %28 = load ptr, ptr @stdout, align 8, !tbaa !16
  %29 = call i32 @fflush(ptr noundef %28)
  %30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %31 = load ptr, ptr @stdout, align 8, !tbaa !16
  %32 = call i32 @fflush(ptr noundef %31)
  call void @exit(i32 noundef 1) #9
  unreachable

33:                                               ; preds = %5
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #8
  br label %53

35:                                               ; preds = %14
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #8
  br label %53

37:                                               ; preds = %16
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  br label %53

39:                                               ; preds = %18
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6TensorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #8
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %10) #8
  br label %53

41:                                               ; preds = %20
  %42 = icmp eq i32 %12, 1
  %43 = and i32 %12, -2
  %44 = icmp eq i32 %43, 8
  %or.cond3 = or i1 %42, %44
  %45 = icmp eq i32 %12, 10
  %or.cond7 = or i1 %45, %or.cond3
  %46 = add i32 %12, -5
  %47 = icmp ult i32 %46, 2
  %or.cond13 = or i1 %47, %or.cond7
  %48 = add i32 %12, -3
  %49 = icmp ult i32 %48, 2
  %or.cond17 = select i1 %or.cond13, i1 true, i1 %49
  %50 = load i32, ptr %10, align 8
  %cond = icmp eq i32 %50, 6
  %or.cond19 = select i1 %or.cond17, i1 %cond, i1 false
  br i1 %or.cond19, label %51, label %52

51:                                               ; preds = %41
  call void @_Z13select_kernelIffEvPhPT_S2_S2_j(ptr noundef %13, ptr noundef %15, ptr noundef %17, ptr noundef %19, i32 noundef %21)
  br label %52

52:                                               ; preds = %51, %41
  %.042 = phi i32 [ 0, %51 ], [ 51, %41 ]
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %6) #8
  ret i32 %.042

53:                                               ; preds = %35, %39, %37, %33
  %.pn.pn.pn = phi { ptr, i32 } [ %34, %33 ], [ %36, %35 ], [ %40, %39 ], [ %38, %37 ]
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %6) #8
  resume { ptr, i32 } %.pn.pn.pn
}

; 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 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 uwtable
declare dso_local noundef ptr @_Z19get_ptr_from_tensor6Tensor4Arch(ptr noundef, i32 noundef) local_unnamed_addr #2

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

declare i32 @__gxx_personality_v0(...)

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) local_unnamed_addr #3

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z13select_kernelIffEvPhPT_S2_S2_j(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #7

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

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 = { 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 #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 = { 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 = { 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 #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 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 = { 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, !7, i64 0}
!6 = !{!"_ZTS8ArchInfo", !7, i64 0, !10, i64 8}
!7 = !{!"_ZTS4Arch", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTS10TensorDesc", !13, i64 0, !14, i64 4, !15, i64 8, !8, i64 12}
!13 = !{!"_ZTS8DataType", !8, i64 0}
!14 = !{!"_ZTS10DataFormat", !8, i64 0}
!15 = !{!"int", !8, i64 0}
!16 = !{!10, !10, i64 0}


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