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

; 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::__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::__cxx11::basic_stringstream" = type { %"class.std::basic_iostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_iostream.base" = type { %"class.std::basic_istream.base", %"class.std::basic_ostream.base" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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::allocator.0" = type { i8 }
%"struct.fastertransformer::Tensor" = type { i32, i32, %"class.std::vector", ptr, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }

@.str.14 = external hidden unnamed_addr constant [96 x i8], align 1
@__const._ZNK17fastertransformer6Tensor7saveNpyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.magic = external hidden unnamed_addr constant [7 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [32 x i8], align 1

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 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 #3 align 2

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

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #4

; Function Attrs: nounwind
declare void @free(ptr noundef) #5

declare noalias ptr @fopen(ptr noundef, ptr noundef) #6

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN17fastertransformer6Tensor11getTypeSizeENS_13datatype_enumE(i32 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN17fastertransformer8myAssertEbPKciRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i1 noundef zeroext, ptr noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(32)) #7

declare i32 @cudaMemcpy(ptr noundef, ptr noundef, i64 noundef, i32 noundef) #6

declare i32 @fclose(ptr noundef) #6

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK17fastertransformer6Tensor16getNumpyTypeDescB5cxx11ENS_13datatype_enumE(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(64), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK17fastertransformer6Tensor7saveNpyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca i64, align 8
  %8 = alloca [7 x i8], align 1
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca %"class.std::__cxx11::basic_stringstream", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::__cxx11::basic_string", align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %"class.std::__cxx11::basic_string", align 8
  %21 = alloca i16, align 2
  %22 = alloca ptr, align 8
  %23 = alloca i8, align 1
  %24 = alloca %"class.std::__cxx11::basic_string", align 8
  %25 = alloca %"class.std::__cxx11::basic_string", align 8
  %26 = alloca %"class.std::allocator.0", align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %27 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %28 = getelementptr inbounds %"struct.fastertransformer::Tensor", ptr %27, i32 0, i32 3
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  store ptr %29, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #8
  store i8 0, ptr %6, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %30 = call noundef i64 @_ZNK17fastertransformer6Tensor4sizeEv(ptr noundef nonnull align 8 dereferenceable(64) %27)
  store i64 %30, ptr %7, align 8, !tbaa !19
  %31 = getelementptr inbounds %"struct.fastertransformer::Tensor", ptr %27, i32 0, i32 0
  %32 = load i32, ptr %31, align 8, !tbaa !21
  %33 = icmp eq i32 %32, 2
  br i1 %33, label %34, label %51

34:                                               ; preds = %2
  %35 = load i64, ptr %7, align 8, !tbaa !19
  %36 = getelementptr inbounds %"struct.fastertransformer::Tensor", ptr %27, i32 0, i32 1
  %37 = load i32, ptr %36, align 4, !tbaa !22
  %38 = call noundef i64 @_ZN17fastertransformer6Tensor11getTypeSizeENS_13datatype_enumE(i32 noundef %37)
  %39 = mul i64 %35, %38
  %40 = call noalias ptr @malloc(i64 noundef %39) #9
  store ptr %40, ptr %5, align 8, !tbaa !5
  store i8 1, ptr %6, align 1, !tbaa !17
  %41 = call i32 @cudaDeviceSynchronize()
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.fastertransformer::Tensor", ptr %27, i32 0, i32 3
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  %45 = load i64, ptr %7, align 8, !tbaa !19
  %46 = getelementptr inbounds %"struct.fastertransformer::Tensor", ptr %27, i32 0, i32 1
  %47 = load i32, ptr %46, align 4, !tbaa !22
  %48 = call noundef i64 @_ZN17fastertransformer6Tensor11getTypeSizeENS_13datatype_enumE(i32 noundef %47)
  %49 = mul i64 %45, %48
  %50 = call i32 @cudaMemcpy(ptr noundef %42, ptr noundef %44, i64 noundef %49, i32 noundef 2)
  br label %51

51:                                               ; preds = %34, %2
  call void @llvm.lifetime.start.p0(i64 7, ptr %8) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %8, ptr align 1 @__const._ZNK17fastertransformer6Tensor7saveNpyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.magic, i64 7, i1 false)
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #8
  store i8 1, ptr %9, align 1, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #8
  store i8 0, ptr %10, align 1, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 392, ptr %11) #8
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %11)
  %52 = getelementptr inbounds i8, ptr %11, i64 16
  %53 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef @.str.52)
          to label %54 unwind label %68

54:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #8
  %55 = getelementptr inbounds %"struct.fastertransformer::Tensor", ptr %27, i32 0, i32 1
  %56 = load i32, ptr %55, align 4, !tbaa !22
  invoke void @_ZNK17fastertransformer6Tensor16getNumpyTypeDescB5cxx11ENS_13datatype_enumE(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %14, ptr noundef nonnull align 8 dereferenceable(64) %27, i32 noundef %56)
          to label %57 unwind label %72

57:                                               ; preds = %54
  %58 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %53, ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %59 unwind label %76

59:                                               ; preds = %57
  %60 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %58, ptr noundef @.str.53)
          to label %61 unwind label %76

61:                                               ; preds = %59
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  store i64 0, ptr %15, align 8, !tbaa !19
  br label %62

62:                                               ; preds = %107, %61
  %63 = load i64, ptr %15, align 8, !tbaa !19
  %64 = getelementptr inbounds %"struct.fastertransformer::Tensor", ptr %27, i32 0, i32 2
  %65 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %64) #8
  %66 = icmp ult i64 %63, %65
  br i1 %66, label %81, label %67

67:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  br label %110

68:                                               ; preds = %110, %51
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %12, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %13, align 4
  br label %243

72:                                               ; preds = %54
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %12, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %13, align 4
  br label %80

76:                                               ; preds = %59, %57
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %12, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %13, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #8
  br label %80

80:                                               ; preds = %76, %72
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #8
  br label %243

81:                                               ; preds = %62
  %82 = getelementptr inbounds i8, ptr %11, i64 16
  %83 = getelementptr inbounds %"struct.fastertransformer::Tensor", ptr %27, i32 0, i32 2
  %84 = load i64, ptr %15, align 8, !tbaa !19
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %83, i64 noundef %84) #8
  %86 = load i64, ptr %85, align 8, !tbaa !19
  %87 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %82, i64 noundef %86)
          to label %88 unwind label %102

88:                                               ; preds = %81
  %89 = load i64, ptr %15, align 8, !tbaa !19
  %90 = add i64 %89, 1
  %91 = getelementptr inbounds %"struct.fastertransformer::Tensor", ptr %27, i32 0, i32 2
  %92 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %91) #8
  %93 = icmp ult i64 %90, %92
  br i1 %93, label %98, label %94

94:                                               ; preds = %88
  %95 = getelementptr inbounds %"struct.fastertransformer::Tensor", ptr %27, i32 0, i32 2
  %96 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %95) #8
  %97 = icmp eq i64 %96, 1
  br i1 %97, label %98, label %106

98:                                               ; preds = %94, %88
  %99 = getelementptr inbounds i8, ptr %11, i64 16
  %100 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %99, ptr noundef @.str.54)
          to label %101 unwind label %102

101:                                              ; preds = %98
  br label %106

102:                                              ; preds = %98, %81
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %12, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  br label %243

106:                                              ; preds = %101, %94
  br label %107

107:                                              ; preds = %106
  %108 = load i64, ptr %15, align 8, !tbaa !19
  %109 = add i64 %108, 1
  store i64 %109, ptr %15, align 8, !tbaa !19
  br label %62, !llvm.loop !24

110:                                              ; preds = %67
  %111 = getelementptr inbounds i8, ptr %11, i64 16
  %112 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %111, ptr noundef @.str.55)
          to label %113 unwind label %68

113:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #8
  invoke void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %17, ptr noundef nonnull align 8 dereferenceable(128) %11)
          to label %114 unwind label %130

114:                                              ; preds = %113
  %115 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %17) #8
  %116 = add i64 10, %115
  %117 = trunc i64 %116 to i32
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #8
  store i32 %117, ptr %16, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %118 = load i32, ptr %16, align 4, !tbaa !26
  %119 = add nsw i32 %118, 1
  %120 = add nsw i32 %119, 15
  %121 = sdiv i32 %120, 16
  %122 = mul nsw i32 16, %121
  store i32 %122, ptr %18, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  store i32 0, ptr %19, align 4, !tbaa !26
  br label %123

123:                                              ; preds = %149, %114
  %124 = load i32, ptr %19, align 4, !tbaa !26
  %125 = load i32, ptr %18, align 4, !tbaa !26
  %126 = load i32, ptr %16, align 4, !tbaa !26
  %127 = sub nsw i32 %125, %126
  %128 = icmp slt i32 %124, %127
  br i1 %128, label %134, label %129

129:                                              ; preds = %123
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %156

130:                                              ; preds = %113
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %12, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #8
  br label %242

134:                                              ; preds = %123
  %135 = getelementptr inbounds i8, ptr %11, i64 16
  %136 = load i32, ptr %19, align 4, !tbaa !26
  %137 = load i32, ptr %18, align 4, !tbaa !26
  %138 = load i32, ptr %16, align 4, !tbaa !26
  %139 = sub nsw i32 %137, %138
  %140 = sub nsw i32 %139, 1
  %141 = icmp eq i32 %136, %140
  br i1 %141, label %142, label %143

142:                                              ; preds = %134
  br label %144

143:                                              ; preds = %134
  br label %144

144:                                              ; preds = %143, %142
  %145 = phi ptr [ @.str.56, %142 ], [ @.str.57, %143 ]
  %146 = getelementptr inbounds [2 x i8], ptr %145, i64 0, i64 0
  %147 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %135, ptr noundef %146)
          to label %148 unwind label %152

148:                                              ; preds = %144
  br label %149

149:                                              ; preds = %148
  %150 = load i32, ptr %19, align 4, !tbaa !26
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %19, align 4, !tbaa !26
  br label %123, !llvm.loop !28

152:                                              ; preds = %144
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %12, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %241

156:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #8
  invoke void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %20, ptr noundef nonnull align 8 dereferenceable(128) %11)
          to label %157 unwind label %178

157:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 2, ptr %21) #8
  %158 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %20) #8
  %159 = trunc i64 %158 to i16
  store i16 %159, ptr %21, align 2, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  %161 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %160) #8
  %162 = invoke noalias ptr @fopen(ptr noundef %161, ptr noundef @.str.58)
          to label %163 unwind label %182

163:                                              ; preds = %157
  store ptr %162, ptr %22, align 8, !tbaa !5
  br label %164

164:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #8
  %165 = load ptr, ptr %22, align 8, !tbaa !5
  %166 = icmp ne ptr %165, null
  %167 = zext i1 %166 to i8
  store i8 %167, ptr %23, align 1, !tbaa !17
  %168 = load i8, ptr %23, align 1, !tbaa !17, !range !31, !noundef !32
  %169 = trunc i8 %168 to i1
  br i1 %169, label %200, label %170

170:                                              ; preds = %164
  %171 = load i8, ptr %23, align 1, !tbaa !17, !range !31, !noundef !32
  %172 = trunc i8 %171 to i1
  call void @llvm.lifetime.start.p0(i64 32, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %25) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %25, ptr noundef @.str.59, ptr noundef nonnull align 1 dereferenceable(1) %26)
          to label %173 unwind label %186

173:                                              ; preds = %170
  %174 = load ptr, ptr %4, align 8, !tbaa !5
  %175 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %174) #8
  invoke void @_ZN17fastertransformer6fmtstrIJPKcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKS8_DpT_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %24, ptr noundef nonnull align 8 dereferenceable(32) %25, ptr noundef %175)
          to label %176 unwind label %190

176:                                              ; preds = %173
  invoke void @_ZN17fastertransformer8myAssertEbPKciRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i1 noundef zeroext %172, ptr noundef @.str.14, i32 noundef 318, ptr noundef nonnull align 8 dereferenceable(32) %24)
          to label %177 unwind label %194

177:                                              ; preds = %176
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %24) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %25) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %24) #8
  br label %200

178:                                              ; preds = %156
  %179 = landingpad { ptr, i32 }
          cleanup
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %12, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %13, align 4
  br label %240

182:                                              ; preds = %230, %226, %221, %215, %212, %209, %206, %202, %157
  %183 = landingpad { ptr, i32 }
          cleanup
  %184 = extractvalue { ptr, i32 } %183, 0
  store ptr %184, ptr %12, align 8
  %185 = extractvalue { ptr, i32 } %183, 1
  store i32 %185, ptr %13, align 4
  br label %239

186:                                              ; preds = %170
  %187 = landingpad { ptr, i32 }
          cleanup
  %188 = extractvalue { ptr, i32 } %187, 0
  store ptr %188, ptr %12, align 8
  %189 = extractvalue { ptr, i32 } %187, 1
  store i32 %189, ptr %13, align 4
  br label %199

190:                                              ; preds = %173
  %191 = landingpad { ptr, i32 }
          cleanup
  %192 = extractvalue { ptr, i32 } %191, 0
  store ptr %192, ptr %12, align 8
  %193 = extractvalue { ptr, i32 } %191, 1
  store i32 %193, ptr %13, align 4
  br label %198

194:                                              ; preds = %176
  %195 = landingpad { ptr, i32 }
          cleanup
  %196 = extractvalue { ptr, i32 } %195, 0
  store ptr %196, ptr %12, align 8
  %197 = extractvalue { ptr, i32 } %195, 1
  store i32 %197, ptr %13, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %24) #8
  br label %198

198:                                              ; preds = %194, %190
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %25) #8
  br label %199

199:                                              ; preds = %198, %186
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #8
  br label %239

200:                                              ; preds = %177, %164
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #8
  br label %201

201:                                              ; preds = %200
  br label %202

202:                                              ; preds = %201
  %203 = getelementptr inbounds [7 x i8], ptr %8, i64 0, i64 0
  %204 = load ptr, ptr %22, align 8, !tbaa !5
  %205 = invoke i64 @fwrite(ptr noundef %203, i64 noundef 1, i64 noundef 6, ptr noundef %204)
          to label %206 unwind label %182

206:                                              ; preds = %202
  %207 = load ptr, ptr %22, align 8, !tbaa !5
  %208 = invoke i64 @fwrite(ptr noundef %9, i64 noundef 1, i64 noundef 1, ptr noundef %207)
          to label %209 unwind label %182

209:                                              ; preds = %206
  %210 = load ptr, ptr %22, align 8, !tbaa !5
  %211 = invoke i64 @fwrite(ptr noundef %10, i64 noundef 1, i64 noundef 1, ptr noundef %210)
          to label %212 unwind label %182

212:                                              ; preds = %209
  %213 = load ptr, ptr %22, align 8, !tbaa !5
  %214 = invoke i64 @fwrite(ptr noundef %21, i64 noundef 2, i64 noundef 1, ptr noundef %213)
          to label %215 unwind label %182

215:                                              ; preds = %212
  %216 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %20) #8
  %217 = load i16, ptr %21, align 2, !tbaa !29
  %218 = zext i16 %217 to i64
  %219 = load ptr, ptr %22, align 8, !tbaa !5
  %220 = invoke i64 @fwrite(ptr noundef %216, i64 noundef 1, i64 noundef %218, ptr noundef %219)
          to label %221 unwind label %182

221:                                              ; preds = %215
  %222 = load ptr, ptr %5, align 8, !tbaa !5
  %223 = getelementptr inbounds %"struct.fastertransformer::Tensor", ptr %27, i32 0, i32 1
  %224 = load i32, ptr %223, align 4, !tbaa !22
  %225 = invoke noundef i64 @_ZN17fastertransformer6Tensor11getTypeSizeENS_13datatype_enumE(i32 noundef %224)
          to label %226 unwind label %182

226:                                              ; preds = %221
  %227 = load i64, ptr %7, align 8, !tbaa !19
  %228 = load ptr, ptr %22, align 8, !tbaa !5
  %229 = invoke i64 @fwrite(ptr noundef %222, i64 noundef %225, i64 noundef %227, ptr noundef %228)
          to label %230 unwind label %182

230:                                              ; preds = %226
  %231 = load ptr, ptr %22, align 8, !tbaa !5
  %232 = invoke i32 @fclose(ptr noundef %231)
          to label %233 unwind label %182

233:                                              ; preds = %230
  %234 = load i8, ptr %6, align 1, !tbaa !17, !range !31, !noundef !32
  %235 = trunc i8 %234 to i1
  br i1 %235, label %236, label %238

236:                                              ; preds = %233
  %237 = load ptr, ptr %5, align 8, !tbaa !5
  call void @free(ptr noundef %237) #8
  br label %238

238:                                              ; preds = %236, %233
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 2, ptr %21) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %11) #8
  call void @llvm.lifetime.end.p0(i64 392, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 7, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  ret void

239:                                              ; preds = %199, %182
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 2, ptr %21) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #8
  br label %240

240:                                              ; preds = %239, %178
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #8
  br label %241

241:                                              ; preds = %240, %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %242

242:                                              ; preds = %241, %130
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %243

243:                                              ; preds = %242, %102, %80, %68
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %11) #8
  call void @llvm.lifetime.end.p0(i64 392, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 7, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  br label %244

244:                                              ; preds = %243
  %245 = load ptr, ptr %12, align 8
  %246 = load i32, ptr %13, align 4
  %247 = insertvalue { ptr, i32 } poison, ptr %245, 0
  %248 = insertvalue { ptr, i32 } %247, i32 %246, 1
  resume { ptr, i32 } %248
}

declare i32 @cudaDeviceSynchronize() #6

; Function Attrs: mustprogress uwtable
declare void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) #7

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(128)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN17fastertransformer6fmtstrIJPKcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKS8_DpT_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #7

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #6

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { nounwind allocsize(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 "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 = { 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 #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }

!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, !6, i64 32}
!10 = !{!"_ZTSN17fastertransformer6TensorE", !11, i64 0, !12, i64 4, !13, i64 8, !6, i64 32, !13, i64 40}
!11 = !{!"_ZTSN17fastertransformer15memorytype_enumE", !7, i64 0}
!12 = !{!"_ZTSN17fastertransformer13datatype_enumE", !7, i64 0}
!13 = !{!"_ZTSSt6vectorImSaImEE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseImSaImEE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseImSaImEE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseImSaImEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!18, !18, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = !{!10, !11, i64 0}
!22 = !{!10, !12, i64 4}
!23 = !{!7, !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!27, !27, i64 0}
!27 = !{!"int", !7, i64 0}
!28 = distinct !{!28, !25}
!29 = !{!30, !30, i64 0}
!30 = !{!"short", !7, i64 0}
!31 = !{i8 0, i8 2}
!32 = !{}


; 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::__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::__cxx11::basic_stringstream" = type { %"class.std::basic_iostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_iostream.base" = type { %"class.std::basic_istream.base", %"class.std::basic_ostream.base" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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::allocator.0" = type { i8 }

@.str.14 = external hidden unnamed_addr constant [96 x i8], align 1
@__const._ZNK17fastertransformer6Tensor7saveNpyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.magic = external hidden unnamed_addr constant [7 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [32 x i8], align 1

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 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 #3 align 2

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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #6

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN17fastertransformer6Tensor11getTypeSizeENS_13datatype_enumE(i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN17fastertransformer8myAssertEbPKciRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i1 noundef zeroext, ptr noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #7

declare i32 @cudaMemcpy(ptr noundef, ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #8

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK17fastertransformer6Tensor16getNumpyTypeDescB5cxx11ENS_13datatype_enumE(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(64), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK17fastertransformer6Tensor7saveNpyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca [7 x i8], align 1
  %4 = alloca %"class.std::__cxx11::basic_stringstream", align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca i16, align 2
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca %"class.std::allocator.0", align 1
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  %14 = tail call noundef i64 @_ZNK17fastertransformer6Tensor4sizeEv(ptr noundef nonnull align 8 dereferenceable(64) %0)
  %15 = load i32, ptr %0, align 8, !tbaa !16
  %16 = icmp eq i32 %15, 2
  br i1 %16, label %17, label %29

17:                                               ; preds = %2
  %18 = getelementptr inbounds i8, ptr %0, i64 4
  %19 = load i32, ptr %18, align 4, !tbaa !17
  %20 = tail call noundef i64 @_ZN17fastertransformer6Tensor11getTypeSizeENS_13datatype_enumE(i32 noundef %19)
  %21 = mul i64 %20, %14
  %22 = tail call noalias ptr @malloc(i64 noundef %21) #10
  %23 = tail call i32 @cudaDeviceSynchronize()
  %24 = load ptr, ptr %12, align 8, !tbaa !5
  %25 = load i32, ptr %18, align 4, !tbaa !17
  %26 = tail call noundef i64 @_ZN17fastertransformer6Tensor11getTypeSizeENS_13datatype_enumE(i32 noundef %25)
  %27 = mul i64 %26, %14
  %28 = tail call i32 @cudaMemcpy(ptr noundef %22, ptr noundef %24, i64 noundef %27, i32 noundef 2)
  br label %29

29:                                               ; preds = %17, %2
  %.0 = phi ptr [ %22, %17 ], [ %13, %2 ]
  call void @llvm.lifetime.start.p0(i64 7, ptr nonnull %3) #11
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(7) %3, ptr noundef nonnull align 1 dereferenceable(7) @__const._ZNK17fastertransformer6Tensor7saveNpyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.magic, i64 7, i1 false)
  call void @llvm.lifetime.start.p0(i64 392, ptr nonnull %4) #11
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %4)
  %30 = getelementptr inbounds i8, ptr %4, i64 16
  %31 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull @.str.52)
          to label %32 unwind label %43

32:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #11
  %33 = getelementptr inbounds i8, ptr %0, i64 4
  %34 = load i32, ptr %33, align 4, !tbaa !17
  invoke void @_ZNK17fastertransformer6Tensor16getNumpyTypeDescB5cxx11ENS_13datatype_enumE(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %5, ptr noundef nonnull align 8 dereferenceable(64) %0, i32 noundef %34)
          to label %35 unwind label %45

35:                                               ; preds = %32
  %36 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %37 unwind label %47

37:                                               ; preds = %35
  %38 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef nonnull @.str.53)
          to label %39 unwind label %47

39:                                               ; preds = %37
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #11
  %40 = getelementptr inbounds i8, ptr %0, i64 8
  %41 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #11
  %.not69 = icmp eq i64 %41, 0
  br i1 %.not69, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %64, %39
  %42 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull @.str.55)
          to label %67 unwind label %43

43:                                               ; preds = %._crit_edge, %29
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %124

45:                                               ; preds = %32
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %49

47:                                               ; preds = %37, %35
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #11
  br label %49

49:                                               ; preds = %47, %45
  %.pn = phi { ptr, i32 } [ %48, %47 ], [ %46, %45 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #11
  br label %124

.lr.ph:                                           ; preds = %39, %64
  %.04464 = phi i64 [ %54, %64 ], [ 0, %39 ]
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %40, i64 noundef %.04464) #11
  %51 = load i64, ptr %50, align 8, !tbaa !18
  %52 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %30, i64 noundef %51)
          to label %53 unwind label %62

53:                                               ; preds = %.lr.ph
  %54 = add nuw i64 %.04464, 1
  %55 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #11
  %56 = icmp ult i64 %54, %55
  br i1 %56, label %60, label %57

57:                                               ; preds = %53
  %58 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #11
  %59 = icmp eq i64 %58, 1
  br i1 %59, label %60, label %64

60:                                               ; preds = %57, %53
  %61 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull @.str.54)
          to label %64 unwind label %62

62:                                               ; preds = %60, %.lr.ph
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %124

64:                                               ; preds = %57, %60
  %65 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #11
  %66 = icmp ult i64 %54, %65
  br i1 %66, label %.lr.ph, label %._crit_edge, !llvm.loop !20

67:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #11
  invoke void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %6, ptr noundef nonnull align 8 dereferenceable(128) %4)
          to label %68 unwind label %77

68:                                               ; preds = %67
  %69 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %6) #11
  %70 = trunc i64 %69 to i32
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #11
  %71 = add i32 %70, 26
  %72 = sdiv i32 %71, 16
  %73 = shl nsw i32 %72, 4
  %reass.sub = sub i32 %73, %70
  %74 = add i32 %reass.sub, -10
  %75 = icmp sgt i32 %74, 0
  br i1 %75, label %.lr.ph67, label %._crit_edge68

.lr.ph67:                                         ; preds = %68
  %76 = add i32 %reass.sub, -11
  br label %79

._crit_edge68:                                    ; preds = %82, %68
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #11
  invoke void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %7, ptr noundef nonnull align 8 dereferenceable(128) %4)
          to label %86 unwind label %96

77:                                               ; preds = %67
  %78 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #11
  br label %124

79:                                               ; preds = %.lr.ph67, %82
  %.03465 = phi i32 [ 0, %.lr.ph67 ], [ %83, %82 ]
  %80 = icmp eq i32 %.03465, %76
  %.str.56..str.57 = select i1 %80, ptr @.str.56, ptr @.str.57
  %81 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull %.str.56..str.57)
          to label %82 unwind label %84

82:                                               ; preds = %79
  %83 = add nuw nsw i32 %.03465, 1
  %exitcond.not = icmp eq i32 %83, %74
  br i1 %exitcond.not, label %._crit_edge68, label %79, !llvm.loop !22

84:                                               ; preds = %79
  %85 = landingpad { ptr, i32 }
          cleanup
  br label %124

86:                                               ; preds = %._crit_edge68
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %8) #11
  %87 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %7) #11
  %88 = trunc i64 %87 to i16
  store i16 %88, ptr %8, align 2, !tbaa !23
  %89 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #11
  %90 = call noalias ptr @fopen(ptr noundef %89, ptr noundef nonnull @.str.58)
  %.not = icmp eq ptr %90, null
  br i1 %.not, label %91, label %108

91:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #11
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #11
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #11
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #11
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull @.str.59, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %92 unwind label %100

92:                                               ; preds = %91
  %93 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #11
  invoke void @_ZN17fastertransformer6fmtstrIJPKcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKS8_DpT_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %9, ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef %93)
          to label %94 unwind label %102

94:                                               ; preds = %92
  invoke void @_ZN17fastertransformer8myAssertEbPKciRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i1 noundef zeroext false, ptr noundef nonnull @.str.14, i32 noundef 318, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %95 unwind label %104

95:                                               ; preds = %94
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #11
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #11
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #11
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #11
  br label %108

96:                                               ; preds = %._crit_edge68
  %97 = landingpad { ptr, i32 }
          cleanup
  br label %123

98:                                               ; preds = %108
  %99 = landingpad { ptr, i32 }
          cleanup
  br label %122

100:                                              ; preds = %91
  %101 = landingpad { ptr, i32 }
          cleanup
  br label %107

102:                                              ; preds = %92
  %103 = landingpad { ptr, i32 }
          cleanup
  br label %106

104:                                              ; preds = %94
  %105 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #11
  br label %106

106:                                              ; preds = %104, %102
  %.pn48 = phi { ptr, i32 } [ %105, %104 ], [ %103, %102 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #11
  br label %107

107:                                              ; preds = %106, %100
  %.pn48.pn = phi { ptr, i32 } [ %.pn48, %106 ], [ %101, %100 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #11
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #11
  br label %122

108:                                              ; preds = %95, %86
  %109 = call i64 @fwrite(ptr noundef nonnull %3, i64 noundef 1, i64 noundef 6, ptr noundef %90)
  %fputc = call i32 @fputc(i32 1, ptr %90)
  %fputc53 = call i32 @fputc(i32 0, ptr %90)
  %110 = call i64 @fwrite(ptr noundef nonnull %8, i64 noundef 2, i64 noundef 1, ptr noundef %90)
  %111 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %7) #11
  %112 = load i16, ptr %8, align 2, !tbaa !23
  %113 = zext i16 %112 to i64
  %114 = call i64 @fwrite(ptr noundef %111, i64 noundef 1, i64 noundef %113, ptr noundef %90)
  %115 = load i32, ptr %33, align 4, !tbaa !17
  %116 = invoke noundef i64 @_ZN17fastertransformer6Tensor11getTypeSizeENS_13datatype_enumE(i32 noundef %115)
          to label %117 unwind label %98

117:                                              ; preds = %108
  %118 = call i64 @fwrite(ptr noundef %.0, i64 noundef %116, i64 noundef %14, ptr noundef %90)
  %119 = call i32 @fclose(ptr noundef %90)
  br i1 %16, label %120, label %121

120:                                              ; preds = %117
  call void @free(ptr noundef %.0) #11
  br label %121

121:                                              ; preds = %120, %117
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %8) #11
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #11
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %4) #11
  call void @llvm.lifetime.end.p0(i64 392, ptr nonnull %4) #11
  call void @llvm.lifetime.end.p0(i64 7, ptr nonnull %3) #11
  ret void

122:                                              ; preds = %107, %98
  %.pn54 = phi { ptr, i32 } [ %99, %98 ], [ %.pn48.pn, %107 ]
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %8) #11
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #11
  br label %123

123:                                              ; preds = %122, %96
  %.pn54.pn = phi { ptr, i32 } [ %.pn54, %122 ], [ %97, %96 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #11
  br label %124

124:                                              ; preds = %77, %123, %84, %62, %49, %43
  %.pn60 = phi { ptr, i32 } [ %63, %62 ], [ %44, %43 ], [ %.pn, %49 ], [ %78, %77 ], [ %85, %84 ], [ %.pn54.pn, %123 ]
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %4) #11
  call void @llvm.lifetime.end.p0(i64 392, ptr nonnull %4) #11
  call void @llvm.lifetime.end.p0(i64 7, ptr nonnull %3) #11
  resume { ptr, i32 } %.pn60
}

declare i32 @cudaDeviceSynchronize() local_unnamed_addr #8

; Function Attrs: mustprogress uwtable
declare void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #3 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN17fastertransformer6fmtstrIJPKcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKS8_DpT_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #7

; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #6

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

; Function Attrs: nofree nounwind
declare noundef i32 @fputc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #9

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 #7 = { 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 #8 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree nounwind }
attributes #10 = { nounwind allocsize(0) }
attributes #11 = { 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, !15, i64 32}
!6 = !{!"_ZTSN17fastertransformer6TensorE", !7, i64 0, !10, i64 4, !11, i64 8, !15, i64 32, !11, i64 40}
!7 = !{!"_ZTSN17fastertransformer15memorytype_enumE", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN17fastertransformer13datatype_enumE", !8, i64 0}
!11 = !{!"_ZTSSt6vectorImSaImEE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseImSaImEE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseImSaImEE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseImSaImEE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!6, !7, i64 0}
!17 = !{!6, !10, i64 4}
!18 = !{!19, !19, i64 0}
!19 = !{!"long", !8, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = !{!24, !24, i64 0}
!24 = !{!"short", !8, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass