; LLVM IR from intel/qpl :: sources/middle-layer/dispatcher (hw_queue)

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

%struct.accfg_op_config = type { [8 x i32] }
%"class.qpl::ml::dispatcher::hw_queue" = type { ptr, i8, i32, i64, ptr, %"struct.std::atomic", i8, %"struct.std::array", i8, i32, i64 }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i64 }
%"struct.std::array" = type { [8 x i32] }

declare i32 @close(i32 noundef) #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3qpl2ml10dispatcher8hw_queue14set_portal_ptrEPv(ptr noundef nonnull align 8 dereferenceable(96), ptr noundef) #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3qpl2ml10dispatcher8hw_queue12execute_noopEv(ptr noundef nonnull align 8 dereferenceable(96)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN3qpl2ml10dispatcher8hw_queue20initialize_new_queueEPv(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [64 x i8], align 16
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca %struct.accfg_op_config, align 4
  %13 = alloca i32, align 4
  %14 = alloca i8, align 1
  %15 = alloca i8, align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %16 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %17, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %7) #5
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = invoke i32 @accfg_wq_get_state(ptr noundef %18)
          to label %20 unwind label %126

20:                                               ; preds = %2
  %21 = icmp ne i32 1, %19
  br i1 %21, label %22, label %23

22:                                               ; preds = %20
  store i32 4, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %124

23:                                               ; preds = %20
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = invoke i32 @accfg_wq_get_mode(ptr noundef %24)
          to label %26 unwind label %126

26:                                               ; preds = %23
  %27 = icmp ne i32 0, %25
  br i1 %27, label %28, label %29

28:                                               ; preds = %26
  store i32 4, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %124

29:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %32 = invoke i32 @accfg_wq_get_user_dev_path(ptr noundef %30, ptr noundef %31, i64 noundef 63)
          to label %33 unwind label %126

33:                                               ; preds = %29
  store i32 %32, ptr %9, align 4, !tbaa !9
  %34 = load i32, ptr %9, align 4, !tbaa !9
  %35 = icmp sgt i32 0, %34
  br i1 %35, label %36, label %37

36:                                               ; preds = %33
  store i32 3, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %123

37:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %38 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %39 = invoke i32 (ptr, i32, ...) @open(ptr noundef %38, i32 noundef 2)
          to label %40 unwind label %126

40:                                               ; preds = %37
  store i32 %39, ptr %10, align 4, !tbaa !9
  %41 = load i32, ptr %10, align 4, !tbaa !9
  %42 = icmp sgt i32 0, %41
  br i1 %42, label %43, label %44

43:                                               ; preds = %40
  store i32 3, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %122

44:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %45 = load i32, ptr %10, align 4, !tbaa !9
  %46 = call ptr @mmap(ptr noundef null, i64 noundef 4096, i32 noundef 2, i32 noundef 32769, i32 noundef %45, i64 noundef 0) #5
  store ptr %46, ptr %11, align 8, !tbaa !5
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  %48 = icmp eq ptr inttoptr (i64 -1 to ptr), %47
  br i1 %48, label %49, label %61

49:                                               ; preds = %44
  %50 = getelementptr inbounds %"class.qpl::ml::dispatcher::hw_queue", ptr %16, i32 0, i32 8
  store i8 0, ptr %50, align 4, !tbaa !11
  %51 = load i32, ptr %10, align 4, !tbaa !9
  %52 = getelementptr inbounds %"class.qpl::ml::dispatcher::hw_queue", ptr %16, i32 0, i32 9
  store i32 %51, ptr %52, align 8, !tbaa !18
  %53 = call noundef i32 @_ZNK3qpl2ml10dispatcher8hw_queue12execute_noopEv(ptr noundef nonnull align 8 dereferenceable(96) %16) #5
  %54 = icmp ne i32 0, %53
  br i1 %54, label %55, label %60

55:                                               ; preds = %49
  %56 = getelementptr inbounds %"class.qpl::ml::dispatcher::hw_queue", ptr %16, i32 0, i32 9
  store i32 -1, ptr %56, align 8, !tbaa !18
  %57 = load i32, ptr %10, align 4, !tbaa !9
  %58 = invoke i32 @close(i32 noundef %57)
          to label %59 unwind label %126

59:                                               ; preds = %55
  store i32 1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %121

60:                                               ; preds = %49
  br label %66

61:                                               ; preds = %44
  %62 = getelementptr inbounds %"class.qpl::ml::dispatcher::hw_queue", ptr %16, i32 0, i32 8
  store i8 1, ptr %62, align 4, !tbaa !11
  %63 = load i32, ptr %10, align 4, !tbaa !9
  %64 = invoke i32 @close(i32 noundef %63)
          to label %65 unwind label %126

65:                                               ; preds = %61
  br label %66

66:                                               ; preds = %65, %60
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = invoke i32 @accfg_wq_get_priority(ptr noundef %67)
          to label %69 unwind label %126

69:                                               ; preds = %66
  %70 = getelementptr inbounds %"class.qpl::ml::dispatcher::hw_queue", ptr %16, i32 0, i32 2
  store i32 %68, ptr %70, align 4, !tbaa !19
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = invoke i32 @accfg_wq_get_block_on_fault(ptr noundef %71)
          to label %73 unwind label %126

73:                                               ; preds = %69
  %74 = icmp ne i32 %72, 0
  %75 = getelementptr inbounds %"class.qpl::ml::dispatcher::hw_queue", ptr %16, i32 0, i32 1
  %76 = zext i1 %74 to i8
  store i8 %76, ptr %75, align 8, !tbaa !20
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = invoke i64 @accfg_wq_get_max_transfer_size(ptr noundef %77)
          to label %79 unwind label %126

79:                                               ; preds = %73
  %80 = getelementptr inbounds %"class.qpl::ml::dispatcher::hw_queue", ptr %16, i32 0, i32 10
  store i64 %78, ptr %80, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = invoke i32 @accfg_wq_get_op_config(ptr noundef %81, ptr noundef %12)
          to label %83 unwind label %126

83:                                               ; preds = %79
  store i32 %82, ptr %13, align 4, !tbaa !9
  %84 = load i32, ptr %13, align 4, !tbaa !9
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %88

86:                                               ; preds = %83
  %87 = getelementptr inbounds %"class.qpl::ml::dispatcher::hw_queue", ptr %16, i32 0, i32 6
  store i8 0, ptr %87, align 8, !tbaa !22
  br label %119

88:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #5
  store i8 0, ptr %14, align 1, !tbaa !23
  br label %89

89:                                               ; preds = %104, %88
  %90 = load i8, ptr %14, align 1, !tbaa !23
  %91 = zext i8 %90 to i32
  %92 = icmp ult i32 %91, 8
  br i1 %92, label %94, label %93

93:                                               ; preds = %89
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #5
  br label %107

94:                                               ; preds = %89
  %95 = getelementptr inbounds %struct.accfg_op_config, ptr %12, i32 0, i32 0
  %96 = load i8, ptr %14, align 1, !tbaa !23
  %97 = zext i8 %96 to i64
  %98 = getelementptr inbounds [8 x i32], ptr %95, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !9
  %100 = getelementptr inbounds %"class.qpl::ml::dispatcher::hw_queue", ptr %16, i32 0, i32 7
  %101 = load i8, ptr %14, align 1, !tbaa !23
  %102 = zext i8 %101 to i64
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm8EEixEm(ptr noundef nonnull align 4 dereferenceable(32) %100, i64 noundef %102) #5
  store i32 %99, ptr %103, align 4, !tbaa !9
  br label %104

104:                                              ; preds = %94
  %105 = load i8, ptr %14, align 1, !tbaa !23
  %106 = add i8 %105, 1
  store i8 %106, ptr %14, align 1, !tbaa !23
  br label %89, !llvm.loop !24

107:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #5
  store i8 0, ptr %15, align 1, !tbaa !23
  br label %108

108:                                              ; preds = %114, %107
  %109 = load i8, ptr %15, align 1, !tbaa !23
  %110 = zext i8 %109 to i32
  %111 = icmp ult i32 %110, 8
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #5
  br label %117

113:                                              ; preds = %108
  br label %114

114:                                              ; preds = %113
  %115 = load i8, ptr %15, align 1, !tbaa !23
  %116 = add i8 %115, 1
  store i8 %116, ptr %15, align 1, !tbaa !23
  br label %108, !llvm.loop !26

117:                                              ; preds = %112
  %118 = getelementptr inbounds %"class.qpl::ml::dispatcher::hw_queue", ptr %16, i32 0, i32 6
  store i8 1, ptr %118, align 8, !tbaa !22
  br label %119

119:                                              ; preds = %117, %86
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN3qpl2ml10dispatcher8hw_queue14set_portal_ptrEPv(ptr noundef nonnull align 8 dereferenceable(96) %16, ptr noundef %120) #5
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #5
  br label %121

121:                                              ; preds = %119, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %122

122:                                              ; preds = %121, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %123

123:                                              ; preds = %122, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %124

124:                                              ; preds = %123, %28, %22
  call void @llvm.lifetime.end.p0(i64 64, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %125 = load i32, ptr %3, align 4
  ret i32 %125

126:                                              ; preds = %79, %73, %69, %66, %61, %55, %37, %29, %23, %2
  %127 = landingpad { ptr, i32 }
          catch ptr null
  %128 = extractvalue { ptr, i32 } %127, 0
  call void @__clang_call_terminate(ptr %128) #6
  unreachable
}

declare i32 @accfg_wq_get_state(ptr noundef) #0

declare i32 @accfg_wq_get_mode(ptr noundef) #0

declare i32 @accfg_wq_get_user_dev_path(ptr noundef, ptr noundef, i64 noundef) #0

declare i32 @open(ptr noundef, i32 noundef, ...) #0

; Function Attrs: nounwind
declare ptr @mmap(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef) #4

declare i32 @accfg_wq_get_priority(ptr noundef) #0

declare i32 @accfg_wq_get_block_on_fault(ptr noundef) #0

declare i64 @accfg_wq_get_max_transfer_size(ptr noundef) #0

declare i32 @accfg_wq_get_op_config(ptr noundef, ptr noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm8EEixEm(ptr noundef nonnull align 4 dereferenceable(32), i64 noundef) #2 align 2

attributes #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 = { noinline noreturn nounwind uwtable "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 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 76}
!12 = !{!"_ZTSN3qpl2ml10dispatcher8hw_queueE", !13, i64 8, !10, i64 12, !14, i64 16, !6, i64 24, !15, i64 32, !13, i64 40, !17, i64 44, !13, i64 76, !10, i64 80, !14, i64 88}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_ZTSSt6atomicImE", !16, i64 0}
!16 = !{!"_ZTSSt13__atomic_baseImE", !14, i64 0}
!17 = !{!"_ZTSSt5arrayIjLm8EE", !7, i64 0}
!18 = !{!12, !10, i64 80}
!19 = !{!12, !10, i64 12}
!20 = !{!12, !13, i64 8}
!21 = !{!12, !14, i64 88}
!22 = !{!12, !13, i64 40}
!23 = !{!7, !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}


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

%struct.accfg_op_config = type { [8 x i32] }

declare i32 @close(i32 noundef) local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3qpl2ml10dispatcher8hw_queue14set_portal_ptrEPv(ptr noundef nonnull align 8 dereferenceable(96), ptr noundef) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3qpl2ml10dispatcher8hw_queue12execute_noopEv(ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef range(i32 0, 5) i32 @_ZN3qpl2ml10dispatcher8hw_queue20initialize_new_queueEPv(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca [64 x i8], align 16
  %4 = alloca %struct.accfg_op_config, align 4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #6
  %5 = invoke i32 @accfg_wq_get_state(ptr noundef %1)
          to label %6 unwind label %70

6:                                                ; preds = %2
  %.not = icmp eq i32 %5, 1
  br i1 %.not, label %7, label %69

7:                                                ; preds = %6
  %8 = invoke i32 @accfg_wq_get_mode(ptr noundef %1)
          to label %9 unwind label %70

9:                                                ; preds = %7
  %.not27 = icmp eq i32 %8, 0
  br i1 %.not27, label %10, label %69

10:                                               ; preds = %9
  %11 = invoke i32 @accfg_wq_get_user_dev_path(ptr noundef %1, ptr noundef nonnull %3, i64 noundef 63)
          to label %12 unwind label %70

12:                                               ; preds = %10
  %13 = icmp slt i32 %11, 0
  br i1 %13, label %69, label %14

14:                                               ; preds = %12
  %15 = invoke i32 (ptr, i32, ...) @open(ptr noundef nonnull %3, i32 noundef 2)
          to label %16 unwind label %70

16:                                               ; preds = %14
  %17 = icmp slt i32 %15, 0
  br i1 %17, label %69, label %18

18:                                               ; preds = %16
  %19 = call ptr @mmap(ptr noundef null, i64 noundef 4096, i32 noundef 2, i32 noundef 32769, i32 noundef %15, i64 noundef 0) #6
  %20 = icmp eq ptr %19, inttoptr (i64 -1 to ptr)
  %21 = getelementptr inbounds i8, ptr %0, i64 76
  br i1 %20, label %22, label %27

22:                                               ; preds = %18
  store i8 0, ptr %21, align 4, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %0, i64 80
  store i32 %15, ptr %23, align 8, !tbaa !16
  %24 = call noundef i32 @_ZNK3qpl2ml10dispatcher8hw_queue12execute_noopEv(ptr noundef nonnull align 8 dereferenceable(96) %0) #6
  %.not28 = icmp eq i32 %24, 0
  br i1 %.not28, label %29, label %25

25:                                               ; preds = %22
  store i32 -1, ptr %23, align 8, !tbaa !16
  %26 = invoke i32 @close(i32 noundef %15)
          to label %69 unwind label %70

27:                                               ; preds = %18
  store i8 1, ptr %21, align 4, !tbaa !5
  %28 = invoke i32 @close(i32 noundef %15)
          to label %29 unwind label %70

29:                                               ; preds = %27, %22
  %30 = invoke i32 @accfg_wq_get_priority(ptr noundef %1)
          to label %31 unwind label %70

31:                                               ; preds = %29
  %32 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 %30, ptr %32, align 4, !tbaa !17
  %33 = invoke i32 @accfg_wq_get_block_on_fault(ptr noundef %1)
          to label %34 unwind label %70

34:                                               ; preds = %31
  %35 = icmp ne i32 %33, 0
  %36 = getelementptr inbounds i8, ptr %0, i64 8
  %37 = zext i1 %35 to i8
  store i8 %37, ptr %36, align 8, !tbaa !18
  %38 = invoke i64 @accfg_wq_get_max_transfer_size(ptr noundef %1)
          to label %39 unwind label %70

39:                                               ; preds = %34
  %40 = getelementptr inbounds i8, ptr %0, i64 88
  store i64 %38, ptr %40, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #6
  %41 = invoke i32 @accfg_wq_get_op_config(ptr noundef %1, ptr noundef nonnull %4)
          to label %42 unwind label %70

42:                                               ; preds = %39
  %.not29 = icmp eq i32 %41, 0
  br i1 %.not29, label %.preheader30, label %67

.preheader30:                                     ; preds = %42
  %43 = getelementptr inbounds i8, ptr %0, i64 44
  %44 = load i32, ptr %4, align 4, !tbaa !20
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm8EEixEm(ptr noundef nonnull align 4 dereferenceable(32) %43, i64 noundef 0) #6
  store i32 %44, ptr %45, align 4, !tbaa !20
  %46 = getelementptr inbounds i8, ptr %4, i64 4
  %47 = load i32, ptr %46, align 4, !tbaa !20
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm8EEixEm(ptr noundef nonnull align 4 dereferenceable(32) %43, i64 noundef 1) #6
  store i32 %47, ptr %48, align 4, !tbaa !20
  %49 = getelementptr inbounds i8, ptr %4, i64 8
  %50 = load i32, ptr %49, align 4, !tbaa !20
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm8EEixEm(ptr noundef nonnull align 4 dereferenceable(32) %43, i64 noundef 2) #6
  store i32 %50, ptr %51, align 4, !tbaa !20
  %52 = getelementptr inbounds i8, ptr %4, i64 12
  %53 = load i32, ptr %52, align 4, !tbaa !20
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm8EEixEm(ptr noundef nonnull align 4 dereferenceable(32) %43, i64 noundef 3) #6
  store i32 %53, ptr %54, align 4, !tbaa !20
  %55 = getelementptr inbounds i8, ptr %4, i64 16
  %56 = load i32, ptr %55, align 4, !tbaa !20
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm8EEixEm(ptr noundef nonnull align 4 dereferenceable(32) %43, i64 noundef 4) #6
  store i32 %56, ptr %57, align 4, !tbaa !20
  %58 = getelementptr inbounds i8, ptr %4, i64 20
  %59 = load i32, ptr %58, align 4, !tbaa !20
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm8EEixEm(ptr noundef nonnull align 4 dereferenceable(32) %43, i64 noundef 5) #6
  store i32 %59, ptr %60, align 4, !tbaa !20
  %61 = getelementptr inbounds i8, ptr %4, i64 24
  %62 = load i32, ptr %61, align 4, !tbaa !20
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm8EEixEm(ptr noundef nonnull align 4 dereferenceable(32) %43, i64 noundef 6) #6
  store i32 %62, ptr %63, align 4, !tbaa !20
  %64 = getelementptr inbounds i8, ptr %4, i64 28
  %65 = load i32, ptr %64, align 4, !tbaa !20
  %66 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm8EEixEm(ptr noundef nonnull align 4 dereferenceable(32) %43, i64 noundef 7) #6
  store i32 %65, ptr %66, align 4, !tbaa !20
  br label %67

67:                                               ; preds = %42, %.preheader30
  %.sink = phi i8 [ 1, %.preheader30 ], [ 0, %42 ]
  %68 = getelementptr inbounds i8, ptr %0, i64 40
  store i8 %.sink, ptr %68, align 8, !tbaa !21
  call void @_ZN3qpl2ml10dispatcher8hw_queue14set_portal_ptrEPv(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef %19) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  br label %69

69:                                               ; preds = %12, %67, %25, %16, %9, %6
  %.3 = phi i32 [ 4, %6 ], [ 4, %9 ], [ 3, %12 ], [ 3, %16 ], [ 0, %67 ], [ 1, %25 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #6
  ret i32 %.3

70:                                               ; preds = %39, %34, %31, %29, %27, %25, %14, %10, %7, %2
  %71 = landingpad { ptr, i32 }
          catch ptr null
  %72 = extractvalue { ptr, i32 } %71, 0
  call void @__clang_call_terminate(ptr %72) #7
  unreachable
}

declare i32 @accfg_wq_get_state(ptr noundef) local_unnamed_addr #0

declare i32 @accfg_wq_get_mode(ptr noundef) local_unnamed_addr #0

declare i32 @accfg_wq_get_user_dev_path(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nofree
declare noundef i32 @open(ptr nocapture noundef readonly, i32 noundef, ...) local_unnamed_addr #4

; Function Attrs: nounwind
declare ptr @mmap(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef) local_unnamed_addr #5

declare i32 @accfg_wq_get_priority(ptr noundef) local_unnamed_addr #0

declare i32 @accfg_wq_get_block_on_fault(ptr noundef) local_unnamed_addr #0

declare i64 @accfg_wq_get_max_transfer_size(ptr noundef) local_unnamed_addr #0

declare i32 @accfg_wq_get_op_config(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm8EEixEm(ptr noundef nonnull align 4 dereferenceable(32), i64 noundef) local_unnamed_addr #2 align 2

attributes #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 = { noinline noreturn nounwind uwtable "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 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree "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 "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 = { nounwind }
attributes #7 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 76}
!6 = !{!"_ZTSN3qpl2ml10dispatcher8hw_queueE", !7, i64 8, !10, i64 12, !11, i64 16, !12, i64 24, !13, i64 32, !7, i64 40, !15, i64 44, !7, i64 76, !10, i64 80, !11, i64 88}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"_ZTSSt6atomicImE", !14, i64 0}
!14 = !{!"_ZTSSt13__atomic_baseImE", !11, i64 0}
!15 = !{!"_ZTSSt5arrayIjLm8EE", !8, i64 0}
!16 = !{!6, !10, i64 80}
!17 = !{!6, !10, i64 12}
!18 = !{!6, !7, i64 8}
!19 = !{!6, !11, i64 88}
!20 = !{!10, !10, i64 0}
!21 = !{!6, !7, i64 40}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,SROAPass,SimplifyCFGPass