; LLVM IR from NVIDIA/FasterTransformer :: src/fastertransformer/models/decoding (decoding_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 [137 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [56 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 [19 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [18 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.12 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [113 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [107 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [37 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 i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i8, align 1
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = 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
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = icmp ne i32 %21, 10
  br i1 %22, label %23, label %29

23:                                               ; preds = %2
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = icmp ne i32 %24, 11
  br i1 %25, label %26, label %29

26:                                               ; preds = %23
  %27 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %28 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  store i32 0, ptr %3, align 4
  br label %158

29:                                               ; preds = %23, %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %30 = load ptr, ptr %5, align 8, !tbaa !9
  %31 = getelementptr inbounds ptr, ptr %30, i64 1
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  %33 = call i32 @atoi(ptr noundef %32) #7
  store i32 %33, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %34 = load ptr, ptr %5, align 8, !tbaa !9
  %35 = getelementptr inbounds ptr, ptr %34, i64 2
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = call i32 @atoi(ptr noundef %36) #7
  store i32 %37, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %38 = load ptr, ptr %5, align 8, !tbaa !9
  %39 = getelementptr inbounds ptr, ptr %38, i64 3
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  %41 = call i32 @atoi(ptr noundef %40) #7
  store i32 %41, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %42 = load ptr, ptr %5, align 8, !tbaa !9
  %43 = getelementptr inbounds ptr, ptr %42, i64 4
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  %45 = call i32 @atoi(ptr noundef %44) #7
  store i32 %45, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %46 = load ptr, ptr %5, align 8, !tbaa !9
  %47 = getelementptr inbounds ptr, ptr %46, i64 5
  %48 = load ptr, ptr %47, align 8, !tbaa !9
  %49 = call i32 @atoi(ptr noundef %48) #7
  store i32 %49, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %50 = load ptr, ptr %5, align 8, !tbaa !9
  %51 = getelementptr inbounds ptr, ptr %50, i64 6
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  %53 = call i32 @atoi(ptr noundef %52) #7
  store i32 %53, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %54 = load ptr, ptr %5, align 8, !tbaa !9
  %55 = getelementptr inbounds ptr, ptr %54, i64 7
  %56 = load ptr, ptr %55, align 8, !tbaa !9
  %57 = call i32 @atoi(ptr noundef %56) #7
  store i32 %57, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %58 = load ptr, ptr %5, align 8, !tbaa !9
  %59 = getelementptr inbounds ptr, ptr %58, i64 8
  %60 = load ptr, ptr %59, align 8, !tbaa !9
  %61 = call i32 @atoi(ptr noundef %60) #7
  store i32 %61, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %62 = load ptr, ptr %5, align 8, !tbaa !9
  %63 = getelementptr inbounds ptr, ptr %62, i64 9
  %64 = load ptr, ptr %63, align 8, !tbaa !9
  %65 = call i32 @atoi(ptr noundef %64) #7
  store i32 %65, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #6
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = icmp eq i32 %66, 11
  br i1 %67, label %68, label %74

68:                                               ; preds = %29
  %69 = load ptr, ptr %5, align 8, !tbaa !9
  %70 = getelementptr inbounds ptr, ptr %69, i64 10
  %71 = load ptr, ptr %70, align 8, !tbaa !9
  %72 = call i32 @atoi(ptr noundef %71) #7
  %73 = icmp ne i32 %72, 0
  br label %75

74:                                               ; preds = %29
  br label %75

75:                                               ; preds = %74, %68
  %76 = phi i1 [ %73, %68 ], [ false, %74 ]
  %77 = zext i1 %76 to i8
  store i8 %77, ptr %15, align 1, !tbaa !13
  %78 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %79)
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %81)
  %83 = load i32, ptr %8, align 4, !tbaa !5
  %84 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %83)
  %85 = load i32, ptr %9, align 4, !tbaa !5
  %86 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %85)
  %87 = load i32, ptr %10, align 4, !tbaa !5
  %88 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %87)
  %89 = load i32, ptr %11, align 4, !tbaa !5
  %90 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %89)
  %91 = load i32, ptr %12, align 4, !tbaa !5
  %92 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i32 noundef %91)
  %93 = load i32, ptr %13, align 4, !tbaa !5
  %94 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i32 noundef %93)
  %95 = load i32, ptr %14, align 4, !tbaa !11
  %96 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, i32 noundef %95)
  %97 = 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 %16) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %98 = load i32, ptr %6, align 4, !tbaa !5
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = load i32, ptr %12, align 4, !tbaa !5
  %101 = load i32, ptr %8, align 4, !tbaa !5
  %102 = load i32, ptr %9, align 4, !tbaa !5
  %103 = load i32, ptr %10, align 4, !tbaa !5
  %104 = load i32, ptr %13, align 4, !tbaa !5
  %105 = load i32, ptr %11, align 4, !tbaa !5
  %106 = load i32, ptr %14, align 4, !tbaa !11
  %107 = call noundef i64 @_ZN17fastertransformer32calDecodingGemmTestBufSizeInByteEiiiiiiiiNS_14CublasDataTypeE(i32 noundef %98, i32 noundef %99, i32 noundef %100, i32 noundef %101, i32 noundef %102, i32 noundef %103, i32 noundef %104, i32 noundef %105, i32 noundef %106)
  store i64 %107, ptr %17, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %108 = call i32 @cudaMemGetInfo(ptr noundef %19, ptr noundef %18)
  call void @_ZN17fastertransformer5checkI9cudaErrorEEvT_PKcS4_i(i32 noundef %108, ptr noundef @.str.12, ptr noundef @.str.13, i32 noundef 66)
  %109 = load i64, ptr %19, align 8, !tbaa !15
  %110 = load i64, ptr %17, align 8, !tbaa !15
  %111 = add i64 %110, 10485760
  %112 = icmp ult i64 %109, %111
  br i1 %112, label %113, label %117

113:                                              ; preds = %75
  %114 = load i64, ptr %17, align 8, !tbaa !15
  %115 = load i64, ptr %19, align 8, !tbaa !15
  %116 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, i64 noundef %114, i64 noundef %115)
  store ptr null, ptr %16, align 8, !tbaa !9
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %157

117:                                              ; preds = %75
  %118 = load i64, ptr %17, align 8, !tbaa !15
  call void @_ZN17fastertransformer12deviceMallocIcEEvPPT_mb(ptr noundef %16, i64 noundef %118, i1 noundef zeroext false)
  br label %119

119:                                              ; preds = %117
  %120 = load i32, ptr %14, align 4, !tbaa !11
  %121 = icmp eq i32 %120, 0
  br i1 %121, label %122, label %134

122:                                              ; preds = %119
  %123 = load i32, ptr %6, align 4, !tbaa !5
  %124 = load i32, ptr %7, align 4, !tbaa !5
  %125 = load i32, ptr %12, align 4, !tbaa !5
  %126 = load i32, ptr %8, align 4, !tbaa !5
  %127 = load i32, ptr %9, align 4, !tbaa !5
  %128 = load i32, ptr %10, align 4, !tbaa !5
  %129 = load i32, ptr %11, align 4, !tbaa !5
  %130 = load i32, ptr %13, align 4, !tbaa !5
  %131 = load ptr, ptr %16, align 8, !tbaa !9
  %132 = load i8, ptr %15, align 1, !tbaa !13, !range !17, !noundef !18
  %133 = trunc i8 %132 to i1
  call void @_ZN17fastertransformer29generate_decoding_gemm_configIfEEviiiiiiiiPvb(i32 noundef %123, i32 noundef %124, i32 noundef %125, i32 noundef %126, i32 noundef %127, i32 noundef %128, i32 noundef %129, i32 noundef %130, ptr noundef %131, i1 noundef zeroext %133)
  br label %152

134:                                              ; preds = %119
  %135 = load i32, ptr %14, align 4, !tbaa !11
  %136 = icmp eq i32 %135, 1
  br i1 %136, label %137, label %149

137:                                              ; preds = %134
  %138 = load i32, ptr %6, align 4, !tbaa !5
  %139 = load i32, ptr %7, align 4, !tbaa !5
  %140 = load i32, ptr %12, align 4, !tbaa !5
  %141 = load i32, ptr %8, align 4, !tbaa !5
  %142 = load i32, ptr %9, align 4, !tbaa !5
  %143 = load i32, ptr %10, align 4, !tbaa !5
  %144 = load i32, ptr %11, align 4, !tbaa !5
  %145 = load i32, ptr %13, align 4, !tbaa !5
  %146 = load ptr, ptr %16, align 8, !tbaa !9
  %147 = load i8, ptr %15, align 1, !tbaa !13, !range !17, !noundef !18
  %148 = trunc i8 %147 to i1
  call void @_ZN17fastertransformer29generate_decoding_gemm_configI6__halfEEviiiiiiiiPvb(i32 noundef %138, i32 noundef %139, i32 noundef %140, i32 noundef %141, i32 noundef %142, i32 noundef %143, i32 noundef %144, i32 noundef %145, ptr noundef %146, i1 noundef zeroext %148)
  br label %151

149:                                              ; preds = %134
  %150 = call i32 (ptr, ...) @printf(ptr noundef @.str.15)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %157

151:                                              ; preds = %137
  br label %152

152:                                              ; preds = %151, %122
  %153 = load ptr, ptr %16, align 8, !tbaa !9
  %154 = call i32 @cudaFree(ptr noundef %153)
  call void @_ZN17fastertransformer5checkI9cudaErrorEEvT_PKcS4_i(i32 noundef %154, ptr noundef @.str.16, ptr noundef @.str.13, i32 noundef 122)
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.17)
  %156 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %155, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %157

157:                                              ; preds = %152, %149, %113
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, 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 %158

158:                                              ; preds = %157, %26
  %159 = load i32, ptr %3, align 4
  ret i32 %159
}

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 @_ZN17fastertransformer32calDecodingGemmTestBufSizeInByteEiiiiiiiiNS_14CublasDataTypeE(i32 noundef, 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 @_ZN17fastertransformer29generate_decoding_gemm_configIfEEviiiiiiiiPvb(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i1 noundef zeroext) #1

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

declare i32 @cudaFree(ptr noundef) #1

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

; 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 = !{!"bool", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}


; 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 [137 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [56 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 [19 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [18 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.12 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [113 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [107 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [37 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
  %6 = add i32 %0, -12
  %or.cond = icmp ult i32 %6, -2
  br i1 %or.cond, label %7, label %10

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

10:                                               ; preds = %2
  %11 = getelementptr inbounds i8, ptr %1, i64 8
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = tail call i32 @atoi(ptr nocapture noundef %12) #7
  %14 = getelementptr inbounds i8, ptr %1, i64 16
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  %16 = tail call i32 @atoi(ptr nocapture noundef %15) #7
  %17 = getelementptr inbounds i8, ptr %1, i64 24
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = tail call i32 @atoi(ptr nocapture noundef %18) #7
  %20 = getelementptr inbounds i8, ptr %1, i64 32
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  %22 = tail call i32 @atoi(ptr nocapture noundef %21) #7
  %23 = getelementptr inbounds i8, ptr %1, i64 40
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = tail call i32 @atoi(ptr nocapture noundef %24) #7
  %26 = getelementptr inbounds i8, ptr %1, i64 48
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  %28 = tail call i32 @atoi(ptr nocapture noundef %27) #7
  %29 = getelementptr inbounds i8, ptr %1, i64 56
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  %31 = tail call i32 @atoi(ptr nocapture noundef %30) #7
  %32 = getelementptr inbounds i8, ptr %1, i64 64
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  %34 = tail call i32 @atoi(ptr nocapture noundef %33) #7
  %35 = getelementptr inbounds i8, ptr %1, i64 72
  %36 = load ptr, ptr %35, align 8, !tbaa !5
  %37 = tail call i32 @atoi(ptr nocapture noundef %36) #7
  %38 = icmp eq i32 %0, 11
  br i1 %38, label %39, label %44

39:                                               ; preds = %10
  %40 = getelementptr inbounds i8, ptr %1, i64 80
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  %42 = tail call i32 @atoi(ptr nocapture noundef %41) #7
  %43 = icmp ne i32 %42, 0
  br label %44

44:                                               ; preds = %10, %39
  %45 = phi i1 [ %43, %39 ], [ false, %10 ]
  %46 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %47 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %13)
  %48 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %16)
  %49 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %19)
  %50 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %22)
  %51 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %25)
  %52 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %28)
  %53 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %31)
  %54 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef %34)
  %55 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %37)
  %56 = 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
  %57 = tail call noundef i64 @_ZN17fastertransformer32calDecodingGemmTestBufSizeInByteEiiiiiiiiNS_14CublasDataTypeE(i32 noundef %13, i32 noundef %16, i32 noundef %31, i32 noundef %19, i32 noundef %22, i32 noundef %25, i32 noundef %34, i32 noundef %28, i32 noundef %37)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %58 = call i32 @cudaMemGetInfo(ptr noundef nonnull %5, ptr noundef nonnull %4)
  call void @_ZN17fastertransformer5checkI9cudaErrorEEvT_PKcS4_i(i32 noundef %58, ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.13, i32 noundef 66)
  %59 = load i64, ptr %5, align 8, !tbaa !9
  %60 = add i64 %57, 10485760
  %61 = icmp ult i64 %59, %60
  br i1 %61, label %62, label %64

62:                                               ; preds = %44
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, i64 noundef %57, i64 noundef %59)
  br label %76

64:                                               ; preds = %44
  call void @_ZN17fastertransformer12deviceMallocIcEEvPPT_mb(ptr noundef nonnull %3, i64 noundef %57, i1 noundef zeroext false)
  switch i32 %37, label %69 [
    i32 0, label %65
    i32 1, label %67
  ]

65:                                               ; preds = %64
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN17fastertransformer29generate_decoding_gemm_configIfEEviiiiiiiiPvb(i32 noundef %13, i32 noundef %16, i32 noundef %31, i32 noundef %19, i32 noundef %22, i32 noundef %25, i32 noundef %28, i32 noundef %34, ptr noundef %66, i1 noundef zeroext %45)
  br label %71

67:                                               ; preds = %64
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN17fastertransformer29generate_decoding_gemm_configI6__halfEEviiiiiiiiPvb(i32 noundef %13, i32 noundef %16, i32 noundef %31, i32 noundef %19, i32 noundef %22, i32 noundef %25, i32 noundef %28, i32 noundef %34, ptr noundef %68, i1 noundef zeroext %45)
  br label %71

69:                                               ; preds = %64
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15)
  br label %76

71:                                               ; preds = %67, %65
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = call i32 @cudaFree(ptr noundef %72)
  call void @_ZN17fastertransformer5checkI9cudaErrorEEvT_PKcS4_i(i32 noundef %73, ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.13, i32 noundef 122)
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.17)
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %74, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %76

76:                                               ; preds = %71, %69, %62
  %.0 = phi i32 [ -1, %62 ], [ 0, %71 ], [ -1, %69 ]
  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 %77

77:                                               ; preds = %76, %7
  %.1 = phi i32 [ 0, %7 ], [ %.0, %76 ]
  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 @_ZN17fastertransformer32calDecodingGemmTestBufSizeInByteEiiiiiiiiNS_14CublasDataTypeE(i32 noundef, 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 @_ZN17fastertransformer29generate_decoding_gemm_configIfEEviiiiiiiiPvb(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #6

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

declare i32 @cudaFree(ptr noundef) local_unnamed_addr #6

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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,SROAPass,SimplifyCFGPass,TailCallElimPass