; LLVM IR from huawei-noah/bolt :: inference/engine/src/bolt_c.ll (Z15CreateInferencePKc13AFFINITY_TYPES0_b)

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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.0" = type { i8 }
%struct.ModelSpec = type { i32, i32, [128 x i8], i32, i32, ptr, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, ptr }
%struct.ModelHandleInner = type { ptr, ptr, i32, ptr, i8 }

@__FUNCTION__._Z15CreateInferencePKc13AFFINITY_TYPES0_b = external hidden unnamed_addr constant [16 x i8], align 1
@.str = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_Z15CreateInferencePKc13AFFINITY_TYPES0_b(ptr noundef %0, i32 noundef %1, ptr noundef %2, i1 noundef zeroext %3) #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca %"class.std::allocator.0", align 1
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i1, align 1
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  %19 = zext i1 %3 to i8
  store i8 %19, ptr %8, align 1, !tbaa !11
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_Z18assert_not_nullptrPKcS0_PKv(ptr noundef @__FUNCTION__._Z15CreateInferencePKc13AFFINITY_TYPES0_b, ptr noundef @.str, ptr noundef %20)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  store ptr null, ptr %9, align 8, !tbaa !5
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %89

23:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %24 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 232) #10
  call void @llvm.memset.p0.i64(ptr align 16 %24, i8 0, i64 232, i1 false)
  call void @_ZN9ModelSpecC2Ev(ptr noundef nonnull align 8 dereferenceable(232) %24) #9
  store ptr %24, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  %25 = load i32, ptr %6, align 4, !tbaa !9
  %26 = call noundef i32 @_Z28AFFINITY_TYPE2AffinityPolicy13AFFINITY_TYPE(i32 noundef %25)
  store i32 %26, ptr %11, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  %27 = load i32, ptr %11, align 4, !tbaa !13
  %28 = call noundef i32 @_Z23getTargetDtFromAffinity14AffinityPolicy(i32 noundef %27)
  store i32 %28, ptr %12, align 4, !tbaa !15
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  %31 = load i32, ptr %12, align 4, !tbaa !15
  %32 = load i8, ptr %8, align 1, !tbaa !11, !range !17, !noundef !18
  %33 = trunc i8 %32 to i1
  %34 = call noundef i32 @_Z27deserialize_model_from_filePKcP9ModelSpec8DataTypeb(ptr noundef %29, ptr noundef %30, i32 noundef %31, i1 noundef zeroext %33)
  %35 = icmp ne i32 0, %34
  br i1 %35, label %36, label %41

36:                                               ; preds = %23
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  %38 = icmp eq ptr %37, null
  br i1 %38, label %40, label %39

39:                                               ; preds = %36
  call void @_ZdlPvm(ptr noundef %37, i64 noundef 232) #11
  br label %40

40:                                               ; preds = %39, %36
  br label %88

41:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  %42 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 5272) #10
  store i1 true, ptr %18, align 1
  %43 = load i32, ptr %11, align 4, !tbaa !13
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.ModelSpec, ptr %44, i32 0, i32 3
  %46 = load i32, ptr %45, align 8, !tbaa !19
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.ModelSpec, ptr %47, i32 0, i32 2
  %49 = getelementptr inbounds [128 x i8], ptr %48, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef %49, ptr noundef nonnull align 1 dereferenceable(1) %15)
          to label %50 unwind label %76

50:                                               ; preds = %41
  invoke void @_ZN3CNNC2E14AffinityPolicy8DataTypeNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(5265) %42, i32 noundef %43, i32 noundef %46, ptr noundef %14)
          to label %51 unwind label %80

51:                                               ; preds = %50
  store i1 false, ptr %18, align 1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #9
  store ptr %42, ptr %13, align 8, !tbaa !5
  %52 = load ptr, ptr %13, align 8, !tbaa !5
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN3CNN25sort_operators_sequentialEPK9ModelSpec(ptr noundef nonnull align 8 dereferenceable(5265) %52, ptr noundef %53)
  %54 = load ptr, ptr %13, align 8, !tbaa !5
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN3CNN14initialize_opsEPK9ModelSpec(ptr noundef nonnull align 8 dereferenceable(5265) %54, ptr noundef %55)
  %56 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 40) #10
  call void @llvm.memset.p0.i64(ptr align 16 %56, i8 0, i64 40, i1 false)
  store ptr %56, ptr %9, align 8, !tbaa !5
  %57 = load ptr, ptr %13, align 8, !tbaa !5
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.ModelHandleInner, ptr %58, i32 0, i32 1
  store ptr %57, ptr %59, align 8, !tbaa !22
  %60 = load ptr, ptr %10, align 8, !tbaa !5
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.ModelHandleInner, ptr %61, i32 0, i32 0
  store ptr %60, ptr %62, align 8, !tbaa !25
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  %64 = call noundef i32 @_ZN5Model18get_runtime_deviceEv(ptr noundef nonnull align 8 dereferenceable(4720) %63)
  %65 = call noundef i32 @_Z18Arch2HARDWARE_TYPE4Arch(i32 noundef %64)
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.ModelHandleInner, ptr %66, i32 0, i32 2
  store i32 %65, ptr %67, align 8, !tbaa !26
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.ModelHandleInner, ptr %69, i32 0, i32 3
  store ptr %68, ptr %70, align 8, !tbaa !27
  %71 = load i8, ptr %8, align 1, !tbaa !11, !range !17, !noundef !18
  %72 = trunc i8 %71 to i1
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.ModelHandleInner, ptr %73, i32 0, i32 4
  %75 = zext i1 %72 to i8
  store i8 %75, ptr %74, align 8, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  br label %88

76:                                               ; preds = %41
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %16, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %17, align 4
  br label %84

80:                                               ; preds = %50
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %16, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %17, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #9
  br label %84

84:                                               ; preds = %80, %76
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #9
  %85 = load i1, ptr %18, align 1
  br i1 %85, label %86, label %87

86:                                               ; preds = %84
  call void @_ZdlPvm(ptr noundef %42, i64 noundef 5272) #11
  br label %87

87:                                               ; preds = %86, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  br label %92

88:                                               ; preds = %51, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  br label %89

89:                                               ; preds = %88, %4
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_Z18print_model_handleP16ModelHandleInner(ptr noundef %90)
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  ret ptr %91

92:                                               ; preds = %87
  %93 = load ptr, ptr %16, align 8
  %94 = load i32, ptr %17, align 4
  %95 = insertvalue { ptr, i32 } poison, ptr %93, 0
  %96 = insertvalue { ptr, i32 } %95, i32 %94, 1
  resume { ptr, i32 } %96
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z18assert_not_nullptrPKcS0_PKv(ptr noundef, ptr noundef, ptr noundef) #1

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

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

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

declare noundef i32 @_Z27deserialize_model_from_filePKcP9ModelSpec8DataTypeb(ptr noundef, ptr noundef, i32 noundef, i1 noundef zeroext) #6

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #7

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3CNNC2E14AffinityPolicy8DataTypeNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(5265), i32 noundef, i32 noundef, ptr noundef) unnamed_addr #0 align 2

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

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

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

declare void @_ZN3CNN25sort_operators_sequentialEPK9ModelSpec(ptr noundef nonnull align 8 dereferenceable(5265), ptr noundef) #6

declare void @_ZN3CNN14initialize_opsEPK9ModelSpec(ptr noundef nonnull align 8 dereferenceable(5265), ptr noundef) #6

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

declare noundef i32 @_ZN5Model18get_runtime_deviceEv(ptr noundef nonnull align 8 dereferenceable(4720)) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z18print_model_handleP16ModelHandleInner(ptr noundef) #1

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nobuiltin 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { "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 = { nobuiltin 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 #8 = { 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 #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin 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 = !{!"_ZTS13AFFINITY_TYPE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_ZTS14AffinityPolicy", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"_ZTS8DataType", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!20, !16, i64 136}
!20 = !{!"_ZTS9ModelSpec", !21, i64 0, !21, i64 4, !7, i64 8, !16, i64 136, !21, i64 140, !6, i64 144, !6, i64 152, !21, i64 160, !6, i64 168, !21, i64 176, !6, i64 184, !21, i64 192, !6, i64 200, !21, i64 208, !6, i64 216, !6, i64 224}
!21 = !{!"int", !7, i64 0}
!22 = !{!23, !6, i64 8}
!23 = !{!"_ZTS16ModelHandleInner", !6, i64 0, !6, i64 8, !24, i64 16, !6, i64 24, !12, i64 32}
!24 = !{!"_ZTS13HARDWARE_TYPE", !7, i64 0}
!25 = !{!23, !6, i64 0}
!26 = !{!23, !24, i64 16}
!27 = !{!23, !6, i64 24}
!28 = !{!23, !12, i64 32}


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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.0" = type { i8 }

@__FUNCTION__._Z15CreateInferencePKc13AFFINITY_TYPES0_b = external hidden unnamed_addr constant [16 x i8], align 1
@.str = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_Z15CreateInferencePKc13AFFINITY_TYPES0_b(ptr noundef %0, i32 noundef %1, ptr noundef %2, i1 noundef zeroext %3) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::allocator.0", align 1
  %7 = zext i1 %3 to i8
  tail call void @_Z18assert_not_nullptrPKcS0_PKv(ptr noundef nonnull @__FUNCTION__._Z15CreateInferencePKc13AFFINITY_TYPES0_b, ptr noundef nonnull @.str, ptr noundef %0)
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %34, label %8

8:                                                ; preds = %4
  %9 = tail call noalias noundef nonnull dereferenceable(232) ptr @_Znwm(i64 noundef 232) #9
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(232) %9, i8 0, i64 232, i1 false)
  tail call void @_ZN9ModelSpecC2Ev(ptr noundef nonnull align 8 dereferenceable(232) %9) #10
  %10 = tail call noundef i32 @_Z28AFFINITY_TYPE2AffinityPolicy13AFFINITY_TYPE(i32 noundef %1)
  %11 = tail call noundef i32 @_Z23getTargetDtFromAffinity14AffinityPolicy(i32 noundef %10)
  %12 = tail call noundef i32 @_Z27deserialize_model_from_filePKcP9ModelSpec8DataTypeb(ptr noundef nonnull %0, ptr noundef nonnull %9, i32 noundef %11, i1 noundef zeroext %3)
  %.not33 = icmp eq i32 %12, 0
  br i1 %.not33, label %14, label %13

13:                                               ; preds = %8
  tail call void @_ZdlPvm(ptr noundef nonnull %9, i64 noundef 232) #11
  br label %34

14:                                               ; preds = %8
  %15 = tail call noalias noundef nonnull dereferenceable(5272) ptr @_Znwm(i64 noundef 5272) #9
  %16 = getelementptr inbounds i8, ptr %9, i64 136
  %17 = load i32, ptr %16, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %9, i64 8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #10
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #10
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull %18, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %19 unwind label %29

19:                                               ; preds = %14
  invoke void @_ZN3CNNC2E14AffinityPolicy8DataTypeNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(5265) %15, i32 noundef %10, i32 noundef %17, ptr noundef nonnull %5)
          to label %20 unwind label %31

20:                                               ; preds = %19
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #10
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #10
  call void @_ZN3CNN25sort_operators_sequentialEPK9ModelSpec(ptr noundef nonnull align 8 dereferenceable(5265) %15, ptr noundef nonnull %9)
  call void @_ZN3CNN14initialize_opsEPK9ModelSpec(ptr noundef nonnull align 8 dereferenceable(5265) %15, ptr noundef nonnull %9)
  %21 = call noalias noundef nonnull dereferenceable(40) ptr @_Znwm(i64 noundef 40) #9
  %22 = getelementptr inbounds i8, ptr %21, i64 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %22, i8 0, i64 24, i1 false)
  %23 = getelementptr inbounds i8, ptr %21, i64 8
  store ptr %15, ptr %23, align 8, !tbaa !12
  store ptr %9, ptr %21, align 8, !tbaa !16
  %24 = call noundef i32 @_ZN5Model18get_runtime_deviceEv(ptr noundef nonnull align 8 dereferenceable(4720) %15)
  %25 = call noundef i32 @_Z18Arch2HARDWARE_TYPE4Arch(i32 noundef %24)
  %26 = getelementptr inbounds i8, ptr %21, i64 16
  store i32 %25, ptr %26, align 8, !tbaa !17
  %27 = getelementptr inbounds i8, ptr %21, i64 24
  store ptr %2, ptr %27, align 8, !tbaa !18
  %28 = getelementptr inbounds i8, ptr %21, i64 32
  store i8 %7, ptr %28, align 8, !tbaa !19
  br label %34

29:                                               ; preds = %14
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %33

31:                                               ; preds = %19
  %32 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #10
  br label %33

33:                                               ; preds = %31, %29
  %.pn = phi { ptr, i32 } [ %32, %31 ], [ %30, %29 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #10
  call void @_ZdlPvm(ptr noundef nonnull %15, i64 noundef 5272) #11
  resume { ptr, i32 } %.pn

34:                                               ; preds = %20, %13, %4
  %.1 = phi ptr [ null, %4 ], [ null, %13 ], [ %21, %20 ]
  call void @_Z18print_model_handleP16ModelHandleInner(ptr noundef %.1)
  ret ptr %.1
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z18assert_not_nullptrPKcS0_PKv(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

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

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

declare noundef i32 @_Z27deserialize_model_from_filePKcP9ModelSpec8DataTypeb(ptr noundef, ptr noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #6

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #7

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3CNNC2E14AffinityPolicy8DataTypeNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(5265), i32 noundef, i32 noundef, ptr noundef) unnamed_addr #0 align 2

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

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

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

declare void @_ZN3CNN25sort_operators_sequentialEPK9ModelSpec(ptr noundef nonnull align 8 dereferenceable(5265), ptr noundef) local_unnamed_addr #6

declare void @_ZN3CNN14initialize_opsEPK9ModelSpec(ptr noundef nonnull align 8 dereferenceable(5265), ptr noundef) local_unnamed_addr #6

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

declare noundef i32 @_ZN5Model18get_runtime_deviceEv(ptr noundef nonnull align 8 dereferenceable(4720)) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z18print_model_handleP16ModelHandleInner(ptr noundef) local_unnamed_addr #1

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nobuiltin 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { "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 = { nobuiltin 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 #8 = { 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 #9 = { builtin allocsize(0) }
attributes #10 = { nounwind }
attributes #11 = { builtin 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, !10, i64 136}
!6 = !{!"_ZTS9ModelSpec", !7, i64 0, !7, i64 4, !8, i64 8, !10, i64 136, !7, i64 140, !11, i64 144, !11, i64 152, !7, i64 160, !11, i64 168, !7, i64 176, !11, i64 184, !7, i64 192, !11, i64 200, !7, i64 208, !11, i64 216, !11, i64 224}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS8DataType", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!13, !11, i64 8}
!13 = !{!"_ZTS16ModelHandleInner", !11, i64 0, !11, i64 8, !14, i64 16, !11, i64 24, !15, i64 32}
!14 = !{!"_ZTS13HARDWARE_TYPE", !8, i64 0}
!15 = !{!"bool", !8, i64 0}
!16 = !{!13, !11, i64 0}
!17 = !{!13, !14, i64 16}
!18 = !{!13, !11, i64 24}
!19 = !{!13, !15, i64 32}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass