; LLVM IR from huawei-noah/bolt :: common/model_spec/src (model_deserialize)

; 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.ModelSpec = type { i32, i32, [128 x i8], i32, i32, ptr, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, ptr }
%struct.TensorDesc = type { i32, i32, i32, [20 x i32] }

@.str.1 = external hidden unnamed_addr constant [20 x i8], align 1
@stdout = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [57 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z19updateInferDtByArchP9ModelSpec8DataType(ptr noundef, i32 noundef) #1

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

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

declare i32 @fflush(ptr noundef) #3

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z18deserialize_headerPKhP9ModelSpec8DataTypePj(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %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
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %8, align 8, !tbaa !5
  %18 = load i32, ptr %17, align 4, !tbaa !11
  %19 = zext i32 %18 to i64
  %20 = getelementptr inbounds i8, ptr %16, i64 %19
  store ptr %20, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store ptr %9, ptr %10, align 8, !tbaa !5
  %21 = load ptr, ptr %10, align 8, !tbaa !5
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.ModelSpec, ptr %23, i32 0, i32 0
  call void @_Z17deserialize_fieldIiEvPPKhPjPT_i(ptr noundef %21, ptr noundef %22, ptr noundef %24, i32 noundef 1)
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.ModelSpec, ptr %25, i32 0, i32 0
  %27 = load i32, ptr %26, align 8, !tbaa !13
  %28 = icmp ne i32 %27, 20220831
  br i1 %28, label %29, label %30

29:                                               ; preds = %4
  br label %30

30:                                               ; preds = %29, %4
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.ModelSpec, ptr %31, i32 0, i32 0
  %33 = load i32, ptr %32, align 8, !tbaa !13
  %34 = icmp slt i32 %33, 20201120
  br i1 %34, label %35, label %48

35:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %36 = call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %37 = trunc i64 %36 to i32
  store i32 %37, ptr %11, align 4, !tbaa !11
  %38 = load i32, ptr %11, align 4, !tbaa !11
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %38)
  %40 = load ptr, ptr @stdout, align 8, !tbaa !5
  %41 = call i32 @fflush(ptr noundef %40)
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.ModelSpec, ptr %42, i32 0, i32 0
  %44 = load i32, ptr %43, align 8, !tbaa !13
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %44)
  %46 = load ptr, ptr @stdout, align 8, !tbaa !5
  %47 = call i32 @fflush(ptr noundef %46)
  call void @exit(i32 noundef 1) #8
  unreachable

48:                                               ; preds = %30
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.ModelSpec, ptr %51, i32 0, i32 1
  call void @_Z17deserialize_fieldIiEvPPKhPjPT_i(ptr noundef %49, ptr noundef %50, ptr noundef %52, i32 noundef 1)
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.ModelSpec, ptr %53, i32 0, i32 1
  %55 = load i32, ptr %54, align 4, !tbaa !15
  %56 = icmp ne i32 %55, 1141119
  br i1 %56, label %57, label %70

57:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %58 = call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %59 = trunc i64 %58 to i32
  store i32 %59, ptr %12, align 4, !tbaa !11
  %60 = load i32, ptr %12, align 4, !tbaa !11
  %61 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %60)
  %62 = load ptr, ptr @stdout, align 8, !tbaa !5
  %63 = call i32 @fflush(ptr noundef %62)
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.ModelSpec, ptr %64, i32 0, i32 1
  %66 = load i32, ptr %65, align 4, !tbaa !15
  %67 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef 1141119, i32 noundef %66)
  %68 = load ptr, ptr @stdout, align 8, !tbaa !5
  %69 = call i32 @fflush(ptr noundef %68)
  call void @exit(i32 noundef 1) #8
  unreachable

70:                                               ; preds = %48
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.ModelSpec, ptr %73, i32 0, i32 2
  %75 = getelementptr inbounds [128 x i8], ptr %74, i64 0, i64 0
  call void @_Z17deserialize_fieldIcEvPPKhPjPT_i(ptr noundef %71, ptr noundef %72, ptr noundef %75, i32 noundef 128)
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.ModelSpec, ptr %78, i32 0, i32 3
  call void @_Z17deserialize_fieldI8DataTypeEvPPKhPjPT_i(ptr noundef %76, ptr noundef %77, ptr noundef %79, i32 noundef 1)
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = load i32, ptr %7, align 4, !tbaa !9
  %82 = call noundef i32 @_Z19updateInferDtByArchP9ModelSpec8DataType(ptr noundef %80, i32 noundef %81)
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.ModelSpec, ptr %85, i32 0, i32 4
  call void @_Z17deserialize_fieldIiEvPPKhPjPT_i(ptr noundef %83, ptr noundef %84, ptr noundef %86, i32 noundef 1)
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.ModelSpec, ptr %87, i32 0, i32 4
  %89 = load i32, ptr %88, align 4, !tbaa !16
  %90 = sext i32 %89 to i64
  %91 = mul i64 %90, 8
  %92 = trunc i64 %91 to i32
  %93 = call noundef ptr @_Z9mt_mallocj(i32 noundef %92)
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.ModelSpec, ptr %94, i32 0, i32 5
  store ptr %93, ptr %95, align 8, !tbaa !17
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.ModelSpec, ptr %96, i32 0, i32 4
  %98 = load i32, ptr %97, align 4, !tbaa !16
  %99 = sext i32 %98 to i64
  %100 = mul i64 %99, 92
  %101 = trunc i64 %100 to i32
  %102 = call noundef ptr @_Z9mt_mallocj(i32 noundef %101)
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.ModelSpec, ptr %103, i32 0, i32 6
  store ptr %102, ptr %104, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %105

105:                                              ; preds = %129, %70
  %106 = load i32, ptr %13, align 4, !tbaa !11
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.ModelSpec, ptr %107, i32 0, i32 4
  %109 = load i32, ptr %108, align 4, !tbaa !16
  %110 = icmp slt i32 %106, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %105
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %132

112:                                              ; preds = %105
  %113 = call noundef ptr @_Z9mt_mallocj(i32 noundef 128)
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.ModelSpec, ptr %114, i32 0, i32 5
  %116 = load ptr, ptr %115, align 8, !tbaa !17
  %117 = load i32, ptr %13, align 4, !tbaa !11
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds ptr, ptr %116, i64 %118
  store ptr %113, ptr %119, align 8, !tbaa !5
  %120 = load ptr, ptr %10, align 8, !tbaa !5
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.ModelSpec, ptr %122, i32 0, i32 5
  %124 = load ptr, ptr %123, align 8, !tbaa !17
  %125 = load i32, ptr %13, align 4, !tbaa !11
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds ptr, ptr %124, i64 %126
  %128 = load ptr, ptr %127, align 8, !tbaa !5
  call void @_Z17deserialize_fieldIcEvPPKhPjPT_i(ptr noundef %120, ptr noundef %121, ptr noundef %128, i32 noundef 128)
  br label %129

129:                                              ; preds = %112
  %130 = load i32, ptr %13, align 4, !tbaa !11
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %13, align 4, !tbaa !11
  br label %105, !llvm.loop !19

132:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %133

133:                                              ; preds = %185, %132
  %134 = load i32, ptr %14, align 4, !tbaa !11
  %135 = load ptr, ptr %6, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.ModelSpec, ptr %135, i32 0, i32 4
  %137 = load i32, ptr %136, align 4, !tbaa !16
  %138 = icmp slt i32 %134, %137
  br i1 %138, label %140, label %139

139:                                              ; preds = %133
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %188

140:                                              ; preds = %133
  %141 = load ptr, ptr %10, align 8, !tbaa !5
  %142 = load ptr, ptr %8, align 8, !tbaa !5
  %143 = load ptr, ptr %6, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.ModelSpec, ptr %143, i32 0, i32 6
  %145 = load ptr, ptr %144, align 8, !tbaa !18
  %146 = load i32, ptr %14, align 4, !tbaa !11
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds %struct.TensorDesc, ptr %145, i64 %147
  %149 = load ptr, ptr %6, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.ModelSpec, ptr %149, i32 0, i32 0
  %151 = load i32, ptr %150, align 8, !tbaa !13
  %152 = call noundef i32 @_Z27get_operator_parameter_sizei12OperatorType(i32 noundef %151, i32 noundef 1)
  call void @_Z17deserialize_fieldIhEvPPKhPjPT_i(ptr noundef %141, ptr noundef %142, ptr noundef %148, i32 noundef %152)
  %153 = load ptr, ptr %6, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.ModelSpec, ptr %153, i32 0, i32 6
  %155 = load ptr, ptr %154, align 8, !tbaa !18
  %156 = load i32, ptr %14, align 4, !tbaa !11
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds %struct.TensorDesc, ptr %155, i64 %157
  %159 = getelementptr inbounds %struct.TensorDesc, ptr %158, i32 0, i32 0
  %160 = load i32, ptr %159, align 4, !tbaa !21
  %161 = icmp eq i32 %160, 4
  br i1 %161, label %172, label %162

162:                                              ; preds = %140
  %163 = load ptr, ptr %6, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.ModelSpec, ptr %163, i32 0, i32 6
  %165 = load ptr, ptr %164, align 8, !tbaa !18
  %166 = load i32, ptr %14, align 4, !tbaa !11
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds %struct.TensorDesc, ptr %165, i64 %167
  %169 = getelementptr inbounds %struct.TensorDesc, ptr %168, i32 0, i32 0
  %170 = load i32, ptr %169, align 4, !tbaa !21
  %171 = icmp eq i32 %170, 6
  br i1 %171, label %172, label %184

172:                                              ; preds = %162, %140
  %173 = load ptr, ptr %6, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.ModelSpec, ptr %173, i32 0, i32 3
  %175 = load i32, ptr %174, align 8, !tbaa !24
  %176 = call noundef i32 @_Z15noQuantDataType8DataType(i32 noundef %175)
  %177 = load ptr, ptr %6, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.ModelSpec, ptr %177, i32 0, i32 6
  %179 = load ptr, ptr %178, align 8, !tbaa !18
  %180 = load i32, ptr %14, align 4, !tbaa !11
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds %struct.TensorDesc, ptr %179, i64 %181
  %183 = getelementptr inbounds %struct.TensorDesc, ptr %182, i32 0, i32 0
  store i32 %176, ptr %183, align 4, !tbaa !21
  br label %184

184:                                              ; preds = %172, %162
  br label %185

185:                                              ; preds = %184
  %186 = load i32, ptr %14, align 4, !tbaa !11
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %14, align 4, !tbaa !11
  br label %133, !llvm.loop !25

188:                                              ; preds = %139
  %189 = load ptr, ptr %10, align 8, !tbaa !5
  %190 = load ptr, ptr %8, align 8, !tbaa !5
  %191 = load ptr, ptr %6, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.ModelSpec, ptr %191, i32 0, i32 7
  call void @_Z17deserialize_fieldIiEvPPKhPjPT_i(ptr noundef %189, ptr noundef %190, ptr noundef %192, i32 noundef 1)
  %193 = load ptr, ptr %6, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.ModelSpec, ptr %193, i32 0, i32 7
  %195 = load i32, ptr %194, align 8, !tbaa !26
  %196 = mul nsw i32 %195, 128
  %197 = call noundef ptr @_Z9mt_mallocj(i32 noundef %196)
  %198 = load ptr, ptr %6, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.ModelSpec, ptr %198, i32 0, i32 8
  store ptr %197, ptr %199, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !11
  br label %200

200:                                              ; preds = %224, %188
  %201 = load i32, ptr %15, align 4, !tbaa !11
  %202 = load ptr, ptr %6, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.ModelSpec, ptr %202, i32 0, i32 7
  %204 = load i32, ptr %203, align 8, !tbaa !26
  %205 = icmp slt i32 %201, %204
  br i1 %205, label %207, label %206

206:                                              ; preds = %200
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %227

207:                                              ; preds = %200
  %208 = call noundef ptr @_Z9mt_mallocj(i32 noundef 128)
  %209 = load ptr, ptr %6, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.ModelSpec, ptr %209, i32 0, i32 8
  %211 = load ptr, ptr %210, align 8, !tbaa !27
  %212 = load i32, ptr %15, align 4, !tbaa !11
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds ptr, ptr %211, i64 %213
  store ptr %208, ptr %214, align 8, !tbaa !5
  %215 = load ptr, ptr %10, align 8, !tbaa !5
  %216 = load ptr, ptr %8, align 8, !tbaa !5
  %217 = load ptr, ptr %6, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.ModelSpec, ptr %217, i32 0, i32 8
  %219 = load ptr, ptr %218, align 8, !tbaa !27
  %220 = load i32, ptr %15, align 4, !tbaa !11
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds ptr, ptr %219, i64 %221
  %223 = load ptr, ptr %222, align 8, !tbaa !5
  call void @_Z17deserialize_fieldIcEvPPKhPjPT_i(ptr noundef %215, ptr noundef %216, ptr noundef %223, i32 noundef 128)
  br label %224

224:                                              ; preds = %207
  %225 = load i32, ptr %15, align 4, !tbaa !11
  %226 = add nsw i32 %225, 1
  store i32 %226, ptr %15, align 4, !tbaa !11
  br label %200, !llvm.loop !28

227:                                              ; preds = %206
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  ret i32 0
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z17deserialize_fieldIiEvPPKhPjPT_i(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z17deserialize_fieldIcEvPPKhPjPT_i(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z17deserialize_fieldI8DataTypeEvPPKhPjPT_i(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z17deserialize_fieldIhEvPPKhPjPT_i(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #5

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = { 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 #7 = { nounwind }
attributes #8 = { 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 = !{!"_ZTS8DataType", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"_ZTS9ModelSpec", !12, i64 0, !12, i64 4, !7, i64 8, !10, i64 136, !12, i64 140, !6, i64 144, !6, i64 152, !12, i64 160, !6, i64 168, !12, i64 176, !6, i64 184, !12, i64 192, !6, i64 200, !12, i64 208, !6, i64 216, !6, i64 224}
!15 = !{!14, !12, i64 4}
!16 = !{!14, !12, i64 140}
!17 = !{!14, !6, i64 144}
!18 = !{!14, !6, i64 152}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!22, !10, i64 0}
!22 = !{!"_ZTS10TensorDesc", !10, i64 0, !23, i64 4, !12, i64 8, !7, i64 12}
!23 = !{!"_ZTS10DataFormat", !7, i64 0}
!24 = !{!14, !10, i64 136}
!25 = distinct !{!25, !20}
!26 = !{!14, !12, i64 160}
!27 = !{!14, !6, i64 168}
!28 = distinct !{!28, !20}


; 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] }

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

; 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 uwtable
declare dso_local noundef i32 @_Z19updateInferDtByArchP9ModelSpec8DataType(ptr noundef, i32 noundef) local_unnamed_addr #1

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z18deserialize_headerPKhP9ModelSpec8DataTypePj(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #1 {
  %5 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %6 = load i32, ptr %3, align 4, !tbaa !5
  %7 = zext i32 %6 to i64
  %8 = getelementptr inbounds i8, ptr %0, i64 %7
  store ptr %8, ptr %5, align 8, !tbaa !9
  call void @_Z17deserialize_fieldIiEvPPKhPjPT_i(ptr noundef nonnull %5, ptr noundef nonnull %3, ptr noundef %1, i32 noundef 1)
  %9 = load i32, ptr %1, align 8, !tbaa !11
  %10 = icmp slt i32 %9, 20201120
  br i1 %10, label %11, label %21

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

21:                                               ; preds = %4
  %22 = getelementptr inbounds i8, ptr %1, i64 4
  call void @_Z17deserialize_fieldIiEvPPKhPjPT_i(ptr noundef nonnull %5, ptr noundef nonnull %3, ptr noundef nonnull %22, i32 noundef 1)
  %23 = load i32, ptr %22, align 4, !tbaa !14
  %.not = icmp eq i32 %23, 1141119
  br i1 %.not, label %34, label %24

24:                                               ; preds = %21
  %25 = call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %26 = trunc i64 %25 to i32
  %27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %26)
  %28 = load ptr, ptr @stdout, align 8, !tbaa !9
  %29 = call i32 @fflush(ptr noundef %28)
  %30 = load i32, ptr %22, align 4, !tbaa !14
  %31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 1141119, i32 noundef %30)
  %32 = load ptr, ptr @stdout, align 8, !tbaa !9
  %33 = call i32 @fflush(ptr noundef %32)
  call void @exit(i32 noundef 1) #8
  unreachable

34:                                               ; preds = %21
  %35 = getelementptr inbounds i8, ptr %1, i64 8
  call void @_Z17deserialize_fieldIcEvPPKhPjPT_i(ptr noundef nonnull %5, ptr noundef nonnull %3, ptr noundef nonnull %35, i32 noundef 128)
  %36 = getelementptr inbounds i8, ptr %1, i64 136
  call void @_Z17deserialize_fieldI8DataTypeEvPPKhPjPT_i(ptr noundef nonnull %5, ptr noundef nonnull %3, ptr noundef nonnull %36, i32 noundef 1)
  %37 = call noundef i32 @_Z19updateInferDtByArchP9ModelSpec8DataType(ptr noundef nonnull %1, i32 noundef %2)
  %38 = getelementptr inbounds i8, ptr %1, i64 140
  call void @_Z17deserialize_fieldIiEvPPKhPjPT_i(ptr noundef nonnull %5, ptr noundef nonnull %3, ptr noundef nonnull %38, i32 noundef 1)
  %39 = load i32, ptr %38, align 4, !tbaa !15
  %40 = shl i32 %39, 3
  %41 = call noundef ptr @_Z9mt_mallocj(i32 noundef %40)
  %42 = getelementptr inbounds i8, ptr %1, i64 144
  store ptr %41, ptr %42, align 8, !tbaa !16
  %43 = load i32, ptr %38, align 4, !tbaa !15
  %44 = mul i32 %43, 92
  %45 = call noundef ptr @_Z9mt_mallocj(i32 noundef %44)
  %46 = getelementptr inbounds i8, ptr %1, i64 152
  store ptr %45, ptr %46, align 8, !tbaa !17
  %47 = load i32, ptr %38, align 4, !tbaa !15
  %48 = icmp sgt i32 %47, 0
  br i1 %48, label %.lr.ph, label %._crit_edge

.preheader:                                       ; preds = %.lr.ph
  %49 = icmp sgt i32 %56, 0
  br i1 %49, label %.lr.ph72.preheader, label %._crit_edge

.lr.ph72.preheader:                               ; preds = %.preheader
  %.pre = load ptr, ptr %46, align 8, !tbaa !17
  br label %.lr.ph72

.lr.ph:                                           ; preds = %34, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %34 ]
  %50 = call noundef ptr @_Z9mt_mallocj(i32 noundef 128)
  %51 = load ptr, ptr %42, align 8, !tbaa !16
  %52 = getelementptr inbounds ptr, ptr %51, i64 %indvars.iv
  store ptr %50, ptr %52, align 8, !tbaa !9
  %53 = load ptr, ptr %42, align 8, !tbaa !16
  %54 = getelementptr inbounds ptr, ptr %53, i64 %indvars.iv
  %55 = load ptr, ptr %54, align 8, !tbaa !9
  call void @_Z17deserialize_fieldIcEvPPKhPjPT_i(ptr noundef nonnull %5, ptr noundef nonnull %3, ptr noundef %55, i32 noundef 128)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %56 = load i32, ptr %38, align 4, !tbaa !15
  %57 = sext i32 %56 to i64
  %58 = icmp slt i64 %indvars.iv.next, %57
  br i1 %58, label %.lr.ph, label %.preheader, !llvm.loop !18

._crit_edge:                                      ; preds = %78, %34, %.preheader
  %59 = getelementptr inbounds i8, ptr %1, i64 160
  call void @_Z17deserialize_fieldIiEvPPKhPjPT_i(ptr noundef nonnull %5, ptr noundef nonnull %3, ptr noundef nonnull %59, i32 noundef 1)
  %60 = load i32, ptr %59, align 8, !tbaa !20
  %61 = shl nsw i32 %60, 7
  %62 = call noundef ptr @_Z9mt_mallocj(i32 noundef %61)
  %63 = getelementptr inbounds i8, ptr %1, i64 168
  store ptr %62, ptr %63, align 8, !tbaa !21
  %64 = load i32, ptr %59, align 8, !tbaa !20
  %65 = icmp sgt i32 %64, 0
  br i1 %65, label %.lr.ph75, label %._crit_edge76

.lr.ph72:                                         ; preds = %.lr.ph72.preheader, %78
  %66 = phi ptr [ %.pre, %.lr.ph72.preheader ], [ %79, %78 ]
  %indvars.iv78 = phi i64 [ 0, %.lr.ph72.preheader ], [ %indvars.iv.next79, %78 ]
  %67 = getelementptr inbounds %struct.TensorDesc, ptr %66, i64 %indvars.iv78
  %68 = load i32, ptr %1, align 8, !tbaa !11
  %69 = call noundef i32 @_Z27get_operator_parameter_sizei12OperatorType(i32 noundef %68, i32 noundef 1)
  call void @_Z17deserialize_fieldIhEvPPKhPjPT_i(ptr noundef nonnull %5, ptr noundef nonnull %3, ptr noundef %67, i32 noundef %69)
  %70 = load ptr, ptr %46, align 8, !tbaa !17
  %71 = getelementptr inbounds %struct.TensorDesc, ptr %70, i64 %indvars.iv78
  %72 = load i32, ptr %71, align 4, !tbaa !22
  switch i32 %72, label %78 [
    i32 4, label %73
    i32 6, label %73
  ]

73:                                               ; preds = %.lr.ph72, %.lr.ph72
  %74 = load i32, ptr %36, align 8, !tbaa !25
  %75 = call noundef i32 @_Z15noQuantDataType8DataType(i32 noundef %74)
  %76 = load ptr, ptr %46, align 8, !tbaa !17
  %77 = getelementptr inbounds %struct.TensorDesc, ptr %76, i64 %indvars.iv78
  store i32 %75, ptr %77, align 4, !tbaa !22
  br label %78

78:                                               ; preds = %.lr.ph72, %73
  %79 = phi ptr [ %70, %.lr.ph72 ], [ %76, %73 ]
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %80 = load i32, ptr %38, align 4, !tbaa !15
  %81 = sext i32 %80 to i64
  %82 = icmp slt i64 %indvars.iv.next79, %81
  br i1 %82, label %.lr.ph72, label %._crit_edge, !llvm.loop !26

._crit_edge76:                                    ; preds = %.lr.ph75, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  ret i32 0

.lr.ph75:                                         ; preds = %._crit_edge, %.lr.ph75
  %indvars.iv81 = phi i64 [ %indvars.iv.next82, %.lr.ph75 ], [ 0, %._crit_edge ]
  %83 = call noundef ptr @_Z9mt_mallocj(i32 noundef 128)
  %84 = load ptr, ptr %63, align 8, !tbaa !21
  %85 = getelementptr inbounds ptr, ptr %84, i64 %indvars.iv81
  store ptr %83, ptr %85, align 8, !tbaa !9
  %86 = load ptr, ptr %63, align 8, !tbaa !21
  %87 = getelementptr inbounds ptr, ptr %86, i64 %indvars.iv81
  %88 = load ptr, ptr %87, align 8, !tbaa !9
  call void @_Z17deserialize_fieldIcEvPPKhPjPT_i(ptr noundef nonnull %5, ptr noundef nonnull %3, ptr noundef %88, i32 noundef 128)
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %89 = load i32, ptr %59, align 8, !tbaa !20
  %90 = sext i32 %89 to i64
  %91 = icmp slt i64 %indvars.iv.next82, %90
  br i1 %91, label %.lr.ph75, label %._crit_edge76, !llvm.loop !27
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z17deserialize_fieldIiEvPPKhPjPT_i(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z17deserialize_fieldIcEvPPKhPjPT_i(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z17deserialize_fieldI8DataTypeEvPPKhPjPT_i(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z17deserialize_fieldIhEvPPKhPjPT_i(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #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 = { 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 #7 = { nounwind }
attributes #8 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS9ModelSpec", !6, i64 0, !6, i64 4, !7, i64 8, !13, i64 136, !6, i64 140, !10, i64 144, !10, i64 152, !6, i64 160, !10, i64 168, !6, i64 176, !10, i64 184, !6, i64 192, !10, i64 200, !6, i64 208, !10, i64 216, !10, i64 224}
!13 = !{!"_ZTS8DataType", !7, i64 0}
!14 = !{!12, !6, i64 4}
!15 = !{!12, !6, i64 140}
!16 = !{!12, !10, i64 144}
!17 = !{!12, !10, i64 152}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!12, !6, i64 160}
!21 = !{!12, !10, i64 168}
!22 = !{!23, !13, i64 0}
!23 = !{!"_ZTS10TensorDesc", !13, i64 0, !24, i64 4, !6, i64 8, !7, i64 12}
!24 = !{!"_ZTS10DataFormat", !7, i64 0}
!25 = !{!12, !13, i64 136}
!26 = distinct !{!26, !19}
!27 = distinct !{!27, !19}


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