; LLVM IR from NVIDIA/FasterTransformer :: src/fastertransformer/utils (gemm)

; 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.fastertransformer::cublasLtMatmulAlgo_info" = type { i32, i32, i32, i32, i32, i32, i32, i32, float }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%struct.__half = type { i16 }
%"class.fastertransformer::Gemm" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32 }

@.str.1 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [241 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17fastertransformer5checkI14cublasStatus_tEEvT_PKcS4_i(i32 noundef, ptr noundef, ptr noundef, i32 noundef) #0

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(88) ptr @_ZN17fastertransformer6Logger9getLoggerEv() #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN17fastertransformer18getCublasOperationENS_6GemmOpE(i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN17fastertransformer17getCublasDataTypeENS_13datatype_enumE(i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5mutex4lockEv(ptr noundef nonnull align 8 dereferenceable(40)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6__halfC2Ef(ptr noundef nonnull align 2 dereferenceable(2), float noundef) unnamed_addr #0 align 2

declare void @_ZN17fastertransformer13cublasAlgoMap7getAlgoEiiiiNS_14CublasDataTypeE(ptr dead_on_unwind writable sret(%"struct.fastertransformer::cublasLtMatmulAlgo_info") align 4, ptr noundef nonnull align 8 dereferenceable(168), i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN17fastertransformer20getCublasComputeTypeENS_13datatype_enumE(i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5mutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(40)) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17fastertransformer4Gemm11batchedGemmENS_6GemmOpES1_mmmPKPKvNS_13datatype_enumEmS5_S6_mPKPvS6_mmff(ptr noundef nonnull align 8 dereferenceable(80) %0, i32 noundef %1, i32 noundef %2, i64 noundef %3, i64 noundef %4, i64 noundef %5, ptr noundef %6, i32 noundef %7, i64 noundef %8, ptr noundef %9, i32 noundef %10, i64 noundef %11, ptr noundef %12, i32 noundef %13, i64 noundef %14, i64 noundef %15, float noundef %16, float noundef %17) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca i64, align 8
  %28 = alloca ptr, align 8
  %29 = alloca i32, align 4
  %30 = alloca i64, align 8
  %31 = alloca ptr, align 8
  %32 = alloca i32, align 4
  %33 = alloca i64, align 8
  %34 = alloca i64, align 8
  %35 = alloca float, align 4
  %36 = alloca float, align 4
  %37 = alloca %"class.std::__cxx11::basic_string", align 8
  %38 = alloca %"class.std::allocator", align 1
  %39 = alloca ptr, align 8
  %40 = alloca i32, align 4
  %41 = alloca ptr, align 8
  %42 = alloca ptr, align 8
  %43 = alloca i32, align 4
  %44 = alloca i32, align 4
  %45 = alloca i32, align 4
  %46 = alloca i32, align 4
  %47 = alloca i32, align 4
  %48 = alloca i64, align 8
  %49 = alloca i64, align 8
  %50 = alloca i64, align 8
  %51 = alloca i64, align 8
  %52 = alloca %struct.__half, align 2
  %53 = alloca %struct.__half, align 2
  %54 = alloca i8, align 1
  %55 = alloca ptr, align 8
  %56 = alloca ptr, align 8
  %57 = alloca %"struct.fastertransformer::cublasLtMatmulAlgo_info", align 4
  store ptr %0, ptr %19, align 8, !tbaa !5
  store i32 %1, ptr %20, align 4, !tbaa !9
  store i32 %2, ptr %21, align 4, !tbaa !9
  store i64 %3, ptr %22, align 8, !tbaa !11
  store i64 %4, ptr %23, align 8, !tbaa !11
  store i64 %5, ptr %24, align 8, !tbaa !11
  store ptr %6, ptr %25, align 8, !tbaa !5
  store i32 %7, ptr %26, align 4, !tbaa !13
  store i64 %8, ptr %27, align 8, !tbaa !11
  store ptr %9, ptr %28, align 8, !tbaa !5
  store i32 %10, ptr %29, align 4, !tbaa !13
  store i64 %11, ptr %30, align 8, !tbaa !11
  store ptr %12, ptr %31, align 8, !tbaa !5
  store i32 %13, ptr %32, align 4, !tbaa !13
  store i64 %14, ptr %33, align 8, !tbaa !11
  store i64 %15, ptr %34, align 8, !tbaa !11
  store float %16, ptr %35, align 4, !tbaa !15
  store float %17, ptr %36, align 4, !tbaa !15
  %58 = load ptr, ptr %19, align 8
  br label %59

59:                                               ; preds = %18
  %60 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZN17fastertransformer6Logger9getLoggerEv()
  %61 = call noundef i32 @_ZNK17fastertransformer6Logger8getLevelEv(ptr noundef nonnull align 8 dereferenceable(88) %60)
  %62 = icmp sle i32 %61, 0
  br i1 %62, label %63, label %76

63:                                               ; preds = %59
  %64 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZN17fastertransformer6Logger9getLoggerEv()
  call void @llvm.lifetime.start.p0(i64 1, ptr %38) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %38) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %37, ptr noundef @.str.10, ptr noundef nonnull align 1 dereferenceable(1) %38)
          to label %65 unwind label %67

65:                                               ; preds = %63
  invoke void @_ZN17fastertransformer6Logger3logIJmmmmmmmEEEvNS0_5LevelENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpRKT_(ptr noundef nonnull align 8 dereferenceable(88) %64, i32 noundef 0, ptr noundef %37, ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull align 8 dereferenceable(8) %33)
          to label %66 unwind label %71

66:                                               ; preds = %65
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %37) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %38) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %38) #4
  br label %76

67:                                               ; preds = %63
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %39, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %40, align 4
  br label %75

71:                                               ; preds = %65
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %39, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %40, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %37) #4
  br label %75

75:                                               ; preds = %71, %67
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %38) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %38) #4
  br label %162

76:                                               ; preds = %66, %59
  br label %77

77:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #4
  %78 = load ptr, ptr %28, align 8, !tbaa !5
  store ptr %78, ptr %41, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #4
  %79 = load ptr, ptr %25, align 8, !tbaa !5
  store ptr %79, ptr %42, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #4
  %80 = load i32, ptr %21, align 4, !tbaa !9
  %81 = call noundef i32 @_ZN17fastertransformer18getCublasOperationENS_6GemmOpE(i32 noundef %80)
  store i32 %81, ptr %43, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #4
  %82 = load i32, ptr %20, align 4, !tbaa !9
  %83 = call noundef i32 @_ZN17fastertransformer18getCublasOperationENS_6GemmOpE(i32 noundef %82)
  store i32 %83, ptr %44, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #4
  %84 = load i32, ptr %29, align 4, !tbaa !13
  %85 = call noundef i32 @_ZN17fastertransformer17getCublasDataTypeENS_13datatype_enumE(i32 noundef %84)
  store i32 %85, ptr %45, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #4
  %86 = load i32, ptr %26, align 4, !tbaa !13
  %87 = call noundef i32 @_ZN17fastertransformer17getCublasDataTypeENS_13datatype_enumE(i32 noundef %86)
  store i32 %87, ptr %46, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #4
  %88 = load i32, ptr %32, align 4, !tbaa !13
  %89 = call noundef i32 @_ZN17fastertransformer17getCublasDataTypeENS_13datatype_enumE(i32 noundef %88)
  store i32 %89, ptr %47, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #4
  %90 = load i64, ptr %23, align 8, !tbaa !11
  store i64 %90, ptr %48, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #4
  %91 = load i64, ptr %22, align 8, !tbaa !11
  store i64 %91, ptr %49, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %50) #4
  %92 = load i64, ptr %30, align 8, !tbaa !11
  store i64 %92, ptr %50, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %51) #4
  %93 = load i64, ptr %27, align 8, !tbaa !11
  store i64 %93, ptr %51, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 2, ptr %52) #4
  %94 = load float, ptr %35, align 4, !tbaa !15
  call void @_ZN6__halfC2Ef(ptr noundef nonnull align 2 dereferenceable(2) %52, float noundef %94)
  call void @llvm.lifetime.start.p0(i64 2, ptr %53) #4
  %95 = load float, ptr %36, align 4, !tbaa !15
  call void @_ZN6__halfC2Ef(ptr noundef nonnull align 2 dereferenceable(2) %53, float noundef %95)
  %96 = getelementptr inbounds %"class.fastertransformer::Gemm", ptr %58, i32 0, i32 3
  %97 = load ptr, ptr %96, align 8, !tbaa !21
  call void @_ZNSt5mutex4lockEv(ptr noundef nonnull align 8 dereferenceable(40) %97)
  call void @llvm.lifetime.start.p0(i64 1, ptr %54) #4
  %98 = getelementptr inbounds %"class.fastertransformer::Gemm", ptr %58, i32 0, i32 11
  %99 = load i32, ptr %98, align 4, !tbaa !23
  %100 = icmp eq i32 %99, 10
  %101 = zext i1 %100 to i8
  store i8 %101, ptr %54, align 1, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %55) #4
  %102 = load i8, ptr %54, align 1, !tbaa !24, !range !26, !noundef !27
  %103 = trunc i8 %102 to i1
  br i1 %103, label %104, label %105

104:                                              ; preds = %77
  br label %106

105:                                              ; preds = %77
  br label %106

106:                                              ; preds = %105, %104
  %107 = phi ptr [ %52, %104 ], [ %35, %105 ]
  store ptr %107, ptr %55, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %56) #4
  %108 = load i8, ptr %54, align 1, !tbaa !24, !range !26, !noundef !27
  %109 = trunc i8 %108 to i1
  br i1 %109, label %110, label %111

110:                                              ; preds = %106
  br label %112

111:                                              ; preds = %106
  br label %112

112:                                              ; preds = %111, %110
  %113 = phi ptr [ %53, %110 ], [ %36, %111 ]
  store ptr %113, ptr %56, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 36, ptr %57) #4
  %114 = getelementptr inbounds %"class.fastertransformer::Gemm", ptr %58, i32 0, i32 4
  %115 = load ptr, ptr %114, align 8, !tbaa !28
  %116 = load i64, ptr %34, align 8, !tbaa !11
  %117 = trunc i64 %116 to i32
  %118 = load i64, ptr %22, align 8, !tbaa !11
  %119 = trunc i64 %118 to i32
  %120 = load i64, ptr %23, align 8, !tbaa !11
  %121 = trunc i64 %120 to i32
  %122 = load i64, ptr %24, align 8, !tbaa !11
  %123 = trunc i64 %122 to i32
  %124 = load i32, ptr %45, align 4, !tbaa !19
  %125 = icmp eq i32 %124, 2
  %126 = zext i1 %125 to i64
  %127 = select i1 %125, i32 1, i32 0
  call void @_ZN17fastertransformer13cublasAlgoMap7getAlgoEiiiiNS_14CublasDataTypeE(ptr dead_on_unwind writable sret(%"struct.fastertransformer::cublasLtMatmulAlgo_info") align 4 %57, ptr noundef nonnull align 8 dereferenceable(168) %115, i32 noundef %117, i32 noundef %119, i32 noundef %121, i32 noundef %123, i32 noundef %127)
  %128 = getelementptr inbounds %"class.fastertransformer::Gemm", ptr %58, i32 0, i32 5
  %129 = load ptr, ptr %128, align 8, !tbaa !29
  %130 = load i32, ptr %43, align 4, !tbaa !17
  %131 = load i32, ptr %44, align 4, !tbaa !17
  %132 = load i64, ptr %48, align 8, !tbaa !11
  %133 = trunc i64 %132 to i32
  %134 = load i64, ptr %49, align 8, !tbaa !11
  %135 = trunc i64 %134 to i32
  %136 = load i64, ptr %24, align 8, !tbaa !11
  %137 = trunc i64 %136 to i32
  %138 = load ptr, ptr %55, align 8, !tbaa !5
  %139 = load ptr, ptr %41, align 8, !tbaa !5
  %140 = load i32, ptr %45, align 4, !tbaa !19
  %141 = load i64, ptr %50, align 8, !tbaa !11
  %142 = trunc i64 %141 to i32
  %143 = load ptr, ptr %42, align 8, !tbaa !5
  %144 = load i32, ptr %46, align 4, !tbaa !19
  %145 = load i64, ptr %51, align 8, !tbaa !11
  %146 = trunc i64 %145 to i32
  %147 = load ptr, ptr %56, align 8, !tbaa !5
  %148 = load ptr, ptr %31, align 8, !tbaa !5
  %149 = load i32, ptr %47, align 4, !tbaa !19
  %150 = load i64, ptr %33, align 8, !tbaa !11
  %151 = trunc i64 %150 to i32
  %152 = load i64, ptr %34, align 8, !tbaa !11
  %153 = trunc i64 %152 to i32
  %154 = getelementptr inbounds %"class.fastertransformer::Gemm", ptr %58, i32 0, i32 11
  %155 = load i32, ptr %154, align 4, !tbaa !23
  %156 = call noundef i32 @_ZN17fastertransformer20getCublasComputeTypeENS_13datatype_enumE(i32 noundef %155)
  %157 = getelementptr inbounds %"struct.fastertransformer::cublasLtMatmulAlgo_info", ptr %57, i32 0, i32 0
  %158 = load i32, ptr %157, align 4, !tbaa !30
  %159 = call i32 @cublasGemmBatchedEx(ptr noundef %129, i32 noundef %130, i32 noundef %131, i32 noundef %133, i32 noundef %135, i32 noundef %137, ptr noundef %138, ptr noundef %139, i32 noundef %140, i32 noundef %142, ptr noundef %143, i32 noundef %144, i32 noundef %146, ptr noundef %147, ptr noundef %148, i32 noundef %149, i32 noundef %151, i32 noundef %153, i32 noundef %156, i32 noundef %158)
  call void @_ZN17fastertransformer5checkI14cublasStatus_tEEvT_PKcS4_i(i32 noundef %159, ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 477)
  %160 = getelementptr inbounds %"class.fastertransformer::Gemm", ptr %58, i32 0, i32 3
  %161 = load ptr, ptr %160, align 8, !tbaa !21
  call void @_ZNSt5mutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(40) %161)
  call void @llvm.lifetime.end.p0(i64 36, ptr %57) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %56) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %55) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %54) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %53) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %52) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #4
  ret void

162:                                              ; preds = %75
  %163 = load ptr, ptr %39, align 8
  %164 = load i32, ptr %40, align 4
  %165 = insertvalue { ptr, i32 } poison, ptr %163, 0
  %166 = insertvalue { ptr, i32 } %165, i32 %164, 1
  resume { ptr, i32 } %166
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17fastertransformer6Logger3logIJmmmmmmmEEEvNS0_5LevelENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpRKT_(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

declare i32 @cublasGemmBatchedEx(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #3

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

!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 = !{!"_ZTSN17fastertransformer6GemmOpE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_ZTSN17fastertransformer13datatype_enumE", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"_ZTS17cublasOperation_t", !7, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"_ZTS14cudaDataType_t", !7, i64 0}
!21 = !{!22, !6, i64 24}
!22 = !{!"_ZTSN17fastertransformer4GemmE", !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !14, i64 64, !14, i64 68, !14, i64 72, !14, i64 76}
!23 = !{!22, !14, i64 76}
!24 = !{!25, !25, i64 0}
!25 = !{!"bool", !7, i64 0}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!22, !6, i64 32}
!29 = !{!22, !6, i64 40}
!30 = !{!31, !32, i64 0}
!31 = !{!"_ZTSN17fastertransformer23cublasLtMatmulAlgo_infoE", !32, i64 0, !32, i64 4, !32, i64 8, !32, i64 12, !32, i64 16, !32, i64 20, !32, i64 24, !32, i64 28, !16, i64 32}
!32 = !{!"int", !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.fastertransformer::cublasLtMatmulAlgo_info" = type { i32, i32, i32, i32, i32, i32, i32, i32, float }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%struct.__half = type { i16 }

@.str.1 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [241 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17fastertransformer5checkI14cublasStatus_tEEvT_PKcS4_i(i32 noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(88) ptr @_ZN17fastertransformer6Logger9getLoggerEv() local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN17fastertransformer18getCublasOperationENS_6GemmOpE(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN17fastertransformer17getCublasDataTypeENS_13datatype_enumE(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5mutex4lockEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6__halfC2Ef(ptr noundef nonnull align 2 dereferenceable(2), float noundef) unnamed_addr #0 align 2

declare void @_ZN17fastertransformer13cublasAlgoMap7getAlgoEiiiiNS_14CublasDataTypeE(ptr dead_on_unwind writable sret(%"struct.fastertransformer::cublasLtMatmulAlgo_info") align 4, ptr noundef nonnull align 8 dereferenceable(168), i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN17fastertransformer20getCublasComputeTypeENS_13datatype_enumE(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5mutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17fastertransformer4Gemm11batchedGemmENS_6GemmOpES1_mmmPKPKvNS_13datatype_enumEmS5_S6_mPKPvS6_mmff(ptr nocapture noundef nonnull readonly align 8 dereferenceable(80) %0, i32 noundef %1, i32 noundef %2, i64 noundef %3, i64 noundef %4, i64 noundef %5, ptr noundef %6, i32 noundef %7, i64 noundef %8, ptr noundef %9, i32 noundef %10, i64 noundef %11, ptr noundef %12, i32 noundef %13, i64 noundef %14, i64 noundef %15, float noundef %16, float noundef %17) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca float, align 4
  %27 = alloca float, align 4
  %28 = alloca %"class.std::__cxx11::basic_string", align 8
  %29 = alloca %"class.std::allocator", align 1
  %30 = alloca %struct.__half, align 2
  %31 = alloca %struct.__half, align 2
  %32 = alloca %"struct.fastertransformer::cublasLtMatmulAlgo_info", align 4
  store i64 %3, ptr %19, align 8, !tbaa !5
  store i64 %4, ptr %20, align 8, !tbaa !5
  store i64 %5, ptr %21, align 8, !tbaa !5
  store i64 %8, ptr %22, align 8, !tbaa !5
  store i64 %11, ptr %23, align 8, !tbaa !5
  store i64 %14, ptr %24, align 8, !tbaa !5
  store i64 %15, ptr %25, align 8, !tbaa !5
  store float %16, ptr %26, align 4, !tbaa !9
  store float %17, ptr %27, align 4, !tbaa !9
  %33 = tail call noundef nonnull align 8 dereferenceable(88) ptr @_ZN17fastertransformer6Logger9getLoggerEv()
  %34 = tail call noundef i32 @_ZNK17fastertransformer6Logger8getLevelEv(ptr noundef nonnull align 8 dereferenceable(88) %33)
  %35 = icmp slt i32 %34, 1
  br i1 %35, label %36, label %45

36:                                               ; preds = %18
  %37 = tail call noundef nonnull align 8 dereferenceable(88) ptr @_ZN17fastertransformer6Logger9getLoggerEv()
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %29) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %28, ptr noundef nonnull @.str.10, ptr noundef nonnull align 1 dereferenceable(1) %29)
          to label %38 unwind label %40

38:                                               ; preds = %36
  invoke void @_ZN17fastertransformer6Logger3logIJmmmmmmmEEEvNS0_5LevelENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpRKT_(ptr noundef nonnull align 8 dereferenceable(88) %37, i32 noundef 0, ptr noundef nonnull %28, ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %24)
          to label %39 unwind label %42

39:                                               ; preds = %38
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %29) #4
  br label %45

40:                                               ; preds = %36
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %44

42:                                               ; preds = %38
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #4
  br label %44

44:                                               ; preds = %42, %40
  %.pn = phi { ptr, i32 } [ %43, %42 ], [ %41, %40 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %29) #4
  resume { ptr, i32 } %.pn

45:                                               ; preds = %18, %39
  %46 = call noundef i32 @_ZN17fastertransformer18getCublasOperationENS_6GemmOpE(i32 noundef %2)
  %47 = call noundef i32 @_ZN17fastertransformer18getCublasOperationENS_6GemmOpE(i32 noundef %1)
  %48 = call noundef i32 @_ZN17fastertransformer17getCublasDataTypeENS_13datatype_enumE(i32 noundef %10)
  %49 = call noundef i32 @_ZN17fastertransformer17getCublasDataTypeENS_13datatype_enumE(i32 noundef %7)
  %50 = call noundef i32 @_ZN17fastertransformer17getCublasDataTypeENS_13datatype_enumE(i32 noundef %13)
  %51 = load i64, ptr %20, align 8, !tbaa !5
  %52 = load i64, ptr %19, align 8, !tbaa !5
  %53 = load i64, ptr %23, align 8, !tbaa !5
  %54 = load i64, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %30) #4
  call void @_ZN6__halfC2Ef(ptr noundef nonnull align 2 dereferenceable(2) %30, float noundef %16)
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %31) #4
  call void @_ZN6__halfC2Ef(ptr noundef nonnull align 2 dereferenceable(2) %31, float noundef %17)
  %55 = getelementptr inbounds i8, ptr %0, i64 24
  %56 = load ptr, ptr %55, align 8, !tbaa !11
  call void @_ZNSt5mutex4lockEv(ptr noundef nonnull align 8 dereferenceable(40) %56)
  %57 = getelementptr inbounds i8, ptr %0, i64 76
  %58 = load i32, ptr %57, align 4, !tbaa !15
  %59 = icmp eq i32 %58, 10
  %. = select i1 %59, ptr %30, ptr %26
  %60 = select i1 %59, ptr %31, ptr %27
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %32) #4
  %61 = getelementptr inbounds i8, ptr %0, i64 32
  %62 = load ptr, ptr %61, align 8, !tbaa !16
  %63 = load i64, ptr %25, align 8, !tbaa !5
  %64 = trunc i64 %63 to i32
  %65 = load i64, ptr %19, align 8, !tbaa !5
  %66 = trunc i64 %65 to i32
  %67 = load i64, ptr %20, align 8, !tbaa !5
  %68 = trunc i64 %67 to i32
  %69 = load i64, ptr %21, align 8, !tbaa !5
  %70 = trunc i64 %69 to i32
  %71 = icmp eq i32 %48, 2
  %72 = zext i1 %71 to i32
  call void @_ZN17fastertransformer13cublasAlgoMap7getAlgoEiiiiNS_14CublasDataTypeE(ptr dead_on_unwind nonnull writable sret(%"struct.fastertransformer::cublasLtMatmulAlgo_info") align 4 %32, ptr noundef nonnull align 8 dereferenceable(168) %62, i32 noundef %64, i32 noundef %66, i32 noundef %68, i32 noundef %70, i32 noundef %72)
  %73 = getelementptr inbounds i8, ptr %0, i64 40
  %74 = load ptr, ptr %73, align 8, !tbaa !17
  %75 = trunc i64 %51 to i32
  %76 = trunc i64 %52 to i32
  %77 = load i64, ptr %21, align 8, !tbaa !5
  %78 = trunc i64 %77 to i32
  %79 = trunc i64 %53 to i32
  %80 = trunc i64 %54 to i32
  %81 = load i64, ptr %24, align 8, !tbaa !5
  %82 = trunc i64 %81 to i32
  %83 = load i64, ptr %25, align 8, !tbaa !5
  %84 = trunc i64 %83 to i32
  %85 = load i32, ptr %57, align 4, !tbaa !15
  %86 = call noundef i32 @_ZN17fastertransformer20getCublasComputeTypeENS_13datatype_enumE(i32 noundef %85)
  %87 = load i32, ptr %32, align 4, !tbaa !18
  %88 = call i32 @cublasGemmBatchedEx(ptr noundef %74, i32 noundef %46, i32 noundef %47, i32 noundef %75, i32 noundef %76, i32 noundef %78, ptr noundef nonnull %., ptr noundef %9, i32 noundef %48, i32 noundef %79, ptr noundef %6, i32 noundef %49, i32 noundef %80, ptr noundef nonnull %60, ptr noundef %12, i32 noundef %50, i32 noundef %82, i32 noundef %84, i32 noundef %86, i32 noundef %87)
  call void @_ZN17fastertransformer5checkI14cublasStatus_tEEvT_PKcS4_i(i32 noundef %88, ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.1, i32 noundef 477)
  %89 = load ptr, ptr %55, align 8, !tbaa !11
  call void @_ZNSt5mutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(40) %89)
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %32) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %31) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %30) #4
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17fastertransformer6Logger3logIJmmmmmmmEEEvNS0_5LevelENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpRKT_(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

declare i32 @cublasGemmBatchedEx(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

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

!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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !13, i64 24}
!12 = !{!"_ZTSN17fastertransformer4GemmE", !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !14, i64 64, !14, i64 68, !14, i64 72, !14, i64 76}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"_ZTSN17fastertransformer13datatype_enumE", !7, i64 0}
!15 = !{!12, !14, i64 76}
!16 = !{!12, !13, i64 32}
!17 = !{!12, !13, i64 40}
!18 = !{!19, !20, i64 0}
!19 = !{!"_ZTSN17fastertransformer23cublasLtMatmulAlgo_infoE", !20, i64 0, !20, i64 4, !20, i64 8, !20, i64 12, !20, i64 16, !20, i64 20, !20, i64 24, !20, i64 28, !10, i64 32}
!20 = !{!"int", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass