; LLVM IR from huawei-noah/bolt :: compute/tensor/src/cpu (rnn)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.TensorDesc = type { i32, i32, i32, [20 x i32] }
%struct.RNNParamSpec = type { i32, i32, i32, i32, float, float, i8, float, i32 }

@.str = external hidden unnamed_addr constant [20 x i8], align 1
@stdout = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [18 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

; 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: nounwind
declare i64 @syscall(i64 noundef, ...) #2

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

declare i32 @fflush(ptr noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local ptr @ee2str(i32 noundef) #4

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z7bytesOf8DataType(i32 noundef) #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z35rnncell_infer_forward_tmp_bytes_cpu10TensorDescS_S_12RNNParamSpecPj4Arch(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef byval(%struct.RNNParamSpec) align 8, ptr noundef, i32 noundef) #7

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z31rnn_infer_forward_tmp_bytes_cpu10TensorDescS_S_12RNNParamSpecPj4Arch(ptr noundef byval(%struct.TensorDesc) align 8 %0, ptr noundef byval(%struct.TensorDesc) align 8 %1, ptr noundef byval(%struct.TensorDesc) align 8 %2, ptr noundef byval(%struct.RNNParamSpec) align 8 %3, ptr noundef %4, i32 noundef %5) #7 {
  %7 = alloca ptr, align 8
  %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 i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %struct.TensorDesc, align 4
  %19 = alloca i32, align 4
  %20 = alloca %struct.TensorDesc, align 8
  %21 = alloca %struct.TensorDesc, align 8
  %22 = alloca %struct.TensorDesc, align 8
  %23 = alloca %struct.RNNParamSpec, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca %struct.TensorDesc, align 8
  store ptr %4, ptr %7, align 8, !tbaa !5
  store i32 %5, ptr %8, align 4, !tbaa !9
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = icmp eq ptr null, %30
  br i1 %31, label %32, label %48

32:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 1, ptr %9, align 4, !tbaa !11
  %33 = load i32, ptr %9, align 4, !tbaa !11
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %47

35:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %36 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %37 = trunc i64 %36 to i32
  store i32 %37, ptr %10, align 4, !tbaa !13
  %38 = load i32, ptr %10, align 4, !tbaa !13
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %38)
  %40 = load ptr, ptr @stdout, align 8, !tbaa !5
  %41 = call i32 @fflush(ptr noundef %40)
  %42 = load i32, ptr %9, align 4, !tbaa !11
  %43 = call ptr @ee2str(i32 noundef %42)
  %44 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %43)
  %45 = load ptr, ptr @stdout, align 8, !tbaa !5
  %46 = call i32 @fflush(ptr noundef %45)
  call void @exit(i32 noundef 1) #9
  unreachable

47:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %48

48:                                               ; preds = %47, %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  %49 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 0
  %50 = load i32, ptr %49, align 8, !tbaa !15
  store i32 %50, ptr %11, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %51 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 1
  %52 = load i32, ptr %51, align 4, !tbaa !20
  store i32 %52, ptr %12, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %53 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 3
  %54 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 2
  %55 = load i32, ptr %54, align 8, !tbaa !22
  %56 = sub i32 %55, 1
  %57 = zext i32 %56 to i64
  %58 = getelementptr inbounds [20 x i32], ptr %53, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !13
  store i32 %59, ptr %13, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %60 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 3
  %61 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 2
  %62 = load i32, ptr %61, align 8, !tbaa !22
  %63 = sub i32 %62, 2
  %64 = zext i32 %63 to i64
  %65 = getelementptr inbounds [20 x i32], ptr %60, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !13
  store i32 %66, ptr %14, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %67 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 3
  %68 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 2
  %69 = load i32, ptr %68, align 8, !tbaa !22
  %70 = sub i32 %69, 3
  %71 = zext i32 %70 to i64
  %72 = getelementptr inbounds [20 x i32], ptr %67, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !13
  store i32 %73, ptr %15, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 0, ptr %16, align 4, !tbaa !13
  br label %74

74:                                               ; preds = %89, %48
  %75 = load i32, ptr %16, align 4, !tbaa !13
  %76 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 2
  %77 = load i32, ptr %76, align 8, !tbaa !22
  %78 = sub i32 %77, 3
  %79 = icmp ult i32 %75, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %92

81:                                               ; preds = %74
  %82 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 3
  %83 = load i32, ptr %16, align 4, !tbaa !13
  %84 = zext i32 %83 to i64
  %85 = getelementptr inbounds [20 x i32], ptr %82, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !13
  %87 = load i32, ptr %15, align 4, !tbaa !13
  %88 = mul i32 %87, %86
  store i32 %88, ptr %15, align 4, !tbaa !13
  br label %89

89:                                               ; preds = %81
  %90 = load i32, ptr %16, align 4, !tbaa !13
  %91 = add i32 %90, 1
  store i32 %91, ptr %16, align 4, !tbaa !13
  br label %74, !llvm.loop !23

92:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %93 = getelementptr inbounds %struct.RNNParamSpec, ptr %3, i32 0, i32 1
  %94 = load i32, ptr %93, align 4, !tbaa !25
  store i32 %94, ptr %17, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 92, ptr %18) #8
  %95 = load i32, ptr %11, align 4, !tbaa !19
  %96 = load i32, ptr %13, align 4, !tbaa !13
  %97 = load i32, ptr %15, align 4, !tbaa !13
  call void @_Z9tensor2df8DataType10DataFormatjj(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %18, i32 noundef %95, i32 noundef 14, i32 noundef %96, i32 noundef %97)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %18, i64 92, i1 false), !tbaa.struct !31
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 8 %1, i64 92, i1 false), !tbaa.struct !31
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 8 %2, i64 92, i1 false), !tbaa.struct !31
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 8 %3, i64 36, i1 false), !tbaa.struct !33
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = load i32, ptr %8, align 4, !tbaa !9
  %100 = call noundef i32 @_Z35rnncell_infer_forward_tmp_bytes_cpu10TensorDescS_S_12RNNParamSpecPj4Arch(ptr noundef byval(%struct.TensorDesc) align 8 %20, ptr noundef byval(%struct.TensorDesc) align 8 %21, ptr noundef byval(%struct.TensorDesc) align 8 %22, ptr noundef byval(%struct.RNNParamSpec) align 8 %23, ptr noundef %98, i32 noundef %99)
  store i32 %100, ptr %19, align 4, !tbaa !11
  %101 = load i32, ptr %19, align 4, !tbaa !11
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %115

103:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %104 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %105 = trunc i64 %104 to i32
  store i32 %105, ptr %24, align 4, !tbaa !13
  %106 = load i32, ptr %24, align 4, !tbaa !13
  %107 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %106)
  %108 = load ptr, ptr @stdout, align 8, !tbaa !5
  %109 = call i32 @fflush(ptr noundef %108)
  %110 = load i32, ptr %19, align 4, !tbaa !11
  %111 = call ptr @ee2str(i32 noundef %110)
  %112 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %111)
  %113 = load ptr, ptr @stdout, align 8, !tbaa !5
  %114 = call i32 @fflush(ptr noundef %113)
  call void @exit(i32 noundef 1) #9
  unreachable

115:                                              ; preds = %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  %116 = getelementptr inbounds %struct.RNNParamSpec, ptr %3, i32 0, i32 3
  %117 = load i32, ptr %116, align 4, !tbaa !38
  %118 = icmp sgt i32 %117, 0
  br i1 %118, label %119, label %122

119:                                              ; preds = %115
  %120 = getelementptr inbounds %struct.RNNParamSpec, ptr %3, i32 0, i32 3
  %121 = load i32, ptr %120, align 4, !tbaa !38
  br label %125

122:                                              ; preds = %115
  %123 = getelementptr inbounds %struct.RNNParamSpec, ptr %3, i32 0, i32 1
  %124 = load i32, ptr %123, align 4, !tbaa !25
  br label %125

125:                                              ; preds = %122, %119
  %126 = phi i32 [ %121, %119 ], [ %124, %122 ]
  store i32 %126, ptr %25, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  store i32 0, ptr %26, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  store i32 0, ptr %27, align 4, !tbaa !13
  %127 = getelementptr inbounds %struct.RNNParamSpec, ptr %3, i32 0, i32 0
  %128 = load i32, ptr %127, align 8, !tbaa !39
  switch i32 %128, label %132 [
    i32 1, label %129
    i32 2, label %130
    i32 3, label %131
  ]

129:                                              ; preds = %125
  store i32 4, ptr %27, align 4, !tbaa !13
  br label %133

130:                                              ; preds = %125
  store i32 3, ptr %27, align 4, !tbaa !13
  br label %133

131:                                              ; preds = %125
  store i32 3, ptr %27, align 4, !tbaa !13
  br label %133

132:                                              ; preds = %125
  store i32 51, ptr %26, align 4, !tbaa !11
  br label %133

133:                                              ; preds = %132, %131, %130, %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  %134 = getelementptr inbounds %struct.RNNParamSpec, ptr %3, i32 0, i32 6
  %135 = load i8, ptr %134, align 8, !tbaa !40, !range !41, !noundef !42
  %136 = trunc i8 %135 to i1
  %137 = zext i1 %136 to i64
  %138 = select i1 %136, i32 2, i32 1
  store i32 %138, ptr %28, align 4, !tbaa !13
  %139 = load i32, ptr %13, align 4, !tbaa !13
  %140 = load i32, ptr %25, align 4, !tbaa !13
  %141 = load i32, ptr %17, align 4, !tbaa !13
  %142 = add i32 %140, %141
  %143 = load i32, ptr %28, align 4, !tbaa !13
  %144 = mul i32 %142, %143
  %145 = load i32, ptr %25, align 4, !tbaa !13
  %146 = load i32, ptr %27, align 4, !tbaa !13
  %147 = mul i32 %145, %146
  %148 = add i32 %144, %147
  %149 = mul i32 %139, %148
  %150 = load i32, ptr %11, align 4, !tbaa !19
  %151 = call noundef i32 @_Z7bytesOf8DataType(i32 noundef %150)
  %152 = mul i32 %149, %151
  %153 = load ptr, ptr %7, align 8, !tbaa !5
  %154 = load i32, ptr %153, align 4, !tbaa !13
  %155 = add i32 %154, %152
  store i32 %155, ptr %153, align 4, !tbaa !13
  %156 = load i32, ptr %12, align 4, !tbaa !21
  %157 = icmp eq i32 %156, 2
  br i1 %157, label %158, label %163

158:                                              ; preds = %133
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !31
  %159 = call noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %29)
  %160 = load ptr, ptr %7, align 8, !tbaa !5
  %161 = load i32, ptr %160, align 4, !tbaa !13
  %162 = add i32 %161, %159
  store i32 %162, ptr %160, align 4, !tbaa !13
  br label %163

163:                                              ; preds = %158, %133
  %164 = getelementptr inbounds %struct.RNNParamSpec, ptr %3, i32 0, i32 2
  %165 = load i32, ptr %164, align 8, !tbaa !43
  %166 = icmp sge i32 %165, 0
  br i1 %166, label %167, label %211

167:                                              ; preds = %163
  %168 = load i32, ptr %13, align 4, !tbaa !13
  %169 = load i32, ptr %14, align 4, !tbaa !13
  %170 = mul i32 %168, %169
  %171 = load i32, ptr %25, align 4, !tbaa !13
  %172 = mul i32 %170, %171
  %173 = load i32, ptr %27, align 4, !tbaa !13
  %174 = mul i32 %172, %173
  %175 = load i32, ptr %11, align 4, !tbaa !19
  %176 = call noundef i32 @_Z7bytesOf8DataType(i32 noundef %175)
  %177 = mul i32 %174, %176
  %178 = load ptr, ptr %7, align 8, !tbaa !5
  %179 = load i32, ptr %178, align 4, !tbaa !13
  %180 = add i32 %179, %177
  store i32 %180, ptr %178, align 4, !tbaa !13
  %181 = load i32, ptr %13, align 4, !tbaa !13
  %182 = load i32, ptr %14, align 4, !tbaa !13
  %183 = mul i32 %181, %182
  %184 = load i32, ptr %15, align 4, !tbaa !13
  %185 = mul i32 %183, %184
  %186 = load i32, ptr %15, align 4, !tbaa !13
  %187 = load i32, ptr %25, align 4, !tbaa !13
  %188 = mul i32 %186, %187
  %189 = icmp ugt i32 %185, %188
  br i1 %189, label %190, label %196

190:                                              ; preds = %167
  %191 = load i32, ptr %13, align 4, !tbaa !13
  %192 = load i32, ptr %14, align 4, !tbaa !13
  %193 = mul i32 %191, %192
  %194 = load i32, ptr %15, align 4, !tbaa !13
  %195 = mul i32 %193, %194
  br label %200

196:                                              ; preds = %167
  %197 = load i32, ptr %15, align 4, !tbaa !13
  %198 = load i32, ptr %25, align 4, !tbaa !13
  %199 = mul i32 %197, %198
  br label %200

200:                                              ; preds = %196, %190
  %201 = phi i32 [ %195, %190 ], [ %199, %196 ]
  %202 = load i32, ptr %11, align 4, !tbaa !19
  %203 = call noundef i32 @_Z7bytesOf8DataType(i32 noundef %202)
  %204 = mul i32 %201, %203
  %205 = load ptr, ptr %7, align 8, !tbaa !5
  %206 = load i32, ptr %205, align 4, !tbaa !13
  %207 = add i32 %206, %204
  store i32 %207, ptr %205, align 4, !tbaa !13
  %208 = load ptr, ptr %7, align 8, !tbaa !5
  %209 = load i32, ptr %208, align 4, !tbaa !13
  %210 = add i32 %209, 32
  store i32 %210, ptr %208, align 4, !tbaa !13
  br label %211

211:                                              ; preds = %200, %163
  %212 = load i32, ptr %17, align 4, !tbaa !13
  %213 = load i32, ptr %15, align 4, !tbaa !13
  %214 = add i32 %212, %213
  %215 = call noundef i32 @_Z7bytesOf8DataType(i32 noundef 1)
  %216 = mul i32 %214, %215
  %217 = load ptr, ptr %7, align 8, !tbaa !5
  %218 = load i32, ptr %217, align 4, !tbaa !13
  %219 = add i32 %218, %216
  store i32 %219, ptr %217, align 4, !tbaa !13
  %220 = load i32, ptr %26, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 92, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  ret i32 %220
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z9tensor2df8DataType10DataFormatjj(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { noreturn 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 = { 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 #7 = { 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 = { noreturn 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 = !{!"_ZTS4Arch", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTS2EE", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !17, i64 0}
!16 = !{!"_ZTS10TensorDesc", !17, i64 0, !18, i64 4, !14, i64 8, !7, i64 12}
!17 = !{!"_ZTS8DataType", !7, i64 0}
!18 = !{!"_ZTS10DataFormat", !7, i64 0}
!19 = !{!17, !17, i64 0}
!20 = !{!16, !18, i64 4}
!21 = !{!18, !18, i64 0}
!22 = !{!16, !14, i64 8}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!26, !14, i64 4}
!26 = !{!"_ZTS12RNNParamSpec", !27, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !28, i64 16, !28, i64 20, !29, i64 24, !28, i64 28, !30, i64 32}
!27 = !{!"_ZTS7RNNMode", !7, i64 0}
!28 = !{!"float", !7, i64 0}
!29 = !{!"bool", !7, i64 0}
!30 = !{!"_ZTS14ActivationMode", !7, i64 0}
!31 = !{i64 0, i64 4, !19, i64 4, i64 4, !21, i64 8, i64 4, !13, i64 12, i64 80, !32}
!32 = !{!7, !7, i64 0}
!33 = !{i64 0, i64 4, !34, i64 4, i64 4, !13, i64 8, i64 4, !13, i64 12, i64 4, !13, i64 16, i64 4, !35, i64 20, i64 4, !35, i64 24, i64 1, !36, i64 28, i64 4, !35, i64 32, i64 4, !37}
!34 = !{!27, !27, i64 0}
!35 = !{!28, !28, i64 0}
!36 = !{!29, !29, i64 0}
!37 = !{!30, !30, i64 0}
!38 = !{!26, !14, i64 12}
!39 = !{!26, !27, i64 0}
!40 = !{!26, !29, i64 24}
!41 = !{i8 0, i8 2}
!42 = !{}
!43 = !{!26, !14, i64 8}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.TensorDesc = type { i32, i32, i32, [20 x i32] }
%struct.RNNParamSpec = type { i32, i32, i32, i32, float, float, i8, float, i32 }

@.str = external hidden unnamed_addr constant [20 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1
@switch.table._Z31rnn_infer_forward_tmp_bytes_cpu10TensorDescS_S_12RNNParamSpecPj4Arch = private unnamed_addr constant [3 x i32] [i32 4, i32 3, i32 3], align 4

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

; Function Attrs: nounwind
declare i64 @syscall(i64 noundef, ...) local_unnamed_addr #1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local ptr @ee2str(i32 noundef) local_unnamed_addr #3

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z7bytesOf8DataType(i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z35rnncell_infer_forward_tmp_bytes_cpu10TensorDescS_S_12RNNParamSpecPj4Arch(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef byval(%struct.RNNParamSpec) align 8, ptr noundef, i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 52) i32 @_Z31rnn_infer_forward_tmp_bytes_cpu10TensorDescS_S_12RNNParamSpecPj4Arch(ptr nocapture noundef readonly byval(%struct.TensorDesc) align 8 %0, ptr nocapture noundef readonly byval(%struct.TensorDesc) align 8 %1, ptr nocapture noundef readonly byval(%struct.TensorDesc) align 8 %2, ptr nocapture noundef readonly byval(%struct.RNNParamSpec) align 8 %3, ptr noundef %4, i32 noundef %5) local_unnamed_addr #6 {
  %7 = alloca %struct.TensorDesc, align 8
  %8 = icmp eq ptr %4, null
  br i1 %8, label %9, label %19

9:                                                ; preds = %6
  %10 = tail call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %11 = trunc i64 %10 to i32
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11)
  %13 = load ptr, ptr @stdout, align 8, !tbaa !5
  %14 = tail call i32 @fflush(ptr noundef %13)
  %15 = tail call ptr @ee2str(i32 noundef 1)
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %15)
  %17 = load ptr, ptr @stdout, align 8, !tbaa !5
  %18 = tail call i32 @fflush(ptr noundef %17)
  tail call void @exit(i32 noundef 1) #9
  unreachable

19:                                               ; preds = %6
  %20 = load i32, ptr %0, align 8, !tbaa !9
  %21 = getelementptr inbounds i8, ptr %0, i64 4
  %22 = load i32, ptr %21, align 4, !tbaa !14
  %23 = getelementptr inbounds i8, ptr %0, i64 12
  %24 = getelementptr inbounds i8, ptr %0, i64 8
  %25 = load i32, ptr %24, align 8, !tbaa !15
  %26 = add i32 %25, -1
  %27 = zext i32 %26 to i64
  %28 = getelementptr inbounds [20 x i32], ptr %23, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !16
  %30 = add i32 %25, -2
  %31 = zext i32 %30 to i64
  %32 = getelementptr inbounds [20 x i32], ptr %23, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !16
  %34 = add i32 %25, -3
  %35 = zext i32 %34 to i64
  %36 = getelementptr inbounds [20 x i32], ptr %23, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !16
  %.not56 = icmp eq i32 %34, 0
  br i1 %.not56, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %19
  %min.iters.check = icmp ult i32 %34, 8
  br i1 %min.iters.check, label %.lr.ph.preheader60, label %vector.ph

.lr.ph.preheader60:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %.055.ph = phi i32 [ %37, %.lr.ph.preheader ], [ %44, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %35, 4294967288
  %38 = insertelement <4 x i32> <i32 poison, i32 1, i32 1, i32 1>, i32 %37, i64 0
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ %38, %vector.ph ], [ %41, %vector.body ]
  %vec.phi58 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %42, %vector.body ]
  %39 = getelementptr inbounds [20 x i32], ptr %23, i64 0, i64 %index
  %40 = getelementptr inbounds i8, ptr %39, i64 16
  %wide.load = load <4 x i32>, ptr %39, align 4, !tbaa !16
  %wide.load59 = load <4 x i32>, ptr %40, align 4, !tbaa !16
  %41 = mul <4 x i32> %wide.load, %vec.phi
  %42 = mul <4 x i32> %wide.load59, %vec.phi58
  %index.next = add nuw i64 %index, 8
  %43 = icmp eq i64 %index.next, %n.vec
  br i1 %43, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %bin.rdx = mul <4 x i32> %42, %41
  %44 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %35
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader60

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %19
  %.0.lcssa = phi i32 [ %37, %19 ], [ %44, %middle.block ], [ %50, %.lr.ph ]
  %45 = getelementptr inbounds i8, ptr %3, i64 4
  %46 = load i32, ptr %45, align 4
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %7) #8
  call void @_Z9tensor2df8DataType10DataFormatjj(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %7, i32 noundef %20, i32 noundef 14, i32 noundef %29, i32 noundef %.0.lcssa)
  %47 = call noundef i32 @_Z35rnncell_infer_forward_tmp_bytes_cpu10TensorDescS_S_12RNNParamSpecPj4Arch(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %7, ptr noundef nonnull byval(%struct.TensorDesc) align 8 %1, ptr noundef nonnull byval(%struct.TensorDesc) align 8 %2, ptr noundef nonnull byval(%struct.RNNParamSpec) align 8 %3, ptr noundef nonnull %4, i32 noundef %5)
  %.not = icmp eq i32 %47, 0
  br i1 %.not, label %61, label %51

.lr.ph:                                           ; preds = %.lr.ph.preheader60, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader60 ]
  %.055 = phi i32 [ %50, %.lr.ph ], [ %.055.ph, %.lr.ph.preheader60 ]
  %48 = getelementptr inbounds [20 x i32], ptr %23, i64 0, i64 %indvars.iv
  %49 = load i32, ptr %48, align 4, !tbaa !16
  %50 = mul i32 %49, %.055
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %35
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !21

51:                                               ; preds = %._crit_edge
  %52 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %53 = trunc i64 %52 to i32
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %53)
  %55 = load ptr, ptr @stdout, align 8, !tbaa !5
  %56 = call i32 @fflush(ptr noundef %55)
  %57 = call ptr @ee2str(i32 noundef %47)
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %57)
  %59 = load ptr, ptr @stdout, align 8, !tbaa !5
  %60 = call i32 @fflush(ptr noundef %59)
  call void @exit(i32 noundef 1) #9
  unreachable

61:                                               ; preds = %._crit_edge
  %62 = getelementptr inbounds i8, ptr %3, i64 12
  %63 = load i32, ptr %62, align 4
  %64 = icmp sgt i32 %63, 0
  %65 = select i1 %64, i32 %63, i32 %46
  %66 = load i32, ptr %3, align 8, !tbaa !22
  %switch.tableidx = add i32 %66, -1
  %67 = icmp ult i32 %switch.tableidx, 3
  br i1 %67, label %switch.lookup, label %69

switch.lookup:                                    ; preds = %61
  %68 = zext nneg i32 %switch.tableidx to i64
  %switch.gep = getelementptr inbounds [3 x i32], ptr @switch.table._Z31rnn_infer_forward_tmp_bytes_cpu10TensorDescS_S_12RNNParamSpecPj4Arch, i64 0, i64 %68
  %switch.load = load i32, ptr %switch.gep, align 4
  br label %69

69:                                               ; preds = %61, %switch.lookup
  %.049 = phi i32 [ 0, %switch.lookup ], [ 51, %61 ]
  %.048 = phi i32 [ %switch.load, %switch.lookup ], [ 0, %61 ]
  %70 = getelementptr inbounds i8, ptr %3, i64 24
  %71 = load i8, ptr %70, align 8, !tbaa !28, !range !29, !noundef !30
  %72 = zext nneg i8 %71 to i32
  %73 = add i32 %65, %46
  %74 = shl i32 %73, %72
  %75 = mul i32 %.048, %65
  %76 = add i32 %74, %75
  %77 = call noundef i32 @_Z7bytesOf8DataType(i32 noundef %20)
  %78 = mul i32 %77, %29
  %79 = mul i32 %78, %76
  %80 = load i32, ptr %4, align 4, !tbaa !16
  %81 = add i32 %79, %80
  store i32 %81, ptr %4, align 4, !tbaa !16
  %82 = icmp eq i32 %22, 2
  br i1 %82, label %83, label %87

83:                                               ; preds = %69
  %84 = call noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0)
  %85 = load i32, ptr %4, align 4, !tbaa !16
  %86 = add i32 %85, %84
  store i32 %86, ptr %4, align 4, !tbaa !16
  br label %87

87:                                               ; preds = %83, %69
  %88 = getelementptr inbounds i8, ptr %3, i64 8
  %89 = load i32, ptr %88, align 8, !tbaa !31
  %90 = icmp sgt i32 %89, -1
  br i1 %90, label %91, label %106

91:                                               ; preds = %87
  %92 = mul i32 %33, %29
  %93 = mul i32 %65, %92
  %94 = mul i32 %93, %.048
  %95 = call noundef i32 @_Z7bytesOf8DataType(i32 noundef %20)
  %96 = mul i32 %94, %95
  %97 = load i32, ptr %4, align 4, !tbaa !16
  %98 = add i32 %97, %96
  store i32 %98, ptr %4, align 4, !tbaa !16
  %99 = mul i32 %.0.lcssa, %92
  %100 = mul i32 %65, %.0.lcssa
  %. = call i32 @llvm.umax.i32(i32 %99, i32 %100)
  %101 = call noundef i32 @_Z7bytesOf8DataType(i32 noundef %20)
  %102 = mul i32 %101, %.
  %103 = load i32, ptr %4, align 4, !tbaa !16
  %104 = add i32 %102, 32
  %105 = add i32 %104, %103
  store i32 %105, ptr %4, align 4, !tbaa !16
  br label %106

106:                                              ; preds = %91, %87
  %107 = add i32 %46, %.0.lcssa
  %108 = call noundef i32 @_Z7bytesOf8DataType(i32 noundef 1)
  %109 = mul i32 %108, %107
  %110 = load i32, ptr %4, align 4, !tbaa !16
  %111 = add i32 %110, %109
  store i32 %111, ptr %4, align 4, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %7) #8
  ret i32 %.049
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z9tensor2df8DataType10DataFormatjj(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) local_unnamed_addr #5

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #7

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { noreturn 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 #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 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { noreturn 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, !11, i64 0}
!10 = !{!"_ZTS10TensorDesc", !11, i64 0, !12, i64 4, !13, i64 8, !7, i64 12}
!11 = !{!"_ZTS8DataType", !7, i64 0}
!12 = !{!"_ZTS10DataFormat", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!10, !12, i64 4}
!15 = !{!10, !13, i64 8}
!16 = !{!13, !13, i64 0}
!17 = distinct !{!17, !18, !19, !20}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !18, !20, !19}
!22 = !{!23, !24, i64 0}
!23 = !{!"_ZTS12RNNParamSpec", !24, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !25, i64 16, !25, i64 20, !26, i64 24, !25, i64 28, !27, i64 32}
!24 = !{!"_ZTS7RNNMode", !7, i64 0}
!25 = !{!"float", !7, i64 0}
!26 = !{!"bool", !7, i64 0}
!27 = !{!"_ZTS14ActivationMode", !7, i64 0}
!28 = !{!23, !26, i64 24}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!23, !13, i64 8}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass