; LLVM IR from NVIDIA/FasterTransformer :: src/fastertransformer/models/wenet (wenet_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"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@.str = external hidden unnamed_addr constant [76 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [18 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.7 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [107 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [107 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = icmp ne i32 %18, 6
  br i1 %19, label %20, label %23

20:                                               ; preds = %2
  %21 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %22 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  store i32 0, ptr %3, align 4
  br label %101

23:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  %25 = getelementptr inbounds ptr, ptr %24, i64 1
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = call i32 @atoi(ptr noundef %26) #7
  store i32 %27, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %28 = load ptr, ptr %5, align 8, !tbaa !9
  %29 = getelementptr inbounds ptr, ptr %28, i64 2
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  %31 = call i32 @atoi(ptr noundef %30) #7
  store i32 %31, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %32 = load ptr, ptr %5, align 8, !tbaa !9
  %33 = getelementptr inbounds ptr, ptr %32, i64 3
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  %35 = call i32 @atoi(ptr noundef %34) #7
  store i32 %35, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %36 = load ptr, ptr %5, align 8, !tbaa !9
  %37 = getelementptr inbounds ptr, ptr %36, i64 4
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  %39 = call i32 @atoi(ptr noundef %38) #7
  store i32 %39, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %40 = load ptr, ptr %5, align 8, !tbaa !9
  %41 = getelementptr inbounds ptr, ptr %40, i64 5
  %42 = load ptr, ptr %41, align 8, !tbaa !9
  %43 = call i32 @atoi(ptr noundef %42) #7
  store i32 %43, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %44 = load i32, ptr %8, align 4, !tbaa !5
  %45 = mul nsw i32 4, %44
  %46 = load i32, ptr %9, align 4, !tbaa !5
  %47 = mul nsw i32 %45, %46
  store i32 %47, ptr %12, align 4, !tbaa !5
  %48 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  %49 = load i32, ptr %6, align 4, !tbaa !5
  %50 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %49)
  %51 = load i32, ptr %8, align 4, !tbaa !5
  %52 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %51)
  %53 = load i32, ptr %9, align 4, !tbaa !5
  %54 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %53)
  %55 = load i32, ptr %10, align 4, !tbaa !11
  %56 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %55)
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = load i32, ptr %7, align 4, !tbaa !5
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = load i32, ptr %9, align 4, !tbaa !5
  %62 = load i32, ptr %12, align 4, !tbaa !5
  %63 = load i32, ptr %10, align 4, !tbaa !11
  %64 = call noundef i64 @_ZN17fastertransformer24calGemmTestBufSizeInByteEiiiiiiiNS_14CublasDataTypeE(i32 noundef %58, i32 noundef %59, i32 noundef %60, i32 noundef %61, i32 noundef %62, i32 noundef 0, i32 noundef 0, i32 noundef %63)
  store i64 %64, ptr %14, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %65 = call i32 @cudaMemGetInfo(ptr noundef %16, ptr noundef %15)
  call void @_ZN17fastertransformer5checkI9cudaErrorEEvT_PKcS4_i(i32 noundef %65, ptr noundef @.str.7, ptr noundef @.str.8, i32 noundef 50)
  %66 = load i64, ptr %16, align 8, !tbaa !13
  %67 = load i64, ptr %14, align 8, !tbaa !13
  %68 = add i64 %67, 10485760
  %69 = icmp ult i64 %66, %68
  br i1 %69, label %70, label %74

70:                                               ; preds = %23
  %71 = load i64, ptr %14, align 8, !tbaa !13
  %72 = load i64, ptr %16, align 8, !tbaa !13
  %73 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i64 noundef %71, i64 noundef %72)
  store ptr null, ptr %13, align 8, !tbaa !9
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %100

74:                                               ; preds = %23
  %75 = load i64, ptr %14, align 8, !tbaa !13
  call void @_ZN17fastertransformer12deviceMallocIcEEvPPT_mb(ptr noundef %13, i64 noundef %75, i1 noundef zeroext false)
  br label %76

76:                                               ; preds = %74
  %77 = load i32, ptr %10, align 4, !tbaa !11
  %78 = icmp eq i32 %77, 0
  br i1 %78, label %79, label %85

79:                                               ; preds = %76
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = load i32, ptr %8, align 4, !tbaa !5
  %83 = load i32, ptr %9, align 4, !tbaa !5
  %84 = load ptr, ptr %13, align 8, !tbaa !9
  call void @_ZN17fastertransformer28generate_encoder_gemm_configIfEEviiiiPvbi(i32 noundef %80, i32 noundef %81, i32 noundef %82, i32 noundef %83, ptr noundef %84, i1 noundef zeroext false, i32 noundef 1)
  br label %97

85:                                               ; preds = %76
  %86 = load i32, ptr %10, align 4, !tbaa !11
  %87 = icmp eq i32 %86, 1
  br i1 %87, label %88, label %94

88:                                               ; preds = %85
  %89 = load i32, ptr %6, align 4, !tbaa !5
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = load i32, ptr %8, align 4, !tbaa !5
  %92 = load i32, ptr %9, align 4, !tbaa !5
  %93 = load ptr, ptr %13, align 8, !tbaa !9
  call void @_ZN17fastertransformer28generate_encoder_gemm_configI6__halfEEviiiiPvbi(i32 noundef %89, i32 noundef %90, i32 noundef %91, i32 noundef %92, ptr noundef %93, i1 noundef zeroext false, i32 noundef 1)
  br label %96

94:                                               ; preds = %85
  %95 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %100

96:                                               ; preds = %88
  br label %97

97:                                               ; preds = %96, %79
  %98 = load ptr, ptr %13, align 8, !tbaa !9
  %99 = call i32 @cudaFree(ptr noundef %98)
  call void @_ZN17fastertransformer5checkI9cudaErrorEEvT_PKcS4_i(i32 noundef %99, ptr noundef @.str.11, ptr noundef @.str.8, i32 noundef 81)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %100

100:                                              ; preds = %97, %94, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %101

101:                                              ; preds = %100, %20
  %102 = load i32, ptr %3, align 4
  ret i32 %102
}

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

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

; Function Attrs: inlinehint mustprogress nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

declare noundef i64 @_ZN17fastertransformer24calGemmTestBufSizeInByteEiiiiiiiNS_14CublasDataTypeE(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

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

declare i32 @cudaMemGetInfo(ptr noundef, ptr noundef) #1

declare void @_ZN17fastertransformer12deviceMallocIcEEvPPT_mb(ptr noundef, i64 noundef, i1 noundef zeroext) #1

declare void @_ZN17fastertransformer28generate_encoder_gemm_configIfEEviiiiPvbi(i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i1 noundef zeroext, i32 noundef) #1

declare void @_ZN17fastertransformer28generate_encoder_gemm_configI6__halfEEviiiiPvbi(i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i1 noundef zeroext, i32 noundef) #1

declare i32 @cudaFree(ptr noundef) #1

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

attributes #0 = { mustprogress norecurse 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 = { "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 = { inlinehint mustprogress nounwind willreturn memory(read) 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 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTSN17fastertransformer14CublasDataTypeE", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@.str = external hidden unnamed_addr constant [76 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [18 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.7 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [107 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [107 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef range(i32 -1, 1) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %.not = icmp eq i32 %0, 6
  br i1 %.not, label %9, label %6

6:                                                ; preds = %2
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %51

9:                                                ; preds = %2
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = tail call i32 @atoi(ptr nocapture noundef %11) #7
  %13 = getelementptr inbounds i8, ptr %1, i64 16
  %14 = load ptr, ptr %13, align 8, !tbaa !5
  %15 = tail call i32 @atoi(ptr nocapture noundef %14) #7
  %16 = getelementptr inbounds i8, ptr %1, i64 24
  %17 = load ptr, ptr %16, align 8, !tbaa !5
  %18 = tail call i32 @atoi(ptr nocapture noundef %17) #7
  %19 = getelementptr inbounds i8, ptr %1, i64 32
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  %21 = tail call i32 @atoi(ptr nocapture noundef %20) #7
  %22 = getelementptr inbounds i8, ptr %1, i64 40
  %23 = load ptr, ptr %22, align 8, !tbaa !5
  %24 = tail call i32 @atoi(ptr nocapture noundef %23) #7
  %25 = shl nsw i32 %18, 2
  %26 = mul nsw i32 %25, %21
  %27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %12)
  %29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %18)
  %30 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %21)
  %31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %24)
  %32 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %33 = tail call noundef i64 @_ZN17fastertransformer24calGemmTestBufSizeInByteEiiiiiiiNS_14CublasDataTypeE(i32 noundef %12, i32 noundef %15, i32 noundef %18, i32 noundef %21, i32 noundef %26, i32 noundef 0, i32 noundef 0, i32 noundef %24)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %34 = call i32 @cudaMemGetInfo(ptr noundef nonnull %5, ptr noundef nonnull %4)
  call void @_ZN17fastertransformer5checkI9cudaErrorEEvT_PKcS4_i(i32 noundef %34, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.8, i32 noundef 50)
  %35 = load i64, ptr %5, align 8, !tbaa !9
  %36 = add i64 %33, 10485760
  %37 = icmp ult i64 %35, %36
  br i1 %37, label %38, label %40

38:                                               ; preds = %9
  %39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i64 noundef %33, i64 noundef %35)
  br label %50

40:                                               ; preds = %9
  call void @_ZN17fastertransformer12deviceMallocIcEEvPPT_mb(ptr noundef nonnull %3, i64 noundef %33, i1 noundef zeroext false)
  switch i32 %24, label %45 [
    i32 0, label %41
    i32 1, label %43
  ]

41:                                               ; preds = %40
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN17fastertransformer28generate_encoder_gemm_configIfEEviiiiPvbi(i32 noundef %12, i32 noundef %15, i32 noundef %18, i32 noundef %21, ptr noundef %42, i1 noundef zeroext false, i32 noundef 1)
  br label %47

43:                                               ; preds = %40
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN17fastertransformer28generate_encoder_gemm_configI6__halfEEviiiiPvbi(i32 noundef %12, i32 noundef %15, i32 noundef %18, i32 noundef %21, ptr noundef %44, i1 noundef zeroext false, i32 noundef 1)
  br label %47

45:                                               ; preds = %40
  %46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  br label %50

47:                                               ; preds = %43, %41
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = call i32 @cudaFree(ptr noundef %48)
  call void @_ZN17fastertransformer5checkI9cudaErrorEEvT_PKcS4_i(i32 noundef %49, ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.8, i32 noundef 81)
  br label %50

50:                                               ; preds = %47, %45, %38
  %.0 = phi i32 [ -1, %38 ], [ 0, %47 ], [ -1, %45 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  br label %51

51:                                               ; preds = %50, %6
  %.1 = phi i32 [ 0, %6 ], [ %.0, %50 ]
  ret i32 %.1
}

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

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

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

declare noundef i64 @_ZN17fastertransformer24calGemmTestBufSizeInByteEiiiiiiiNS_14CublasDataTypeE(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #6

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

declare i32 @cudaMemGetInfo(ptr noundef, ptr noundef) local_unnamed_addr #6

declare void @_ZN17fastertransformer12deviceMallocIcEEvPPT_mb(ptr noundef, i64 noundef, i1 noundef zeroext) local_unnamed_addr #6

declare void @_ZN17fastertransformer28generate_encoder_gemm_configIfEEviiiiPvbi(i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i1 noundef zeroext, i32 noundef) local_unnamed_addr #6

declare void @_ZN17fastertransformer28generate_encoder_gemm_configI6__halfEEviiiiPvbi(i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i1 noundef zeroext, i32 noundef) local_unnamed_addr #6

declare i32 @cudaFree(ptr noundef) local_unnamed_addr #6

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

attributes #0 = { mustprogress norecurse 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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 = { 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 #5 = { 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 #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 = { nounwind willreturn memory(read) }
attributes #8 = { 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 = !{!"long", !7, i64 0}


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