; LLVM IR from intel/QAT_Engine :: test (tests)

; 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.epoll_event = type <{ i32, %union.epoll_data }>
%union.epoll_data = type { ptr }
%struct.ENG_POLL_EVENT = type { i32, ptr }

@sw_algo_bitmap = external dso_local global ptr, align 8
@hw_algo_bitmap = external dso_local global ptr, align 8
@efd = external hidden global i32, align 4
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [25 x i8], align 1
@no_of_inst = external hidden global i32, align 4
@.str.7 = external hidden unnamed_addr constant [24 x i8], align 1
@event = external dso_local global [64 x %struct.epoll_event], align 16
@qat_keep_polling = external hidden global i32, align 4
@.str.8 = external hidden unnamed_addr constant [63 x i8], align 1
@testapp_polling_threads = external dso_local global ptr, align 8
@testapp_heartbeat_threads = external dso_local global ptr, align 8

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @eng_poll_handler(ptr noundef, ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local ptr @tests_initialise_engine(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) #2 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %1, ptr %9, align 4, !tbaa !9
  store i32 %2, ptr %10, align 4, !tbaa !9
  store i32 %3, ptr %11, align 4, !tbaa !9
  store i32 %4, ptr %12, align 4, !tbaa !9
  store i32 %5, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store ptr null, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  %19 = load ptr, ptr %8, align 8, !tbaa !5
  %20 = call ptr @ENGINE_by_id(ptr noundef %19)
  store ptr %20, ptr %14, align 8, !tbaa !5
  %21 = load ptr, ptr %14, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %24, label %23

23:                                               ; preds = %6
  store ptr null, ptr %7, align 8
  store i32 1, ptr %16, align 4
  br label %194

24:                                               ; preds = %6
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = call i32 @strncmp(ptr noundef %25, ptr noundef @.str, i64 noundef 9) #7
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %76

28:                                               ; preds = %24
  %29 = load ptr, ptr @hw_algo_bitmap, align 8, !tbaa !5
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %38

31:                                               ; preds = %28
  %32 = load ptr, ptr %14, align 8, !tbaa !5
  %33 = load ptr, ptr @hw_algo_bitmap, align 8, !tbaa !5
  %34 = call i32 @ENGINE_ctrl_cmd(ptr noundef %32, ptr noundef @.str.1, i64 noundef 0, ptr noundef %33, ptr noundef null, i32 noundef 0)
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %37, label %36

36:                                               ; preds = %31
  br label %191

37:                                               ; preds = %31
  br label %38

38:                                               ; preds = %37, %28
  %39 = load ptr, ptr @sw_algo_bitmap, align 8, !tbaa !5
  %40 = icmp ne ptr %39, null
  br i1 %40, label %41, label %48

41:                                               ; preds = %38
  %42 = load ptr, ptr %14, align 8, !tbaa !5
  %43 = load ptr, ptr @sw_algo_bitmap, align 8, !tbaa !5
  %44 = call i32 @ENGINE_ctrl_cmd(ptr noundef %42, ptr noundef @.str.2, i64 noundef 0, ptr noundef %43, ptr noundef null, i32 noundef 0)
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %47, label %46

46:                                               ; preds = %41
  br label %191

47:                                               ; preds = %41
  br label %48

48:                                               ; preds = %47, %38
  %49 = load i32, ptr %10, align 4, !tbaa !9
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %57

51:                                               ; preds = %48
  %52 = load ptr, ptr %14, align 8, !tbaa !5
  %53 = call i32 @ENGINE_ctrl_cmd(ptr noundef %52, ptr noundef @.str.3, i64 noundef 0, ptr noundef null, ptr noundef null, i32 noundef 0)
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  br label %191

56:                                               ; preds = %51
  br label %57

57:                                               ; preds = %56, %48
  %58 = load i32, ptr %9, align 4, !tbaa !9
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %66

60:                                               ; preds = %57
  %61 = load ptr, ptr %14, align 8, !tbaa !5
  %62 = call i32 @ENGINE_ctrl_cmd(ptr noundef %61, ptr noundef @.str.4, i64 noundef 0, ptr noundef null, ptr noundef null, i32 noundef 0)
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  br label %191

65:                                               ; preds = %60
  br label %66

66:                                               ; preds = %65, %57
  %67 = load i32, ptr %13, align 4, !tbaa !9
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %75

69:                                               ; preds = %66
  %70 = load ptr, ptr %14, align 8, !tbaa !5
  %71 = call i32 @ENGINE_ctrl_cmd(ptr noundef %70, ptr noundef @.str.5, i64 noundef 0, ptr noundef null, ptr noundef null, i32 noundef 0)
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %74, label %73

73:                                               ; preds = %69
  br label %191

74:                                               ; preds = %69
  br label %75

75:                                               ; preds = %74, %66
  br label %76

76:                                               ; preds = %75, %24
  %77 = load ptr, ptr %14, align 8, !tbaa !5
  %78 = call i32 @ENGINE_init(ptr noundef %77)
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %81, label %80

80:                                               ; preds = %76
  br label %191

81:                                               ; preds = %76
  %82 = load ptr, ptr %14, align 8, !tbaa !5
  %83 = call i32 @ENGINE_set_default(ptr noundef %82, i32 noundef 65471)
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = call i32 @strncmp(ptr noundef %84, ptr noundef @.str, i64 noundef 9) #7
  %86 = icmp eq i32 %85, 0
  br i1 %86, label %87, label %189

87:                                               ; preds = %81
  %88 = load i32, ptr %9, align 4, !tbaa !9
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %160

90:                                               ; preds = %87
  %91 = load i32, ptr %10, align 4, !tbaa !9
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %160

93:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !9
  %94 = call i32 @epoll_create1(i32 noundef 0) #6
  store i32 %94, ptr @efd, align 4, !tbaa !9
  %95 = load i32, ptr @efd, align 4, !tbaa !9
  %96 = icmp eq i32 -1, %95
  br i1 %96, label %97, label %98

97:                                               ; preds = %93
  store i32 2, ptr %16, align 4
  br label %157

98:                                               ; preds = %93
  %99 = load ptr, ptr %14, align 8, !tbaa !5
  %100 = call i32 @ENGINE_ctrl_cmd(ptr noundef %99, ptr noundef @.str.6, i64 noundef 0, ptr noundef @no_of_inst, ptr noundef null, i32 noundef 0)
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %103, label %102

102:                                              ; preds = %98
  store i32 2, ptr %16, align 4
  br label %157

103:                                              ; preds = %98
  %104 = load i32, ptr @no_of_inst, align 4, !tbaa !9
  %105 = icmp eq i32 %104, 0
  br i1 %105, label %106, label %107

106:                                              ; preds = %103
  store i32 2, ptr %16, align 4
  br label %157

107:                                              ; preds = %103
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %108

108:                                              ; preds = %153, %107
  %109 = load i32, ptr %15, align 4, !tbaa !9
  %110 = load i32, ptr @no_of_inst, align 4, !tbaa !9
  %111 = icmp slt i32 %109, %110
  br i1 %111, label %112, label %156

112:                                              ; preds = %108
  %113 = load ptr, ptr %14, align 8, !tbaa !5
  %114 = load i32, ptr %15, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = call i32 @ENGINE_ctrl_cmd(ptr noundef %113, ptr noundef @.str.7, i64 noundef %115, ptr noundef %18, ptr noundef null, i32 noundef 0)
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %119, label %118

118:                                              ; preds = %112
  store i32 2, ptr %16, align 4
  br label %157

119:                                              ; preds = %112
  %120 = call noalias ptr @malloc(i64 noundef 16) #8
  store ptr %120, ptr %17, align 8, !tbaa !5
  %121 = load ptr, ptr %17, align 8, !tbaa !5
  %122 = icmp eq ptr null, %121
  br i1 %122, label %123, label %124

123:                                              ; preds = %119
  store i32 2, ptr %16, align 4
  br label %157

124:                                              ; preds = %119
  %125 = load ptr, ptr %17, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.ENG_POLL_EVENT, ptr %125, i32 0, i32 1
  store ptr @eng_poll_handler, ptr %126, align 8, !tbaa !11
  %127 = load i32, ptr %18, align 4, !tbaa !9
  %128 = load ptr, ptr %17, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.ENG_POLL_EVENT, ptr %128, i32 0, i32 0
  store i32 %127, ptr %129, align 8, !tbaa !13
  %130 = load i32, ptr %15, align 4, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [64 x %struct.epoll_event], ptr @event, i64 0, i64 %131
  %133 = getelementptr inbounds %struct.epoll_event, ptr %132, i32 0, i32 0
  store i32 1, ptr %133, align 4, !tbaa !14
  %134 = load ptr, ptr %17, align 8, !tbaa !5
  %135 = load i32, ptr %15, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [64 x %struct.epoll_event], ptr @event, i64 0, i64 %136
  %138 = getelementptr inbounds %struct.epoll_event, ptr %137, i32 0, i32 1
  store ptr %134, ptr %138, align 4, !tbaa !16
  %139 = load i32, ptr @efd, align 4, !tbaa !9
  %140 = load i32, ptr %18, align 4, !tbaa !9
  %141 = load i32, ptr %15, align 4, !tbaa !9
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [64 x %struct.epoll_event], ptr @event, i64 0, i64 %142
  %144 = call i32 @epoll_ctl(i32 noundef %139, i32 noundef 1, i32 noundef %140, ptr noundef %143) #6
  %145 = icmp eq i32 -1, %144
  br i1 %145, label %146, label %152

146:                                              ; preds = %124
  %147 = load ptr, ptr %17, align 8, !tbaa !5
  %148 = icmp ne ptr %147, null
  br i1 %148, label %149, label %151

149:                                              ; preds = %146
  %150 = load ptr, ptr %17, align 8, !tbaa !5
  call void @free(ptr noundef %150) #6
  br label %151

151:                                              ; preds = %149, %146
  store i32 2, ptr %16, align 4
  br label %157

152:                                              ; preds = %124
  store ptr null, ptr %17, align 8, !tbaa !5
  br label %153

153:                                              ; preds = %152
  %154 = load i32, ptr %15, align 4, !tbaa !9
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %15, align 4, !tbaa !9
  br label %108, !llvm.loop !17

156:                                              ; preds = %108
  store i32 0, ptr %16, align 4
  br label %157

157:                                              ; preds = %156, %151, %123, %118, %106, %102, %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  %158 = load i32, ptr %16, align 4
  switch i32 %158, label %194 [
    i32 0, label %159
    i32 2, label %191
  ]

159:                                              ; preds = %157
  br label %160

160:                                              ; preds = %159, %90, %87
  %161 = load i32, ptr %11, align 4, !tbaa !9
  %162 = icmp ne i32 %161, 0
  br i1 %162, label %176, label %163

163:                                              ; preds = %160
  %164 = load i32, ptr %9, align 4, !tbaa !9
  %165 = icmp ne i32 %164, 0
  br i1 %165, label %166, label %176

166:                                              ; preds = %163
  store i32 1, ptr @qat_keep_polling, align 4, !tbaa !9
  %167 = call ptr @CRYPTO_malloc(i64 noundef 8, ptr noundef @.str.8, i32 noundef 610)
  store ptr %167, ptr @testapp_polling_threads, align 8, !tbaa !5
  %168 = load ptr, ptr @testapp_polling_threads, align 8, !tbaa !5
  %169 = getelementptr inbounds i64, ptr %168, i64 0
  %170 = load i32, ptr %10, align 4, !tbaa !9
  %171 = icmp ne i32 %170, 0
  %172 = zext i1 %171 to i64
  %173 = select i1 %171, ptr @ePoll_loop, ptr @poll_loop
  %174 = load ptr, ptr %14, align 8, !tbaa !5
  %175 = call i32 @pthread_create(ptr noundef %169, ptr noundef null, ptr noundef %173, ptr noundef %174) #6
  br label %176

176:                                              ; preds = %166, %163, %160
  %177 = load i32, ptr %13, align 4, !tbaa !9
  %178 = icmp ne i32 %177, 0
  br i1 %178, label %179, label %188

179:                                              ; preds = %176
  %180 = load i32, ptr %9, align 4, !tbaa !9
  %181 = icmp ne i32 %180, 0
  br i1 %181, label %182, label %188

182:                                              ; preds = %179
  store i32 1, ptr @qat_keep_polling, align 4, !tbaa !9
  %183 = call ptr @CRYPTO_malloc(i64 noundef 8, ptr noundef @.str.8, i32 noundef 624)
  store ptr %183, ptr @testapp_heartbeat_threads, align 8, !tbaa !5
  %184 = load ptr, ptr @testapp_heartbeat_threads, align 8, !tbaa !5
  %185 = getelementptr inbounds i64, ptr %184, i64 0
  %186 = load ptr, ptr %14, align 8, !tbaa !5
  %187 = call i32 @pthread_create(ptr noundef %185, ptr noundef null, ptr noundef @heartbeat_poll_loop, ptr noundef %186) #6
  br label %188

188:                                              ; preds = %182, %179, %176
  br label %189

189:                                              ; preds = %188, %81
  %190 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %190, ptr %7, align 8
  store i32 1, ptr %16, align 4
  br label %194

191:                                              ; preds = %157, %80, %73, %64, %55, %46, %36
  %192 = load ptr, ptr %14, align 8, !tbaa !5
  %193 = call i32 @ENGINE_free(ptr noundef %192)
  store ptr null, ptr %7, align 8
  store i32 1, ptr %16, align 4
  br label %194

194:                                              ; preds = %191, %189, %157, %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %195 = load ptr, ptr %7, align 8
  ret ptr %195
}

declare ptr @ENGINE_by_id(ptr noundef) #4

declare i32 @ENGINE_ctrl_cmd(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef) #4

declare i32 @ENGINE_init(ptr noundef) #4

declare i32 @ENGINE_set_default(ptr noundef, i32 noundef) #4

; Function Attrs: nounwind
declare i32 @epoll_create1(i32 noundef) #3

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

; Function Attrs: nounwind
declare i32 @epoll_ctl(i32 noundef, i32 noundef, i32 noundef, ptr noundef) #3

declare ptr @CRYPTO_malloc(i64 noundef, ptr noundef, i32 noundef) #4

; Function Attrs: nounwind
declare i32 @pthread_create(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden ptr @ePoll_loop(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden ptr @poll_loop(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden ptr @heartbeat_poll_loop(ptr noundef) #2

declare i32 @ENGINE_free(ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind 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 = { 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 = { "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 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 #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"", !10, i64 0, !6, i64 8}
!13 = !{!12, !10, i64 0}
!14 = !{!15, !10, i64 0}
!15 = !{!"epoll_event", !10, i64 0, !7, i64 4}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"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"

%struct.epoll_event = type <{ i32, %union.epoll_data }>
%union.epoll_data = type { ptr }

@sw_algo_bitmap = external dso_local local_unnamed_addr global ptr, align 8
@hw_algo_bitmap = external dso_local local_unnamed_addr global ptr, align 8
@efd = external hidden local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [25 x i8], align 1
@no_of_inst = external hidden global i32, align 4
@.str.7 = external hidden unnamed_addr constant [24 x i8], align 1
@event = external dso_local global [64 x %struct.epoll_event], align 16
@qat_keep_polling = external hidden local_unnamed_addr global i32, align 4
@.str.8 = external hidden unnamed_addr constant [63 x i8], align 1
@testapp_polling_threads = external dso_local local_unnamed_addr global ptr, align 8
@testapp_heartbeat_threads = external dso_local local_unnamed_addr global ptr, align 8

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @eng_poll_handler(ptr noundef, ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local ptr @tests_initialise_engine(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #2 {
  %7 = alloca i32, align 4
  %8 = tail call ptr @ENGINE_by_id(ptr noundef %0) #7
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %76, label %9

9:                                                ; preds = %6
  %10 = tail call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) @.str, i64 noundef 9) #8
  %11 = icmp eq i32 %10, 0
  br i1 %11, label %12, label %29

12:                                               ; preds = %9
  %13 = load ptr, ptr @hw_algo_bitmap, align 8, !tbaa !5
  %.not51 = icmp eq ptr %13, null
  br i1 %.not51, label %16, label %14

14:                                               ; preds = %12
  %15 = tail call i32 @ENGINE_ctrl_cmd(ptr noundef nonnull %8, ptr noundef nonnull @.str.1, i64 noundef 0, ptr noundef nonnull %13, ptr noundef null, i32 noundef 0) #7
  %.not52 = icmp eq i32 %15, 0
  br i1 %.not52, label %74, label %16

16:                                               ; preds = %14, %12
  %17 = load ptr, ptr @sw_algo_bitmap, align 8, !tbaa !5
  %.not53 = icmp eq ptr %17, null
  br i1 %.not53, label %20, label %18

18:                                               ; preds = %16
  %19 = tail call i32 @ENGINE_ctrl_cmd(ptr noundef nonnull %8, ptr noundef nonnull @.str.2, i64 noundef 0, ptr noundef nonnull %17, ptr noundef null, i32 noundef 0) #7
  %.not54 = icmp eq i32 %19, 0
  br i1 %.not54, label %74, label %20

20:                                               ; preds = %18, %16
  %.not55 = icmp eq i32 %2, 0
  br i1 %.not55, label %23, label %21

21:                                               ; preds = %20
  %22 = tail call i32 @ENGINE_ctrl_cmd(ptr noundef nonnull %8, ptr noundef nonnull @.str.3, i64 noundef 0, ptr noundef null, ptr noundef null, i32 noundef 0) #7
  %.not56 = icmp eq i32 %22, 0
  br i1 %.not56, label %74, label %23

23:                                               ; preds = %21, %20
  %.not57 = icmp eq i32 %1, 0
  br i1 %.not57, label %26, label %24

24:                                               ; preds = %23
  %25 = tail call i32 @ENGINE_ctrl_cmd(ptr noundef nonnull %8, ptr noundef nonnull @.str.4, i64 noundef 0, ptr noundef null, ptr noundef null, i32 noundef 0) #7
  %.not58 = icmp eq i32 %25, 0
  br i1 %.not58, label %74, label %26

26:                                               ; preds = %24, %23
  %.not59 = icmp eq i32 %5, 0
  br i1 %.not59, label %29, label %27

27:                                               ; preds = %26
  %28 = tail call i32 @ENGINE_ctrl_cmd(ptr noundef nonnull %8, ptr noundef nonnull @.str.5, i64 noundef 0, ptr noundef null, ptr noundef null, i32 noundef 0) #7
  %.not60 = icmp eq i32 %28, 0
  br i1 %.not60, label %74, label %29

29:                                               ; preds = %26, %27, %9
  %30 = tail call i32 @ENGINE_init(ptr noundef nonnull %8) #7
  %.not61 = icmp eq i32 %30, 0
  br i1 %.not61, label %74, label %31

31:                                               ; preds = %29
  %32 = tail call i32 @ENGINE_set_default(ptr noundef nonnull %8, i32 noundef 65471) #7
  %33 = tail call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) @.str, i64 noundef 9) #8
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %35, label %76

35:                                               ; preds = %31
  %36 = icmp ne i32 %1, 0
  %37 = icmp ne i32 %2, 0
  %or.cond = and i1 %36, %37
  br i1 %or.cond, label %38, label %63

38:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  store i32 0, ptr %7, align 4, !tbaa !9
  %39 = tail call i32 @epoll_create1(i32 noundef 0) #7
  store i32 %39, ptr @efd, align 4, !tbaa !9
  %40 = icmp eq i32 %39, -1
  br i1 %40, label %.thread, label %41

41:                                               ; preds = %38
  %42 = tail call i32 @ENGINE_ctrl_cmd(ptr noundef nonnull %8, ptr noundef nonnull @.str.6, i64 noundef 0, ptr noundef nonnull @no_of_inst, ptr noundef null, i32 noundef 0) #7
  %.not62 = icmp eq i32 %42, 0
  %43 = load i32, ptr @no_of_inst, align 4
  %44 = icmp eq i32 %43, 0
  %or.cond66 = select i1 %.not62, i1 true, i1 %44
  br i1 %or.cond66, label %.thread, label %.preheader

.preheader:                                       ; preds = %41
  %45 = icmp sgt i32 %43, 0
  br i1 %45, label %.lr.ph, label %._crit_edge

46:                                               ; preds = %54
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %47 = load i32, ptr @no_of_inst, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = icmp slt i64 %indvars.iv.next, %48
  br i1 %49, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.lr.ph:                                           ; preds = %.preheader, %46
  %indvars.iv = phi i64 [ %indvars.iv.next, %46 ], [ 0, %.preheader ]
  %50 = call i32 @ENGINE_ctrl_cmd(ptr noundef nonnull %8, ptr noundef nonnull @.str.7, i64 noundef %indvars.iv, ptr noundef nonnull %7, ptr noundef null, i32 noundef 0) #7
  %.not63 = icmp eq i32 %50, 0
  br i1 %.not63, label %.thread, label %51

51:                                               ; preds = %.lr.ph
  %52 = call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #9
  %53 = icmp eq ptr %52, null
  br i1 %53, label %.thread, label %54

54:                                               ; preds = %51
  %55 = getelementptr inbounds i8, ptr %52, i64 8
  store ptr @eng_poll_handler, ptr %55, align 8, !tbaa !13
  %56 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %56, ptr %52, align 8, !tbaa !15
  %57 = getelementptr inbounds [64 x %struct.epoll_event], ptr @event, i64 0, i64 %indvars.iv
  store i32 1, ptr %57, align 4, !tbaa !16
  %58 = getelementptr inbounds i8, ptr %57, i64 4
  store ptr %52, ptr %58, align 4, !tbaa !18
  %59 = load i32, ptr @efd, align 4, !tbaa !9
  %60 = call i32 @epoll_ctl(i32 noundef %59, i32 noundef 1, i32 noundef %56, ptr noundef nonnull %57) #7
  %61 = icmp eq i32 %60, -1
  br i1 %61, label %62, label %46

62:                                               ; preds = %54
  call void @free(ptr noundef nonnull %52) #7
  br label %.thread

.thread:                                          ; preds = %.lr.ph, %51, %62, %38, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br label %74

._crit_edge:                                      ; preds = %46, %.preheader
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br label %63

63:                                               ; preds = %._crit_edge, %35
  %64 = icmp eq i32 %3, 0
  %or.cond3 = and i1 %36, %64
  br i1 %or.cond3, label %65, label %69

65:                                               ; preds = %63
  store i32 1, ptr @qat_keep_polling, align 4, !tbaa !9
  %66 = call ptr @CRYPTO_malloc(i64 noundef 8, ptr noundef nonnull @.str.8, i32 noundef 610) #7
  store ptr %66, ptr @testapp_polling_threads, align 8, !tbaa !5
  %67 = select i1 %37, ptr @ePoll_loop, ptr @poll_loop
  %68 = call i32 @pthread_create(ptr noundef %66, ptr noundef null, ptr noundef nonnull %67, ptr noundef nonnull %8) #7
  br label %69

69:                                               ; preds = %65, %63
  %70 = icmp ne i32 %5, 0
  %or.cond5 = and i1 %36, %70
  br i1 %or.cond5, label %71, label %76

71:                                               ; preds = %69
  store i32 1, ptr @qat_keep_polling, align 4, !tbaa !9
  %72 = call ptr @CRYPTO_malloc(i64 noundef 8, ptr noundef nonnull @.str.8, i32 noundef 624) #7
  store ptr %72, ptr @testapp_heartbeat_threads, align 8, !tbaa !5
  %73 = call i32 @pthread_create(ptr noundef %72, ptr noundef null, ptr noundef nonnull @heartbeat_poll_loop, ptr noundef nonnull %8) #7
  br label %76

74:                                               ; preds = %.thread, %29, %27, %24, %21, %18, %14
  %75 = call i32 @ENGINE_free(ptr noundef nonnull %8) #7
  br label %76

76:                                               ; preds = %31, %71, %69, %6, %74
  %.046 = phi ptr [ null, %74 ], [ null, %6 ], [ %8, %69 ], [ %8, %71 ], [ %8, %31 ]
  ret ptr %.046
}

declare ptr @ENGINE_by_id(ptr noundef) local_unnamed_addr #4

declare i32 @ENGINE_ctrl_cmd(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

declare i32 @ENGINE_init(ptr noundef) local_unnamed_addr #4

declare i32 @ENGINE_set_default(ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: nounwind
declare i32 @epoll_create1(i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #6

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

declare ptr @CRYPTO_malloc(i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
declare hidden ptr @ePoll_loop(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden ptr @poll_loop(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden ptr @heartbeat_poll_loop(ptr noundef) #2

declare i32 @ENGINE_free(ptr noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind 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 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 #4 = { "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 = { 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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !6, i64 8}
!14 = !{!"", !10, i64 0, !6, i64 8}
!15 = !{!14, !10, i64 0}
!16 = !{!17, !10, i64 0}
!17 = !{!"epoll_event", !10, i64 0, !7, i64 4}
!18 = !{!7, !7, i64 0}


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