; LLVM IR from huawei-noah/bolt :: inference/examples/c_api (c_image_classification)

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

@threadsNum = external global i32, align 4
@useFileStream = external global i32, align 4
@modelPath = external global ptr, align 8
@algorithmMapPath = external global ptr, align 8
@affinity = external global i32, align 4
@loopTime = external global i32, align 4
@inputDataPath = external global ptr, align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = load ptr, ptr %5, align 8, !tbaa !9
  %32 = call i32 @ParseOptions(i32 noundef %30, ptr noundef %31)
  store i32 %32, ptr %6, align 4, !tbaa !5
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %37

35:                                               ; preds = %2
  %36 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %36, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %159

37:                                               ; preds = %2
  %38 = load i32, ptr @threadsNum, align 4, !tbaa !5
  call void @SetNumThreads(i32 noundef %38)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %39 = load i32, ptr @useFileStream, align 4, !tbaa !5
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %49

41:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %42 = load ptr, ptr @modelPath, align 8, !tbaa !9
  %43 = call ptr @BuildFileStream(ptr noundef %42)
  store ptr %43, ptr %10, align 8, !tbaa !9
  %44 = load i32, ptr @useFileStream, align 4, !tbaa !5
  %45 = load ptr, ptr %10, align 8, !tbaa !9
  %46 = load ptr, ptr @algorithmMapPath, align 8, !tbaa !9
  %47 = load i32, ptr @affinity, align 4, !tbaa !5
  %48 = call i32 @CreateInference(i32 noundef %44, ptr noundef %45, ptr noundef %46, i32 noundef %47, ptr noundef %8, ptr noundef %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %55

49:                                               ; preds = %37
  %50 = load i32, ptr @useFileStream, align 4, !tbaa !5
  %51 = load ptr, ptr @modelPath, align 8, !tbaa !9
  %52 = load ptr, ptr @algorithmMapPath, align 8, !tbaa !9
  %53 = load i32, ptr @affinity, align 4, !tbaa !5
  %54 = call i32 @CreateInference(i32 noundef %50, ptr noundef %51, ptr noundef %52, i32 noundef %53, ptr noundef %8, ptr noundef %9)
  br label %55

55:                                               ; preds = %49, %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %56 = load ptr, ptr %8, align 8, !tbaa !9
  %57 = call i32 @CreateInputTensorDesc(ptr noundef %56, ptr noundef %11, ptr noundef %18, ptr noundef %12, ptr noundef %13, ptr noundef %14, ptr noundef %15, ptr noundef %16, ptr noundef %17)
  %58 = load i32, ptr %11, align 4, !tbaa !5
  %59 = load ptr, ptr %18, align 8, !tbaa !9
  %60 = load ptr, ptr %12, align 8, !tbaa !9
  %61 = load ptr, ptr %13, align 8, !tbaa !9
  %62 = load ptr, ptr %14, align 8, !tbaa !9
  %63 = load ptr, ptr %15, align 8, !tbaa !9
  %64 = load ptr, ptr %16, align 8, !tbaa !9
  %65 = load ptr, ptr %17, align 8, !tbaa !9
  %66 = call i32 @MallocTensor(i32 noundef %58, ptr noundef %59, ptr noundef %60, ptr noundef %61, ptr noundef %62, ptr noundef %63, ptr noundef %64, ptr noundef %65, ptr noundef %19)
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %67 = load ptr, ptr %9, align 8, !tbaa !9
  %68 = call i32 @CreateOutputTensorDesc(ptr noundef %67, ptr noundef %20, ptr noundef %27, ptr noundef %21, ptr noundef %22, ptr noundef %23, ptr noundef %24, ptr noundef %25, ptr noundef %26)
  %69 = load i32, ptr %20, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = mul i64 8, %70
  %72 = call noalias ptr @malloc(i64 noundef %71) #6
  store ptr %72, ptr %28, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  store i32 0, ptr %29, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %133, %55
  %74 = load i32, ptr %29, align 4, !tbaa !5
  %75 = load i32, ptr @loopTime, align 4, !tbaa !5
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  br label %136

78:                                               ; preds = %73
  %79 = load ptr, ptr @inputDataPath, align 8, !tbaa !9
  %80 = icmp ne ptr %79, null
  br i1 %80, label %81, label %93

81:                                               ; preds = %78
  %82 = load i32, ptr %11, align 4, !tbaa !5
  %83 = load ptr, ptr %18, align 8, !tbaa !9
  %84 = load ptr, ptr %12, align 8, !tbaa !9
  %85 = load ptr, ptr %13, align 8, !tbaa !9
  %86 = load ptr, ptr %14, align 8, !tbaa !9
  %87 = load ptr, ptr %15, align 8, !tbaa !9
  %88 = load ptr, ptr %16, align 8, !tbaa !9
  %89 = load ptr, ptr %17, align 8, !tbaa !9
  %90 = load ptr, ptr %19, align 8, !tbaa !9
  %91 = load ptr, ptr @inputDataPath, align 8, !tbaa !9
  %92 = call i32 @LoadTensor(i32 noundef %82, ptr noundef %83, ptr noundef %84, ptr noundef %85, ptr noundef %86, ptr noundef %87, ptr noundef %88, ptr noundef %89, ptr noundef %90, ptr noundef %91)
  br label %104

93:                                               ; preds = %78
  %94 = load i32, ptr %11, align 4, !tbaa !5
  %95 = load ptr, ptr %18, align 8, !tbaa !9
  %96 = load ptr, ptr %12, align 8, !tbaa !9
  %97 = load ptr, ptr %13, align 8, !tbaa !9
  %98 = load ptr, ptr %14, align 8, !tbaa !9
  %99 = load ptr, ptr %15, align 8, !tbaa !9
  %100 = load ptr, ptr %16, align 8, !tbaa !9
  %101 = load ptr, ptr %17, align 8, !tbaa !9
  %102 = load ptr, ptr %19, align 8, !tbaa !9
  %103 = call i32 @InitTensor(i32 noundef %94, ptr noundef %95, ptr noundef %96, ptr noundef %97, ptr noundef %98, ptr noundef %99, ptr noundef %100, ptr noundef %101, ptr noundef %102, float noundef 1.000000e+00)
  br label %104

104:                                              ; preds = %93, %81
  %105 = load i32, ptr %11, align 4, !tbaa !5
  %106 = load ptr, ptr %18, align 8, !tbaa !9
  %107 = load ptr, ptr %12, align 8, !tbaa !9
  %108 = load ptr, ptr %13, align 8, !tbaa !9
  %109 = load ptr, ptr %14, align 8, !tbaa !9
  %110 = load ptr, ptr %15, align 8, !tbaa !9
  %111 = load ptr, ptr %16, align 8, !tbaa !9
  %112 = load ptr, ptr %17, align 8, !tbaa !9
  %113 = load ptr, ptr %19, align 8, !tbaa !9
  %114 = call i32 @PrintTensor(i32 noundef %105, ptr noundef %106, ptr noundef %107, ptr noundef %108, ptr noundef %109, ptr noundef %110, ptr noundef %111, ptr noundef %112, ptr noundef %113, ptr noundef @.str, i32 noundef 8)
  %115 = load ptr, ptr %8, align 8, !tbaa !9
  %116 = load ptr, ptr %9, align 8, !tbaa !9
  %117 = load i32, ptr %11, align 4, !tbaa !5
  %118 = load ptr, ptr %18, align 8, !tbaa !9
  %119 = load ptr, ptr %19, align 8, !tbaa !9
  call void @RunModel(ptr noundef %115, ptr noundef %116, i32 noundef %117, ptr noundef %118, ptr noundef %119)
  %120 = load ptr, ptr %9, align 8, !tbaa !9
  %121 = load i32, ptr %20, align 4, !tbaa !5
  %122 = load ptr, ptr %28, align 8, !tbaa !9
  call void @GetOutputDataFromResultHandle(ptr noundef %120, i32 noundef %121, ptr noundef %122)
  %123 = load i32, ptr %20, align 4, !tbaa !5
  %124 = load ptr, ptr %27, align 8, !tbaa !9
  %125 = load ptr, ptr %21, align 8, !tbaa !9
  %126 = load ptr, ptr %22, align 8, !tbaa !9
  %127 = load ptr, ptr %23, align 8, !tbaa !9
  %128 = load ptr, ptr %24, align 8, !tbaa !9
  %129 = load ptr, ptr %25, align 8, !tbaa !9
  %130 = load ptr, ptr %26, align 8, !tbaa !9
  %131 = load ptr, ptr %28, align 8, !tbaa !9
  %132 = call i32 @PrintTensor(i32 noundef %123, ptr noundef %124, ptr noundef %125, ptr noundef %126, ptr noundef %127, ptr noundef %128, ptr noundef %129, ptr noundef %130, ptr noundef %131, ptr noundef @.str.1, i32 noundef 8)
  br label %133

133:                                              ; preds = %104
  %134 = load i32, ptr %29, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %29, align 4, !tbaa !5
  br label %73, !llvm.loop !11

136:                                              ; preds = %77
  %137 = load i32, ptr %11, align 4, !tbaa !5
  %138 = load ptr, ptr %18, align 8, !tbaa !9
  %139 = load ptr, ptr %12, align 8, !tbaa !9
  %140 = load ptr, ptr %13, align 8, !tbaa !9
  %141 = load ptr, ptr %14, align 8, !tbaa !9
  %142 = load ptr, ptr %15, align 8, !tbaa !9
  %143 = load ptr, ptr %16, align 8, !tbaa !9
  %144 = load ptr, ptr %17, align 8, !tbaa !9
  %145 = load ptr, ptr %19, align 8, !tbaa !9
  %146 = call i32 @FreeTensor(i32 noundef %137, ptr noundef %138, ptr noundef %139, ptr noundef %140, ptr noundef %141, ptr noundef %142, ptr noundef %143, ptr noundef %144, ptr noundef %145)
  %147 = load i32, ptr %20, align 4, !tbaa !5
  %148 = load ptr, ptr %27, align 8, !tbaa !9
  %149 = load ptr, ptr %21, align 8, !tbaa !9
  %150 = load ptr, ptr %22, align 8, !tbaa !9
  %151 = load ptr, ptr %23, align 8, !tbaa !9
  %152 = load ptr, ptr %24, align 8, !tbaa !9
  %153 = load ptr, ptr %25, align 8, !tbaa !9
  %154 = load ptr, ptr %26, align 8, !tbaa !9
  %155 = call i32 @FreeTensorDesc(i32 noundef %147, ptr noundef %148, ptr noundef %149, ptr noundef %150, ptr noundef %151, ptr noundef %152, ptr noundef %153, ptr noundef %154)
  %156 = load ptr, ptr %28, align 8, !tbaa !9
  call void @free(ptr noundef %156) #5
  %157 = load ptr, ptr %9, align 8, !tbaa !9
  call void @FreeResultHandle(ptr noundef %157)
  %158 = load ptr, ptr %8, align 8, !tbaa !9
  call void @DestroyModel(ptr noundef %158)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %159

159:                                              ; preds = %136, %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %160 = load i32, ptr %3, align 4
  ret i32 %160
}

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

declare i32 @ParseOptions(i32 noundef, ptr noundef) #2

declare void @SetNumThreads(i32 noundef) #2

declare ptr @BuildFileStream(ptr noundef) #2

declare i32 @CreateInference(i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2

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

declare i32 @CreateInputTensorDesc(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @MallocTensor(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @CreateOutputTensorDesc(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

declare i32 @LoadTensor(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @InitTensor(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, float noundef) #2

declare i32 @PrintTensor(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

declare void @RunModel(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2

declare void @GetOutputDataFromResultHandle(ptr noundef, i32 noundef, ptr noundef) #2

declare i32 @FreeTensor(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @FreeTensorDesc(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

declare void @FreeResultHandle(ptr noundef) #2

declare void @DestroyModel(ptr noundef) #2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #4 = { 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 = { nounwind }
attributes #6 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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

@threadsNum = external local_unnamed_addr global i32, align 4
@useFileStream = external local_unnamed_addr global i32, align 4
@modelPath = external local_unnamed_addr global ptr, align 8
@algorithmMapPath = external local_unnamed_addr global ptr, align 8
@affinity = external local_unnamed_addr global i32, align 4
@loopTime = external local_unnamed_addr global i32, align 4
@inputDataPath = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = tail call i32 @ParseOptions(i32 noundef %0, ptr noundef %1) #5
  %.not = icmp eq i32 %22, 0
  br i1 %.not, label %23, label %122

23:                                               ; preds = %2
  %24 = load i32, ptr @threadsNum, align 4, !tbaa !5
  tail call void @SetNumThreads(i32 noundef %24) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %25 = load i32, ptr @useFileStream, align 4, !tbaa !5
  %.not14 = icmp eq i32 %25, 0
  %26 = load ptr, ptr @modelPath, align 8, !tbaa !9
  br i1 %.not14, label %33, label %27

27:                                               ; preds = %23
  %28 = tail call ptr @BuildFileStream(ptr noundef %26) #5
  %29 = load i32, ptr @useFileStream, align 4, !tbaa !5
  %30 = load ptr, ptr @algorithmMapPath, align 8, !tbaa !9
  %31 = load i32, ptr @affinity, align 4, !tbaa !5
  %32 = call i32 @CreateInference(i32 noundef %29, ptr noundef %28, ptr noundef %30, i32 noundef %31, ptr noundef nonnull %3, ptr noundef nonnull %4) #5
  br label %37

33:                                               ; preds = %23
  %34 = load ptr, ptr @algorithmMapPath, align 8, !tbaa !9
  %35 = load i32, ptr @affinity, align 4, !tbaa !5
  %36 = call i32 @CreateInference(i32 noundef 0, ptr noundef %26, ptr noundef %34, i32 noundef %35, ptr noundef nonnull %3, ptr noundef nonnull %4) #5
  br label %37

37:                                               ; preds = %33, %27
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  %38 = load ptr, ptr %3, align 8, !tbaa !9
  %39 = call i32 @CreateInputTensorDesc(ptr noundef %38, ptr noundef nonnull %5, ptr noundef nonnull %12, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %11) #5
  %40 = load i32, ptr %5, align 4, !tbaa !5
  %41 = load ptr, ptr %12, align 8, !tbaa !9
  %42 = load ptr, ptr %6, align 8, !tbaa !9
  %43 = load ptr, ptr %7, align 8, !tbaa !9
  %44 = load ptr, ptr %8, align 8, !tbaa !9
  %45 = load ptr, ptr %9, align 8, !tbaa !9
  %46 = load ptr, ptr %10, align 8, !tbaa !9
  %47 = load ptr, ptr %11, align 8, !tbaa !9
  %48 = call i32 @MallocTensor(i32 noundef %40, ptr noundef %41, ptr noundef %42, ptr noundef %43, ptr noundef %44, ptr noundef %45, ptr noundef %46, ptr noundef %47, ptr noundef nonnull %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #5
  %49 = load ptr, ptr %4, align 8, !tbaa !9
  %50 = call i32 @CreateOutputTensorDesc(ptr noundef %49, ptr noundef nonnull %14, ptr noundef nonnull %21, ptr noundef nonnull %15, ptr noundef nonnull %16, ptr noundef nonnull %17, ptr noundef nonnull %18, ptr noundef nonnull %19, ptr noundef nonnull %20) #5
  %51 = load i32, ptr %14, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = shl nsw i64 %52, 3
  %54 = call noalias ptr @malloc(i64 noundef %53) #6
  %55 = load i32, ptr @loopTime, align 4, !tbaa !5
  %56 = icmp sgt i32 %55, 0
  br i1 %56, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %92, %37
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = load ptr, ptr %12, align 8, !tbaa !9
  %59 = load ptr, ptr %6, align 8, !tbaa !9
  %60 = load ptr, ptr %7, align 8, !tbaa !9
  %61 = load ptr, ptr %8, align 8, !tbaa !9
  %62 = load ptr, ptr %9, align 8, !tbaa !9
  %63 = load ptr, ptr %10, align 8, !tbaa !9
  %64 = load ptr, ptr %11, align 8, !tbaa !9
  %65 = load ptr, ptr %13, align 8, !tbaa !9
  %66 = call i32 @FreeTensor(i32 noundef %57, ptr noundef %58, ptr noundef %59, ptr noundef %60, ptr noundef %61, ptr noundef %62, ptr noundef %63, ptr noundef %64, ptr noundef %65) #5
  %67 = load i32, ptr %14, align 4, !tbaa !5
  %68 = load ptr, ptr %21, align 8, !tbaa !9
  %69 = load ptr, ptr %15, align 8, !tbaa !9
  %70 = load ptr, ptr %16, align 8, !tbaa !9
  %71 = load ptr, ptr %17, align 8, !tbaa !9
  %72 = load ptr, ptr %18, align 8, !tbaa !9
  %73 = load ptr, ptr %19, align 8, !tbaa !9
  %74 = load ptr, ptr %20, align 8, !tbaa !9
  %75 = call i32 @FreeTensorDesc(i32 noundef %67, ptr noundef %68, ptr noundef %69, ptr noundef %70, ptr noundef %71, ptr noundef %72, ptr noundef %73, ptr noundef %74) #5
  call void @free(ptr noundef %54) #5
  %76 = load ptr, ptr %4, align 8, !tbaa !9
  call void @FreeResultHandle(ptr noundef %76) #5
  %77 = load ptr, ptr %3, align 8, !tbaa !9
  call void @DestroyModel(ptr noundef %77) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br label %122

.lr.ph:                                           ; preds = %37, %92
  %.016 = phi i32 [ %119, %92 ], [ 0, %37 ]
  %78 = load ptr, ptr @inputDataPath, align 8, !tbaa !9
  %.not15 = icmp eq ptr %78, null
  %79 = load i32, ptr %5, align 4, !tbaa !5
  %80 = load ptr, ptr %12, align 8, !tbaa !9
  %81 = load ptr, ptr %6, align 8, !tbaa !9
  %82 = load ptr, ptr %7, align 8, !tbaa !9
  %83 = load ptr, ptr %8, align 8, !tbaa !9
  %84 = load ptr, ptr %9, align 8, !tbaa !9
  %85 = load ptr, ptr %10, align 8, !tbaa !9
  %86 = load ptr, ptr %11, align 8, !tbaa !9
  %87 = load ptr, ptr %13, align 8, !tbaa !9
  br i1 %.not15, label %90, label %88

88:                                               ; preds = %.lr.ph
  %89 = call i32 @LoadTensor(i32 noundef %79, ptr noundef %80, ptr noundef %81, ptr noundef %82, ptr noundef %83, ptr noundef %84, ptr noundef %85, ptr noundef %86, ptr noundef %87, ptr noundef nonnull %78) #5
  br label %92

90:                                               ; preds = %.lr.ph
  %91 = call i32 @InitTensor(i32 noundef %79, ptr noundef %80, ptr noundef %81, ptr noundef %82, ptr noundef %83, ptr noundef %84, ptr noundef %85, ptr noundef %86, ptr noundef %87, float noundef 1.000000e+00) #5
  br label %92

92:                                               ; preds = %90, %88
  %93 = load i32, ptr %5, align 4, !tbaa !5
  %94 = load ptr, ptr %12, align 8, !tbaa !9
  %95 = load ptr, ptr %6, align 8, !tbaa !9
  %96 = load ptr, ptr %7, align 8, !tbaa !9
  %97 = load ptr, ptr %8, align 8, !tbaa !9
  %98 = load ptr, ptr %9, align 8, !tbaa !9
  %99 = load ptr, ptr %10, align 8, !tbaa !9
  %100 = load ptr, ptr %11, align 8, !tbaa !9
  %101 = load ptr, ptr %13, align 8, !tbaa !9
  %102 = call i32 @PrintTensor(i32 noundef %93, ptr noundef %94, ptr noundef %95, ptr noundef %96, ptr noundef %97, ptr noundef %98, ptr noundef %99, ptr noundef %100, ptr noundef %101, ptr noundef nonnull @.str, i32 noundef 8) #5
  %103 = load ptr, ptr %3, align 8, !tbaa !9
  %104 = load ptr, ptr %4, align 8, !tbaa !9
  %105 = load i32, ptr %5, align 4, !tbaa !5
  %106 = load ptr, ptr %12, align 8, !tbaa !9
  %107 = load ptr, ptr %13, align 8, !tbaa !9
  call void @RunModel(ptr noundef %103, ptr noundef %104, i32 noundef %105, ptr noundef %106, ptr noundef %107) #5
  %108 = load ptr, ptr %4, align 8, !tbaa !9
  %109 = load i32, ptr %14, align 4, !tbaa !5
  call void @GetOutputDataFromResultHandle(ptr noundef %108, i32 noundef %109, ptr noundef %54) #5
  %110 = load i32, ptr %14, align 4, !tbaa !5
  %111 = load ptr, ptr %21, align 8, !tbaa !9
  %112 = load ptr, ptr %15, align 8, !tbaa !9
  %113 = load ptr, ptr %16, align 8, !tbaa !9
  %114 = load ptr, ptr %17, align 8, !tbaa !9
  %115 = load ptr, ptr %18, align 8, !tbaa !9
  %116 = load ptr, ptr %19, align 8, !tbaa !9
  %117 = load ptr, ptr %20, align 8, !tbaa !9
  %118 = call i32 @PrintTensor(i32 noundef %110, ptr noundef %111, ptr noundef %112, ptr noundef %113, ptr noundef %114, ptr noundef %115, ptr noundef %116, ptr noundef %117, ptr noundef %54, ptr noundef nonnull @.str.1, i32 noundef 8) #5
  %119 = add nuw nsw i32 %.016, 1
  %120 = load i32, ptr @loopTime, align 4, !tbaa !5
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %.lr.ph, label %._crit_edge, !llvm.loop !11

122:                                              ; preds = %2, %._crit_edge
  %.010 = phi i32 [ 0, %._crit_edge ], [ %22, %2 ]
  ret i32 %.010
}

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

declare i32 @ParseOptions(i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @SetNumThreads(i32 noundef) local_unnamed_addr #2

declare ptr @BuildFileStream(ptr noundef) local_unnamed_addr #2

declare i32 @CreateInference(i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare i32 @CreateInputTensorDesc(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @MallocTensor(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @CreateOutputTensorDesc(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #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 #3

declare i32 @LoadTensor(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @InitTensor(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, float noundef) local_unnamed_addr #2

declare i32 @PrintTensor(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @RunModel(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @GetOutputDataFromResultHandle(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare i32 @FreeTensor(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @FreeTensorDesc(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare void @FreeResultHandle(ptr noundef) local_unnamed_addr #2

declare void @DestroyModel(ptr noundef) local_unnamed_addr #2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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