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

; 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
@.str = external hidden unnamed_addr constant [26 x i8], align 1
@loopTime = external global i32, align 4
@inputDataPath = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = 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) #3
  %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 %174

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) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %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) #3
  %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) #3
  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) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %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)
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #3
  %58 = load ptr, ptr %9, align 8, !tbaa !9
  %59 = call i32 @CreateOutputTensorDesc(ptr noundef %58, ptr noundef %20, ptr noundef %27, ptr noundef %21, ptr noundef %22, ptr noundef %23, ptr noundef %24, ptr noundef %25, ptr noundef %26)
  %60 = load i32, ptr %11, align 4, !tbaa !5
  %61 = load ptr, ptr %18, align 8, !tbaa !9
  %62 = load ptr, ptr %12, align 8, !tbaa !9
  %63 = load ptr, ptr %13, align 8, !tbaa !9
  %64 = load ptr, ptr %14, align 8, !tbaa !9
  %65 = load ptr, ptr %15, align 8, !tbaa !9
  %66 = load ptr, ptr %16, align 8, !tbaa !9
  %67 = load ptr, ptr %17, align 8, !tbaa !9
  %68 = call i32 @MallocTensor(i32 noundef %60, ptr noundef %61, ptr noundef %62, ptr noundef %63, ptr noundef %64, ptr noundef %65, ptr noundef %66, ptr noundef %67, ptr noundef %19)
  %69 = load i32, ptr %20, align 4, !tbaa !5
  %70 = load ptr, ptr %27, align 8, !tbaa !9
  %71 = load ptr, ptr %21, align 8, !tbaa !9
  %72 = load ptr, ptr %22, align 8, !tbaa !9
  %73 = load ptr, ptr %23, align 8, !tbaa !9
  %74 = load ptr, ptr %24, align 8, !tbaa !9
  %75 = load ptr, ptr %25, align 8, !tbaa !9
  %76 = load ptr, ptr %26, align 8, !tbaa !9
  %77 = call i32 @MallocTensor(i32 noundef %69, ptr noundef %70, ptr noundef %71, ptr noundef %72, ptr noundef %73, ptr noundef %74, ptr noundef %75, ptr noundef %76, ptr noundef %28)
  %78 = load i32, ptr @affinity, align 4, !tbaa !5
  %79 = icmp eq i32 %78, 2
  br i1 %79, label %80, label %82

80:                                               ; preds = %55
  %81 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %173

82:                                               ; preds = %55
  %83 = load ptr, ptr %8, align 8, !tbaa !9
  %84 = load i32, ptr %11, align 4, !tbaa !5
  %85 = load ptr, ptr %18, align 8, !tbaa !9
  %86 = load ptr, ptr %19, align 8, !tbaa !9
  %87 = call i32 @SetInputOutput(ptr noundef %83, i32 noundef %84, ptr noundef %85, ptr noundef %86)
  %88 = load ptr, ptr %8, align 8, !tbaa !9
  %89 = load i32, ptr %20, align 4, !tbaa !5
  %90 = load ptr, ptr %27, align 8, !tbaa !9
  %91 = load ptr, ptr %28, align 8, !tbaa !9
  %92 = call i32 @SetInputOutput(ptr noundef %88, i32 noundef %89, ptr noundef %90, ptr noundef %91)
  br label %93

93:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #3
  store i32 0, ptr %29, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %147, %93
  %95 = load i32, ptr %29, align 4, !tbaa !5
  %96 = load i32, ptr @loopTime, align 4, !tbaa !5
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #3
  br label %150

99:                                               ; preds = %94
  %100 = load ptr, ptr @inputDataPath, align 8, !tbaa !9
  %101 = icmp ne ptr %100, null
  br i1 %101, label %102, label %114

102:                                              ; preds = %99
  %103 = load i32, ptr %11, align 4, !tbaa !5
  %104 = load ptr, ptr %18, align 8, !tbaa !9
  %105 = load ptr, ptr %12, align 8, !tbaa !9
  %106 = load ptr, ptr %13, align 8, !tbaa !9
  %107 = load ptr, ptr %14, align 8, !tbaa !9
  %108 = load ptr, ptr %15, align 8, !tbaa !9
  %109 = load ptr, ptr %16, align 8, !tbaa !9
  %110 = load ptr, ptr %17, align 8, !tbaa !9
  %111 = load ptr, ptr %19, align 8, !tbaa !9
  %112 = load ptr, ptr @inputDataPath, align 8, !tbaa !9
  %113 = call i32 @LoadTensor(i32 noundef %103, ptr noundef %104, ptr noundef %105, ptr noundef %106, ptr noundef %107, ptr noundef %108, ptr noundef %109, ptr noundef %110, ptr noundef %111, ptr noundef %112)
  br label %125

114:                                              ; preds = %99
  %115 = load i32, ptr %11, align 4, !tbaa !5
  %116 = load ptr, ptr %18, align 8, !tbaa !9
  %117 = load ptr, ptr %12, align 8, !tbaa !9
  %118 = load ptr, ptr %13, align 8, !tbaa !9
  %119 = load ptr, ptr %14, align 8, !tbaa !9
  %120 = load ptr, ptr %15, align 8, !tbaa !9
  %121 = load ptr, ptr %16, align 8, !tbaa !9
  %122 = load ptr, ptr %17, align 8, !tbaa !9
  %123 = load ptr, ptr %19, align 8, !tbaa !9
  %124 = call i32 @InitTensor(i32 noundef %115, ptr noundef %116, ptr noundef %117, ptr noundef %118, ptr noundef %119, ptr noundef %120, ptr noundef %121, ptr noundef %122, ptr noundef %123, float noundef 1.000000e+00)
  br label %125

125:                                              ; preds = %114, %102
  %126 = load i32, ptr %11, align 4, !tbaa !5
  %127 = load ptr, ptr %18, align 8, !tbaa !9
  %128 = load ptr, ptr %12, align 8, !tbaa !9
  %129 = load ptr, ptr %13, align 8, !tbaa !9
  %130 = load ptr, ptr %14, align 8, !tbaa !9
  %131 = load ptr, ptr %15, align 8, !tbaa !9
  %132 = load ptr, ptr %16, align 8, !tbaa !9
  %133 = load ptr, ptr %17, align 8, !tbaa !9
  %134 = load ptr, ptr %19, align 8, !tbaa !9
  %135 = call i32 @PrintTensor(i32 noundef %126, ptr noundef %127, ptr noundef %128, ptr noundef %129, ptr noundef %130, ptr noundef %131, ptr noundef %132, ptr noundef %133, ptr noundef %134, ptr noundef @.str.1, i32 noundef 8)
  %136 = load ptr, ptr %8, align 8, !tbaa !9
  call void @RunModel(ptr noundef %136, ptr noundef null, i32 noundef 0, ptr noundef null, ptr noundef null)
  %137 = load i32, ptr %20, align 4, !tbaa !5
  %138 = load ptr, ptr %27, align 8, !tbaa !9
  %139 = load ptr, ptr %21, align 8, !tbaa !9
  %140 = load ptr, ptr %22, align 8, !tbaa !9
  %141 = load ptr, ptr %23, align 8, !tbaa !9
  %142 = load ptr, ptr %24, align 8, !tbaa !9
  %143 = load ptr, ptr %25, align 8, !tbaa !9
  %144 = load ptr, ptr %26, align 8, !tbaa !9
  %145 = load ptr, ptr %28, align 8, !tbaa !9
  %146 = call i32 @PrintTensor(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, ptr noundef @.str.2, i32 noundef 8)
  br label %147

147:                                              ; preds = %125
  %148 = load i32, ptr %29, align 4, !tbaa !5
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %29, align 4, !tbaa !5
  br label %94, !llvm.loop !11

150:                                              ; preds = %98
  %151 = load i32, ptr %11, align 4, !tbaa !5
  %152 = load ptr, ptr %18, align 8, !tbaa !9
  %153 = load ptr, ptr %12, align 8, !tbaa !9
  %154 = load ptr, ptr %13, align 8, !tbaa !9
  %155 = load ptr, ptr %14, align 8, !tbaa !9
  %156 = load ptr, ptr %15, align 8, !tbaa !9
  %157 = load ptr, ptr %16, align 8, !tbaa !9
  %158 = load ptr, ptr %17, align 8, !tbaa !9
  %159 = load ptr, ptr %19, align 8, !tbaa !9
  %160 = call i32 @FreeTensor(i32 noundef %151, ptr noundef %152, ptr noundef %153, ptr noundef %154, ptr noundef %155, ptr noundef %156, ptr noundef %157, ptr noundef %158, ptr noundef %159)
  %161 = load i32, ptr %20, align 4, !tbaa !5
  %162 = load ptr, ptr %27, align 8, !tbaa !9
  %163 = load ptr, ptr %21, align 8, !tbaa !9
  %164 = load ptr, ptr %22, align 8, !tbaa !9
  %165 = load ptr, ptr %23, align 8, !tbaa !9
  %166 = load ptr, ptr %24, align 8, !tbaa !9
  %167 = load ptr, ptr %25, align 8, !tbaa !9
  %168 = load ptr, ptr %26, align 8, !tbaa !9
  %169 = load ptr, ptr %28, align 8, !tbaa !9
  %170 = call i32 @FreeTensor(i32 noundef %161, ptr noundef %162, ptr noundef %163, ptr noundef %164, ptr noundef %165, ptr noundef %166, ptr noundef %167, ptr noundef %168, ptr noundef %169)
  %171 = load ptr, ptr %9, align 8, !tbaa !9
  call void @FreeResultHandle(ptr noundef %171)
  %172 = load ptr, ptr %8, align 8, !tbaa !9
  call void @DestroyModel(ptr noundef %172)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %173

173:                                              ; preds = %150, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  br label %174

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

; 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 @CreateOutputTensorDesc(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 @printf(ptr noundef, ...) #2

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

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 i32 @FreeTensor(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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 }

!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
@.str = external hidden unnamed_addr constant [26 x i8], align 1
@loopTime = external local_unnamed_addr global i32, align 4
@inputDataPath = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = 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 = alloca ptr, align 8
  %23 = tail call i32 @ParseOptions(i32 noundef %0, ptr noundef %1) #4
  %.not = icmp eq i32 %23, 0
  br i1 %.not, label %24, label %140

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

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

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

38:                                               ; preds = %34, %28
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #4
  %39 = load ptr, ptr %3, align 8, !tbaa !9
  %40 = call i32 @CreateInputTensorDesc(ptr noundef %39, 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) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #4
  %41 = load ptr, ptr %4, align 8, !tbaa !9
  %42 = call i32 @CreateOutputTensorDesc(ptr noundef %41, 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) #4
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = load ptr, ptr %12, align 8, !tbaa !9
  %45 = load ptr, ptr %6, align 8, !tbaa !9
  %46 = load ptr, ptr %7, align 8, !tbaa !9
  %47 = load ptr, ptr %8, align 8, !tbaa !9
  %48 = load ptr, ptr %9, align 8, !tbaa !9
  %49 = load ptr, ptr %10, align 8, !tbaa !9
  %50 = load ptr, ptr %11, align 8, !tbaa !9
  %51 = call i32 @MallocTensor(i32 noundef %43, ptr noundef %44, ptr noundef %45, ptr noundef %46, ptr noundef %47, ptr noundef %48, ptr noundef %49, ptr noundef %50, ptr noundef nonnull %13) #4
  %52 = load i32, ptr %14, align 4, !tbaa !5
  %53 = load ptr, ptr %21, align 8, !tbaa !9
  %54 = load ptr, ptr %15, align 8, !tbaa !9
  %55 = load ptr, ptr %16, align 8, !tbaa !9
  %56 = load ptr, ptr %17, align 8, !tbaa !9
  %57 = load ptr, ptr %18, align 8, !tbaa !9
  %58 = load ptr, ptr %19, align 8, !tbaa !9
  %59 = load ptr, ptr %20, align 8, !tbaa !9
  %60 = call i32 @MallocTensor(i32 noundef %52, ptr noundef %53, ptr noundef %54, ptr noundef %55, ptr noundef %56, ptr noundef %57, ptr noundef %58, ptr noundef %59, ptr noundef nonnull %22) #4
  %61 = load i32, ptr @affinity, align 4, !tbaa !5
  %62 = icmp eq i32 %61, 2
  br i1 %62, label %63, label %65

63:                                               ; preds = %38
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %139

65:                                               ; preds = %38
  %66 = load ptr, ptr %3, align 8, !tbaa !9
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = load ptr, ptr %12, align 8, !tbaa !9
  %69 = load ptr, ptr %13, align 8, !tbaa !9
  %70 = call i32 @SetInputOutput(ptr noundef %66, i32 noundef %67, ptr noundef %68, ptr noundef %69) #4
  %71 = load ptr, ptr %3, align 8, !tbaa !9
  %72 = load i32, ptr %14, align 4, !tbaa !5
  %73 = load ptr, ptr %21, align 8, !tbaa !9
  %74 = load ptr, ptr %22, align 8, !tbaa !9
  %75 = call i32 @SetInputOutput(ptr noundef %71, i32 noundef %72, ptr noundef %73, ptr noundef %74) #4
  %76 = load i32, ptr @loopTime, align 4, !tbaa !5
  %77 = icmp sgt i32 %76, 0
  br i1 %77, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %114, %65
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = load ptr, ptr %12, align 8, !tbaa !9
  %80 = load ptr, ptr %6, align 8, !tbaa !9
  %81 = load ptr, ptr %7, align 8, !tbaa !9
  %82 = load ptr, ptr %8, align 8, !tbaa !9
  %83 = load ptr, ptr %9, align 8, !tbaa !9
  %84 = load ptr, ptr %10, align 8, !tbaa !9
  %85 = load ptr, ptr %11, align 8, !tbaa !9
  %86 = load ptr, ptr %13, align 8, !tbaa !9
  %87 = call i32 @FreeTensor(i32 noundef %78, ptr noundef %79, ptr noundef %80, ptr noundef %81, ptr noundef %82, ptr noundef %83, ptr noundef %84, ptr noundef %85, ptr noundef %86) #4
  %88 = load i32, ptr %14, align 4, !tbaa !5
  %89 = load ptr, ptr %21, align 8, !tbaa !9
  %90 = load ptr, ptr %15, align 8, !tbaa !9
  %91 = load ptr, ptr %16, align 8, !tbaa !9
  %92 = load ptr, ptr %17, align 8, !tbaa !9
  %93 = load ptr, ptr %18, align 8, !tbaa !9
  %94 = load ptr, ptr %19, align 8, !tbaa !9
  %95 = load ptr, ptr %20, align 8, !tbaa !9
  %96 = load ptr, ptr %22, align 8, !tbaa !9
  %97 = call i32 @FreeTensor(i32 noundef %88, ptr noundef %89, ptr noundef %90, ptr noundef %91, ptr noundef %92, ptr noundef %93, ptr noundef %94, ptr noundef %95, ptr noundef %96) #4
  %98 = load ptr, ptr %4, align 8, !tbaa !9
  call void @FreeResultHandle(ptr noundef %98) #4
  %99 = load ptr, ptr %3, align 8, !tbaa !9
  call void @DestroyModel(ptr noundef %99) #4
  br label %139

.lr.ph:                                           ; preds = %65, %114
  %.013 = phi i32 [ %136, %114 ], [ 0, %65 ]
  %100 = load ptr, ptr @inputDataPath, align 8, !tbaa !9
  %.not12 = icmp eq ptr %100, null
  %101 = load i32, ptr %5, align 4, !tbaa !5
  %102 = load ptr, ptr %12, align 8, !tbaa !9
  %103 = load ptr, ptr %6, align 8, !tbaa !9
  %104 = load ptr, ptr %7, align 8, !tbaa !9
  %105 = load ptr, ptr %8, align 8, !tbaa !9
  %106 = load ptr, ptr %9, align 8, !tbaa !9
  %107 = load ptr, ptr %10, align 8, !tbaa !9
  %108 = load ptr, ptr %11, align 8, !tbaa !9
  %109 = load ptr, ptr %13, align 8, !tbaa !9
  br i1 %.not12, label %112, label %110

110:                                              ; preds = %.lr.ph
  %111 = call i32 @LoadTensor(i32 noundef %101, ptr noundef %102, ptr noundef %103, ptr noundef %104, ptr noundef %105, ptr noundef %106, ptr noundef %107, ptr noundef %108, ptr noundef %109, ptr noundef nonnull %100) #4
  br label %114

112:                                              ; preds = %.lr.ph
  %113 = call i32 @InitTensor(i32 noundef %101, ptr noundef %102, ptr noundef %103, ptr noundef %104, ptr noundef %105, ptr noundef %106, ptr noundef %107, ptr noundef %108, ptr noundef %109, float noundef 1.000000e+00) #4
  br label %114

114:                                              ; preds = %112, %110
  %115 = load i32, ptr %5, align 4, !tbaa !5
  %116 = load ptr, ptr %12, align 8, !tbaa !9
  %117 = load ptr, ptr %6, align 8, !tbaa !9
  %118 = load ptr, ptr %7, align 8, !tbaa !9
  %119 = load ptr, ptr %8, align 8, !tbaa !9
  %120 = load ptr, ptr %9, align 8, !tbaa !9
  %121 = load ptr, ptr %10, align 8, !tbaa !9
  %122 = load ptr, ptr %11, align 8, !tbaa !9
  %123 = load ptr, ptr %13, align 8, !tbaa !9
  %124 = call i32 @PrintTensor(i32 noundef %115, ptr noundef %116, ptr noundef %117, ptr noundef %118, ptr noundef %119, ptr noundef %120, ptr noundef %121, ptr noundef %122, ptr noundef %123, ptr noundef nonnull @.str.1, i32 noundef 8) #4
  %125 = load ptr, ptr %3, align 8, !tbaa !9
  call void @RunModel(ptr noundef %125, ptr noundef null, i32 noundef 0, ptr noundef null, ptr noundef null) #4
  %126 = load i32, ptr %14, align 4, !tbaa !5
  %127 = load ptr, ptr %21, align 8, !tbaa !9
  %128 = load ptr, ptr %15, align 8, !tbaa !9
  %129 = load ptr, ptr %16, align 8, !tbaa !9
  %130 = load ptr, ptr %17, align 8, !tbaa !9
  %131 = load ptr, ptr %18, align 8, !tbaa !9
  %132 = load ptr, ptr %19, align 8, !tbaa !9
  %133 = load ptr, ptr %20, align 8, !tbaa !9
  %134 = load ptr, ptr %22, align 8, !tbaa !9
  %135 = call i32 @PrintTensor(i32 noundef %126, ptr noundef %127, ptr noundef %128, ptr noundef %129, ptr noundef %130, ptr noundef %131, ptr noundef %132, ptr noundef %133, ptr noundef %134, ptr noundef nonnull @.str.2, i32 noundef 8) #4
  %136 = add nuw nsw i32 %.013, 1
  %137 = load i32, ptr @loopTime, align 4, !tbaa !5
  %138 = icmp slt i32 %136, %137
  br i1 %138, label %.lr.ph, label %._crit_edge, !llvm.loop !11

139:                                              ; preds = %._crit_edge, %63
  %.07 = phi i32 [ 1, %63 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  br label %140

140:                                              ; preds = %2, %139
  %.1 = phi i32 [ %.07, %139 ], [ %23, %2 ]
  ret i32 %.1
}

; 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 @CreateOutputTensorDesc(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

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

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

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 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 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 = { 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 = { 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/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