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

; 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.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

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

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) #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN17fastertransformer27calGptGemmTestBufSizeInByteEmmmmmmmmNS_14CublasDataTypeE(i64 noundef %0, i64 noundef %1, i64 noundef %2, i64 noundef %3, i64 noundef %4, i64 noundef %5, i64 noundef %6, i64 noundef %7, i32 noundef %8) #2 personality ptr @__gxx_personality_v0 {
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  %24 = alloca i64, align 8
  %25 = alloca %"class.std::vector.3", align 8
  %26 = alloca i64, align 8
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  %29 = alloca i64, align 8
  %30 = alloca i64, align 8
  %31 = alloca i64, align 8
  %32 = alloca ptr, align 8
  %33 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %34 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %35 = alloca i64, align 8
  store i64 %0, ptr %10, align 8, !tbaa !5
  store i64 %1, ptr %11, align 8, !tbaa !5
  store i64 %2, ptr %12, align 8, !tbaa !5
  store i64 %3, ptr %13, align 8, !tbaa !5
  store i64 %4, ptr %14, align 8, !tbaa !5
  store i64 %5, ptr %15, align 8, !tbaa !5
  store i64 %6, ptr %16, align 8, !tbaa !5
  store i64 %7, ptr %17, align 8, !tbaa !5
  store i32 %8, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  store i64 0, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %36 = load i64, ptr %13, align 8, !tbaa !5
  %37 = load i64, ptr %14, align 8, !tbaa !5
  %38 = mul i64 %36, %37
  store i64 %38, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %39 = load i64, ptr %13, align 8, !tbaa !5
  %40 = load i64, ptr %17, align 8, !tbaa !5
  %41 = udiv i64 %39, %40
  store i64 %41, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %42 = load i64, ptr %21, align 8, !tbaa !5
  %43 = load i64, ptr %14, align 8, !tbaa !5
  %44 = mul i64 %42, %43
  store i64 %44, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 4, ptr %23, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %45 = load i64, ptr %10, align 8, !tbaa !5
  %46 = load i64, ptr %11, align 8, !tbaa !5
  %47 = mul i64 %45, %46
  %48 = load i64, ptr %12, align 8, !tbaa !5
  %49 = mul i64 %47, %48
  store i64 %49, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #5
  call void @_ZNSt6vectorImSaImEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %50 = load i64, ptr %24, align 8, !tbaa !5
  %51 = load i64, ptr %20, align 8, !tbaa !5
  %52 = mul i64 %50, %51
  %53 = load i64, ptr %20, align 8, !tbaa !5
  %54 = mul i64 %53, 3
  %55 = load i64, ptr %22, align 8, !tbaa !5
  %56 = mul i64 %54, %55
  %57 = add i64 %52, %56
  %58 = load i64, ptr %24, align 8, !tbaa !5
  %59 = mul i64 %58, 3
  %60 = load i64, ptr %22, align 8, !tbaa !5
  %61 = mul i64 %59, %60
  %62 = add i64 %57, %61
  store i64 %62, ptr %26, align 8, !tbaa !5
  invoke void @_ZNSt6vectorImSaImEE9push_backEOm(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 8 dereferenceable(8) %26)
          to label %63 unwind label %137

63:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  %64 = load i64, ptr %24, align 8, !tbaa !5
  %65 = load i64, ptr %22, align 8, !tbaa !5
  %66 = mul i64 %64, %65
  %67 = load i64, ptr %24, align 8, !tbaa !5
  %68 = load i64, ptr %22, align 8, !tbaa !5
  %69 = mul i64 %67, %68
  %70 = add i64 %66, %69
  %71 = load i64, ptr %10, align 8, !tbaa !5
  %72 = load i64, ptr %11, align 8, !tbaa !5
  %73 = mul i64 %71, %72
  %74 = load i64, ptr %13, align 8, !tbaa !5
  %75 = mul i64 %73, %74
  %76 = load i64, ptr %12, align 8, !tbaa !5
  %77 = mul i64 %75, %76
  %78 = load i64, ptr %12, align 8, !tbaa !5
  %79 = mul i64 %77, %78
  %80 = add i64 %70, %79
  store i64 %80, ptr %29, align 8, !tbaa !5
  invoke void @_ZNSt6vectorImSaImEE9push_backEOm(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 8 dereferenceable(8) %29)
          to label %81 unwind label %141

81:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  %82 = load i64, ptr %24, align 8, !tbaa !5
  %83 = load i64, ptr %15, align 8, !tbaa !5
  %84 = mul i64 %82, %83
  %85 = load i64, ptr %17, align 8, !tbaa !5
  %86 = udiv i64 %84, %85
  %87 = load i64, ptr %20, align 8, !tbaa !5
  %88 = load i64, ptr %15, align 8, !tbaa !5
  %89 = mul i64 %87, %88
  %90 = load i64, ptr %17, align 8, !tbaa !5
  %91 = udiv i64 %89, %90
  %92 = add i64 %86, %91
  %93 = load i64, ptr %24, align 8, !tbaa !5
  %94 = load i64, ptr %20, align 8, !tbaa !5
  %95 = mul i64 %93, %94
  %96 = add i64 %92, %95
  store i64 %96, ptr %30, align 8, !tbaa !5
  invoke void @_ZNSt6vectorImSaImEE9push_backEOm(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 8 dereferenceable(8) %30)
          to label %97 unwind label %145

97:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  %98 = load i64, ptr %24, align 8, !tbaa !5
  %99 = load i64, ptr %20, align 8, !tbaa !5
  %100 = mul i64 %98, %99
  %101 = uitofp i64 %100 to double
  %102 = load i64, ptr %20, align 8, !tbaa !5
  %103 = uitofp i64 %102 to double
  %104 = load i64, ptr %16, align 8, !tbaa !5
  %105 = uitofp i64 %104 to double
  %106 = fdiv double %105, 8.000000e+00
  %107 = call double @llvm.ceil.f64(double %106)
  %108 = fmul double %103, %107
  %109 = fmul double %108, 8.000000e+00
  %110 = load i64, ptr %17, align 8, !tbaa !5
  %111 = uitofp i64 %110 to double
  %112 = fdiv double %109, %111
  %113 = fadd double %101, %112
  %114 = load i64, ptr %24, align 8, !tbaa !5
  %115 = uitofp i64 %114 to double
  %116 = load i64, ptr %16, align 8, !tbaa !5
  %117 = uitofp i64 %116 to double
  %118 = fdiv double %117, 8.000000e+00
  %119 = call double @llvm.ceil.f64(double %118)
  %120 = fmul double %115, %119
  %121 = fmul double %120, 8.000000e+00
  %122 = load i64, ptr %17, align 8, !tbaa !5
  %123 = uitofp i64 %122 to double
  %124 = fdiv double %121, %123
  %125 = fadd double %113, %124
  %126 = fptoui double %125 to i64
  store i64 %126, ptr %31, align 8, !tbaa !5
  invoke void @_ZNSt6vectorImSaImEE9push_backEOm(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 8 dereferenceable(8) %31)
          to label %127 unwind label %149

127:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #5
  store ptr %25, ptr %32, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #5
  %128 = load ptr, ptr %32, align 8, !tbaa !13
  %129 = call ptr @_ZNSt6vectorImSaImEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %128) #5
  %130 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %33, i32 0, i32 0
  store ptr %129, ptr %130, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #5
  %131 = load ptr, ptr %32, align 8, !tbaa !13
  %132 = call ptr @_ZNSt6vectorImSaImEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %131) #5
  %133 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %34, i32 0, i32 0
  store ptr %132, ptr %133, align 8
  br label %134

134:                                              ; preds = %165, %127
  %135 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPmSt6vectorImSaImEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull align 8 dereferenceable(8) %34) #5
  br i1 %135, label %153, label %136

136:                                              ; preds = %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  br label %167

137:                                              ; preds = %9
  %138 = landingpad { ptr, i32 }
          cleanup
  %139 = extractvalue { ptr, i32 } %138, 0
  store ptr %139, ptr %27, align 8
  %140 = extractvalue { ptr, i32 } %138, 1
  store i32 %140, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  br label %188

141:                                              ; preds = %63
  %142 = landingpad { ptr, i32 }
          cleanup
  %143 = extractvalue { ptr, i32 } %142, 0
  store ptr %143, ptr %27, align 8
  %144 = extractvalue { ptr, i32 } %142, 1
  store i32 %144, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  br label %188

145:                                              ; preds = %81
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %27, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  br label %188

149:                                              ; preds = %97
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %27, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  br label %188

153:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #5
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPmSt6vectorImSaImEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %33) #5
  %155 = load i64, ptr %154, align 8, !tbaa !5
  store i64 %155, ptr %35, align 8, !tbaa !5
  %156 = load i64, ptr %19, align 8, !tbaa !5
  %157 = load i64, ptr %35, align 8, !tbaa !5
  %158 = icmp ugt i64 %156, %157
  br i1 %158, label %159, label %161

159:                                              ; preds = %153
  %160 = load i64, ptr %19, align 8, !tbaa !5
  br label %163

161:                                              ; preds = %153
  %162 = load i64, ptr %35, align 8, !tbaa !5
  br label %163

163:                                              ; preds = %161, %159
  %164 = phi i64 [ %160, %159 ], [ %162, %161 ]
  store i64 %164, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #5
  br label %165

165:                                              ; preds = %163
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPmSt6vectorImSaImEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %33) #5
  br label %134

167:                                              ; preds = %136
  %168 = load i32, ptr %23, align 4, !tbaa !11
  %169 = sext i32 %168 to i64
  %170 = load i64, ptr %19, align 8, !tbaa !5
  %171 = mul i64 %170, %169
  store i64 %171, ptr %19, align 8, !tbaa !5
  %172 = load i32, ptr %18, align 4, !tbaa !9
  %173 = icmp eq i32 %172, 1
  br i1 %173, label %180, label %174

174:                                              ; preds = %167
  %175 = load i32, ptr %18, align 4, !tbaa !9
  %176 = icmp eq i32 %175, 2
  br i1 %176, label %180, label %177

177:                                              ; preds = %174
  %178 = load i32, ptr %18, align 4, !tbaa !9
  %179 = icmp eq i32 %178, 4
  br label %180

180:                                              ; preds = %177, %174, %167
  %181 = phi i1 [ true, %174 ], [ true, %167 ], [ %179, %177 ]
  %182 = zext i1 %181 to i64
  %183 = select i1 %181, i32 33554432, i32 0
  %184 = sext i32 %183 to i64
  %185 = load i64, ptr %19, align 8, !tbaa !5
  %186 = add i64 %185, %184
  store i64 %186, ptr %19, align 8, !tbaa !5
  %187 = load i64, ptr %19, align 8, !tbaa !5
  call void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  ret i64 %187

188:                                              ; preds = %149, %145, %141, %137
  call void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %189

189:                                              ; preds = %188
  %190 = load ptr, ptr %27, align 8
  %191 = load i32, ptr %28, align 4
  %192 = insertvalue { ptr, i32 } poison, ptr %190, 0
  %193 = insertvalue { ptr, i32 } %192, i32 %191, 1
  resume { ptr, i32 } %193
}

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPmSt6vectorImSaImEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPmSt6vectorImSaImEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPmSt6vectorImSaImEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 = { 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 = { 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 = { 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 = !{!"_ZTSN17fastertransformer14CublasDataTypeE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !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"

%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

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

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) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN17fastertransformer27calGptGemmTestBufSizeInByteEmmmmmmmmNS_14CublasDataTypeE(i64 noundef %0, i64 noundef %1, i64 noundef %2, i64 noundef %3, i64 noundef %4, i64 noundef %5, i64 noundef %6, i64 noundef %7, i32 noundef %8) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %10 = alloca %"class.std::vector.3", align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = mul i64 %4, %3
  %18 = udiv i64 %3, %7
  %19 = mul i64 %18, %4
  %20 = mul i64 %1, %0
  %21 = mul i64 %20, %2
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #6
  call void @_ZNSt6vectorImSaImEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  %22 = mul i64 %17, %21
  %reass.add59 = add i64 %17, %21
  %reass.mul60 = mul i64 %19, 3
  %reass.mul = mul i64 %reass.mul60, %reass.add59
  %23 = add i64 %reass.mul, %22
  store i64 %23, ptr %11, align 8, !tbaa !5
  invoke void @_ZNSt6vectorImSaImEE9push_backEOm(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %24 unwind label %64

24:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  %25 = mul i64 %19, %21
  %26 = shl i64 %25, 1
  %27 = mul i64 %21, %2
  %28 = mul i64 %27, %3
  %29 = add i64 %26, %28
  store i64 %29, ptr %12, align 8, !tbaa !5
  invoke void @_ZNSt6vectorImSaImEE9push_backEOm(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %30 unwind label %66

30:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  %31 = mul i64 %21, %5
  %32 = udiv i64 %31, %7
  %33 = mul i64 %17, %5
  %34 = udiv i64 %33, %7
  %35 = add i64 %32, %22
  %36 = add i64 %35, %34
  store i64 %36, ptr %13, align 8, !tbaa !5
  invoke void @_ZNSt6vectorImSaImEE9push_backEOm(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %37 unwind label %68

37:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #6
  %38 = uitofp i64 %22 to double
  %39 = uitofp i64 %17 to double
  %40 = uitofp i64 %6 to double
  %41 = fmul double %40, 1.250000e-01
  %42 = call double @llvm.ceil.f64(double %41)
  %43 = fmul double %42, %39
  %44 = fmul double %43, 8.000000e+00
  %45 = uitofp i64 %7 to double
  %46 = fdiv double %44, %45
  %47 = fadd double %46, %38
  %48 = uitofp i64 %21 to double
  %49 = fmul double %42, %48
  %50 = fmul double %49, 8.000000e+00
  %51 = fdiv double %50, %45
  %52 = fadd double %51, %47
  %53 = fptoui double %52 to i64
  store i64 %53, ptr %14, align 8, !tbaa !5
  invoke void @_ZNSt6vectorImSaImEE9push_backEOm(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %54 unwind label %70

54:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #6
  %55 = call ptr @_ZNSt6vectorImSaImEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  store ptr %55, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #6
  %56 = call ptr @_ZNSt6vectorImSaImEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  store ptr %56, ptr %16, align 8
  %57 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPmSt6vectorImSaImEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #6
  br i1 %57, label %.lr.ph, label %._crit_edge

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %58 = shl i64 %74, 2
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %54
  %.0.lcssa = phi i64 [ 0, %54 ], [ %58, %._crit_edge.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  %59 = add i32 %8, -1
  %or.cond = icmp ult i32 %59, 2
  %60 = icmp eq i32 %8, 4
  %61 = or i1 %60, %or.cond
  %62 = select i1 %61, i64 33554432, i64 0
  %63 = add i64 %.0.lcssa, %62
  call void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  ret i64 %63

64:                                               ; preds = %9
  %65 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  br label %77

66:                                               ; preds = %24
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  br label %77

68:                                               ; preds = %30
  %69 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  br label %77

70:                                               ; preds = %37
  %71 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  br label %77

.lr.ph:                                           ; preds = %54, %.lr.ph
  %.061 = phi i64 [ %74, %.lr.ph ], [ 0, %54 ]
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPmSt6vectorImSaImEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  %73 = load i64, ptr %72, align 8, !tbaa !5
  %74 = call i64 @llvm.umax.i64(i64 %.061, i64 %73)
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPmSt6vectorImSaImEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  %76 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPmSt6vectorImSaImEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #6
  br i1 %76, label %.lr.ph, label %._crit_edge.loopexit

77:                                               ; preds = %70, %68, %66, %64
  %.pn = phi { ptr, i32 } [ %71, %70 ], [ %69, %68 ], [ %67, %66 ], [ %65, %64 ]
  call void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  resume { ptr, i32 } %.pn
}

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPmSt6vectorImSaImEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPmSt6vectorImSaImEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPmSt6vectorImSaImEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 = { 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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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"}


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