; LLVM IR from lfarcaro/ARINC653_ARMV7A_Z7000 :: ARINC653_ARMV7A_Z7000.sw/ARINC653_ARMV7A_Z7000/src/ARINC653 (arinc653_scheduler)

; 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._MODULE_INFORMATION_TYPE = type { ptr, %struct._heapRECORD, i32, i32, i32, %struct._CONTEXT_TYPE, i32, ptr, ptr, %struct._HEALTHMONITORINGCALLBACK_INFORMATION_TYPE, i64, i64, i64, %struct._priorityqueueRECORD }
%struct._heapRECORD = type { ptr, i32, i32, i32 }
%struct._CONTEXT_TYPE = type { i32, ptr, ptr, ptr, i32, i8, ptr, ptr, i32, i32, i32, i32 }
%struct._HEALTHMONITORINGCALLBACK_INFORMATION_TYPE = type { i8, ptr, i32, %struct._CONTEXT_TYPE, i8, i8, i8, i8, i32, i32 }
%struct._priorityqueueRECORD = type { ptr, i32, i8, i8 }
%struct._PARTITION_INFORMATION_TYPE = type { i8, ptr, ptr, i32, i32, i32, i32, i8, %struct._heapRECORD, %struct._CONTEXT_TYPE, i32, ptr, ptr, %struct._ERRORHANDLER_INFORMATION_TYPE, %struct._HEALTHMONITORINGCALLBACK_INFORMATION_TYPE, i32, %struct._priorityqueueENTRY, %struct._priorityqueueRECORD, %struct._priorityqueueRECORD, %struct._priorityqueueRECORD, i32, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr }
%struct._ERRORHANDLER_INFORMATION_TYPE = type { i8, ptr, i32, %struct._CONTEXT_TYPE, i8, i8, i8, i8, i32 }
%struct._priorityqueueENTRY = type { i64, i64, ptr, ptr, ptr }
%struct._PROCESS_INFORMATION_TYPE = type { ptr, ptr, i32, i32, i32, i64, i64, i64, i64, i64, %struct._CONTEXT_TYPE, %struct._priorityqueueENTRY, %struct._priorityqueueENTRY, %struct._priorityqueueENTRY, %struct._priorityqueueENTRY, i8, i8, ptr, i32, ptr, ptr }
%struct._PROCESS_ATTRIBUTE_TYPE = type { ptr, ptr, i32, i32, i64, i64, i32 }
%struct._PARTITION_CONFIGURATION_TYPE = type { i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, ptr, i32, ptr, ptr }
%struct._PARTITION_CONFIGURATION_SCHEDULE_TYPE = type { i64, i64, i32, ptr }
%struct._PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE = type { i64, i64, i8 }

@CORE_MODULE_INFORMATION = external global [2 x %struct._MODULE_INFORMATION_TYPE], align 16

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

declare i32 @PORT_GETCORE() #1

declare void @PRIORITYQUEUE_ENQUEUE(ptr noundef, ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @SCHEDULER_STARTPROCESSSCHEDULER(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %8 = call i32 @PORT_GETCORE()
  %9 = zext i32 %8 to i64
  %10 = getelementptr inbounds [2 x %struct._MODULE_INFORMATION_TYPE], ptr @CORE_MODULE_INFORMATION, i64 0, i64 %9
  store ptr %10, ptr %3, align 8, !tbaa !5
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %11, i32 0, i32 8
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  %14 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %13, i32 0, i32 10
  %15 = load i32, ptr %14, align 8, !tbaa !17
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %17, label %19

17:                                               ; preds = %1
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  store i32 1, ptr %18, align 4, !tbaa !21
  store i32 1, ptr %7, align 4
  br label %378

19:                                               ; preds = %1
  call void @ENTER_CORE()
  store i32 0, ptr %4, align 4, !tbaa !21
  br label %20

20:                                               ; preds = %369, %19
  %21 = load i32, ptr %4, align 4, !tbaa !21
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %22, i32 0, i32 8
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  %25 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %24, i32 0, i32 10
  %26 = load i32, ptr %25, align 8, !tbaa !17
  %27 = icmp ult i32 %21, %26
  br i1 %27, label %28, label %372

28:                                               ; preds = %20
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %29, i32 0, i32 8
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  %32 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %31, i32 0, i32 11
  %33 = load ptr, ptr %32, align 8, !tbaa !22
  %34 = load i32, ptr %4, align 4, !tbaa !21
  %35 = zext i32 %34 to i64
  %36 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %33, i64 %35
  store ptr %36, ptr %5, align 8, !tbaa !5
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %37, i32 0, i32 4
  %39 = load i32, ptr %38, align 8, !tbaa !23
  %40 = icmp ne i32 %39, 4
  br i1 %40, label %41, label %42

41:                                               ; preds = %28
  br label %369

42:                                               ; preds = %28
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %43, i32 0, i32 0
  %45 = load ptr, ptr %44, align 8, !tbaa !25
  %46 = getelementptr inbounds %struct._PROCESS_ATTRIBUTE_TYPE, ptr %45, i32 0, i32 4
  %47 = load i64, ptr %46, align 8, !tbaa !26
  %48 = icmp ne i64 %47, 0
  br i1 %48, label %49, label %215

49:                                               ; preds = %42
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %50, i32 0, i32 8
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  %53 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %52, i32 0, i32 15
  %54 = load i32, ptr %53, align 8, !tbaa !28
  %55 = add i32 %54, 1
  store i32 %55, ptr %6, align 4, !tbaa !21
  %56 = load i32, ptr %6, align 4, !tbaa !21
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %57, i32 0, i32 8
  %59 = load ptr, ptr %58, align 8, !tbaa !9
  %60 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %59, i32 0, i32 2
  %61 = load ptr, ptr %60, align 8, !tbaa !29
  %62 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_TYPE, ptr %61, i32 0, i32 24
  %63 = load ptr, ptr %62, align 8, !tbaa !30
  %64 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_SCHEDULE_TYPE, ptr %63, i32 0, i32 2
  %65 = load i32, ptr %64, align 8, !tbaa !32
  %66 = icmp uge i32 %56, %65
  br i1 %66, label %67, label %68

67:                                               ; preds = %49
  store i32 0, ptr %6, align 4, !tbaa !21
  br label %68

68:                                               ; preds = %67, %49
  br label %69

69:                                               ; preds = %101, %68
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %70, i32 0, i32 8
  %72 = load ptr, ptr %71, align 8, !tbaa !9
  %73 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %72, i32 0, i32 2
  %74 = load ptr, ptr %73, align 8, !tbaa !29
  %75 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_TYPE, ptr %74, i32 0, i32 24
  %76 = load ptr, ptr %75, align 8, !tbaa !30
  %77 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_SCHEDULE_TYPE, ptr %76, i32 0, i32 3
  %78 = load ptr, ptr %77, align 8, !tbaa !34
  %79 = load i32, ptr %6, align 4, !tbaa !21
  %80 = zext i32 %79 to i64
  %81 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE, ptr %78, i64 %80
  %82 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE, ptr %81, i32 0, i32 2
  %83 = load i8, ptr %82, align 8, !tbaa !35
  %84 = zext i8 %83 to i32
  %85 = icmp eq i32 %84, 0
  br i1 %85, label %86, label %102

86:                                               ; preds = %69
  %87 = load i32, ptr %6, align 4, !tbaa !21
  %88 = add i32 %87, 1
  store i32 %88, ptr %6, align 4, !tbaa !21
  %89 = load i32, ptr %6, align 4, !tbaa !21
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %90, i32 0, i32 8
  %92 = load ptr, ptr %91, align 8, !tbaa !9
  %93 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %92, i32 0, i32 2
  %94 = load ptr, ptr %93, align 8, !tbaa !29
  %95 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_TYPE, ptr %94, i32 0, i32 24
  %96 = load ptr, ptr %95, align 8, !tbaa !30
  %97 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_SCHEDULE_TYPE, ptr %96, i32 0, i32 2
  %98 = load i32, ptr %97, align 8, !tbaa !32
  %99 = icmp uge i32 %89, %98
  br i1 %99, label %100, label %101

100:                                              ; preds = %86
  store i32 0, ptr %6, align 4, !tbaa !21
  br label %101

101:                                              ; preds = %100, %86
  br label %69, !llvm.loop !37

102:                                              ; preds = %69
  %103 = load i32, ptr %6, align 4, !tbaa !21
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %104, i32 0, i32 8
  %106 = load ptr, ptr %105, align 8, !tbaa !9
  %107 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %106, i32 0, i32 15
  %108 = load i32, ptr %107, align 8, !tbaa !28
  %109 = icmp ule i32 %103, %108
  br i1 %109, label %110, label %135

110:                                              ; preds = %102
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %111, i32 0, i32 12
  %113 = load i64, ptr %112, align 8, !tbaa !39
  %114 = load ptr, ptr %3, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %114, i32 0, i32 8
  %116 = load ptr, ptr %115, align 8, !tbaa !9
  %117 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %116, i32 0, i32 2
  %118 = load ptr, ptr %117, align 8, !tbaa !29
  %119 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_TYPE, ptr %118, i32 0, i32 24
  %120 = load ptr, ptr %119, align 8, !tbaa !30
  %121 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_SCHEDULE_TYPE, ptr %120, i32 0, i32 3
  %122 = load ptr, ptr %121, align 8, !tbaa !34
  %123 = load i32, ptr %6, align 4, !tbaa !21
  %124 = zext i32 %123 to i64
  %125 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE, ptr %122, i64 %124
  %126 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE, ptr %125, i32 0, i32 0
  %127 = load i64, ptr %126, align 8, !tbaa !40
  %128 = add nsw i64 %113, %127
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %129, i32 0, i32 5
  %131 = load i64, ptr %130, align 8, !tbaa !41
  %132 = add nsw i64 %128, %131
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %133, i32 0, i32 6
  store i64 %132, ptr %134, align 8, !tbaa !42
  br label %160

135:                                              ; preds = %102
  %136 = load ptr, ptr %3, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %136, i32 0, i32 10
  %138 = load i64, ptr %137, align 8, !tbaa !43
  %139 = load ptr, ptr %3, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %139, i32 0, i32 8
  %141 = load ptr, ptr %140, align 8, !tbaa !9
  %142 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %141, i32 0, i32 2
  %143 = load ptr, ptr %142, align 8, !tbaa !29
  %144 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_TYPE, ptr %143, i32 0, i32 24
  %145 = load ptr, ptr %144, align 8, !tbaa !30
  %146 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_SCHEDULE_TYPE, ptr %145, i32 0, i32 3
  %147 = load ptr, ptr %146, align 8, !tbaa !34
  %148 = load i32, ptr %6, align 4, !tbaa !21
  %149 = zext i32 %148 to i64
  %150 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE, ptr %147, i64 %149
  %151 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE, ptr %150, i32 0, i32 0
  %152 = load i64, ptr %151, align 8, !tbaa !40
  %153 = add nsw i64 %138, %152
  %154 = load ptr, ptr %5, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %154, i32 0, i32 5
  %156 = load i64, ptr %155, align 8, !tbaa !41
  %157 = add nsw i64 %153, %156
  %158 = load ptr, ptr %5, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %158, i32 0, i32 6
  store i64 %157, ptr %159, align 8, !tbaa !42
  br label %160

160:                                              ; preds = %135, %110
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %161, i32 0, i32 0
  %163 = load ptr, ptr %162, align 8, !tbaa !25
  %164 = getelementptr inbounds %struct._PROCESS_ATTRIBUTE_TYPE, ptr %163, i32 0, i32 5
  %165 = load i64, ptr %164, align 8, !tbaa !44
  %166 = icmp ne i64 %165, -1
  br i1 %166, label %167, label %179

167:                                              ; preds = %160
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %168, i32 0, i32 6
  %170 = load i64, ptr %169, align 8, !tbaa !42
  %171 = load ptr, ptr %5, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %171, i32 0, i32 0
  %173 = load ptr, ptr %172, align 8, !tbaa !25
  %174 = getelementptr inbounds %struct._PROCESS_ATTRIBUTE_TYPE, ptr %173, i32 0, i32 5
  %175 = load i64, ptr %174, align 8, !tbaa !44
  %176 = add nsw i64 %170, %175
  %177 = load ptr, ptr %5, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %177, i32 0, i32 7
  store i64 %176, ptr %178, align 8, !tbaa !45
  br label %182

179:                                              ; preds = %160
  %180 = load ptr, ptr %5, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %180, i32 0, i32 7
  store i64 -1, ptr %181, align 8, !tbaa !45
  br label %182

182:                                              ; preds = %179, %167
  %183 = load ptr, ptr %5, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %183, i32 0, i32 4
  store i32 4, ptr %184, align 8, !tbaa !23
  %185 = load ptr, ptr %3, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %185, i32 0, i32 10
  %187 = load i64, ptr %186, align 8, !tbaa !43
  %188 = load ptr, ptr %3, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %188, i32 0, i32 11
  %190 = load i64, ptr %189, align 8, !tbaa !46
  %191 = add nsw i64 %187, %190
  %192 = load ptr, ptr %5, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %192, i32 0, i32 8
  store i64 %191, ptr %193, align 8, !tbaa !47
  %194 = load ptr, ptr %5, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %194, i32 0, i32 9
  store i64 -1, ptr %195, align 8, !tbaa !48
  %196 = load ptr, ptr %5, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %196, i32 0, i32 6
  %198 = load i64, ptr %197, align 8, !tbaa !42
  %199 = load ptr, ptr %5, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %199, i32 0, i32 13
  %201 = getelementptr inbounds %struct._priorityqueueENTRY, ptr %200, i32 0, i32 0
  store i64 %198, ptr %201, align 8, !tbaa !49
  %202 = load ptr, ptr %5, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %202, i32 0, i32 2
  %204 = load i32, ptr %203, align 8, !tbaa !50
  %205 = zext i32 %204 to i64
  %206 = load ptr, ptr %5, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %206, i32 0, i32 13
  %208 = getelementptr inbounds %struct._priorityqueueENTRY, ptr %207, i32 0, i32 1
  store i64 %205, ptr %208, align 8, !tbaa !51
  %209 = load ptr, ptr %3, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %209, i32 0, i32 8
  %211 = load ptr, ptr %210, align 8, !tbaa !9
  %212 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %211, i32 0, i32 19
  %213 = load ptr, ptr %5, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %213, i32 0, i32 13
  call void @PRIORITYQUEUE_ENQUEUE(ptr noundef %212, ptr noundef %214)
  br label %368

215:                                              ; preds = %42
  %216 = load ptr, ptr %5, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %216, i32 0, i32 5
  %218 = load i64, ptr %217, align 8, !tbaa !41
  %219 = icmp eq i64 %218, 0
  br i1 %219, label %220, label %299

220:                                              ; preds = %215
  %221 = load ptr, ptr %3, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %221, i32 0, i32 10
  %223 = load i64, ptr %222, align 8, !tbaa !43
  %224 = load ptr, ptr %3, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %224, i32 0, i32 11
  %226 = load i64, ptr %225, align 8, !tbaa !46
  %227 = add nsw i64 %223, %226
  %228 = load ptr, ptr %5, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %228, i32 0, i32 6
  store i64 %227, ptr %229, align 8, !tbaa !42
  %230 = load ptr, ptr %5, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %230, i32 0, i32 0
  %232 = load ptr, ptr %231, align 8, !tbaa !25
  %233 = getelementptr inbounds %struct._PROCESS_ATTRIBUTE_TYPE, ptr %232, i32 0, i32 5
  %234 = load i64, ptr %233, align 8, !tbaa !44
  %235 = icmp ne i64 %234, -1
  br i1 %235, label %236, label %248

236:                                              ; preds = %220
  %237 = load ptr, ptr %5, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %237, i32 0, i32 6
  %239 = load i64, ptr %238, align 8, !tbaa !42
  %240 = load ptr, ptr %5, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %240, i32 0, i32 0
  %242 = load ptr, ptr %241, align 8, !tbaa !25
  %243 = getelementptr inbounds %struct._PROCESS_ATTRIBUTE_TYPE, ptr %242, i32 0, i32 5
  %244 = load i64, ptr %243, align 8, !tbaa !44
  %245 = add nsw i64 %239, %244
  %246 = load ptr, ptr %5, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %246, i32 0, i32 7
  store i64 %245, ptr %247, align 8, !tbaa !45
  br label %251

248:                                              ; preds = %220
  %249 = load ptr, ptr %5, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %249, i32 0, i32 7
  store i64 -1, ptr %250, align 8, !tbaa !45
  br label %251

251:                                              ; preds = %248, %236
  %252 = load ptr, ptr %5, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %252, i32 0, i32 4
  store i32 2, ptr %253, align 8, !tbaa !23
  %254 = load ptr, ptr %5, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %254, i32 0, i32 3
  %256 = load i32, ptr %255, align 4, !tbaa !52
  %257 = zext i32 %256 to i64
  %258 = load ptr, ptr %5, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %258, i32 0, i32 11
  %260 = getelementptr inbounds %struct._priorityqueueENTRY, ptr %259, i32 0, i32 0
  store i64 %257, ptr %260, align 8, !tbaa !53
  %261 = load ptr, ptr %5, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %261, i32 0, i32 2
  %263 = load i32, ptr %262, align 8, !tbaa !50
  %264 = zext i32 %263 to i64
  %265 = load ptr, ptr %5, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %265, i32 0, i32 11
  %267 = getelementptr inbounds %struct._priorityqueueENTRY, ptr %266, i32 0, i32 1
  store i64 %264, ptr %267, align 8, !tbaa !54
  %268 = load ptr, ptr %3, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %268, i32 0, i32 8
  %270 = load ptr, ptr %269, align 8, !tbaa !9
  %271 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %270, i32 0, i32 17
  %272 = load ptr, ptr %5, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %272, i32 0, i32 11
  call void @PRIORITYQUEUE_ENQUEUE(ptr noundef %271, ptr noundef %273)
  %274 = load ptr, ptr %5, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %274, i32 0, i32 7
  %276 = load i64, ptr %275, align 8, !tbaa !45
  %277 = icmp ne i64 %276, -1
  br i1 %277, label %278, label %298

278:                                              ; preds = %251
  %279 = load ptr, ptr %5, align 8, !tbaa !5
  %280 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %279, i32 0, i32 7
  %281 = load i64, ptr %280, align 8, !tbaa !45
  %282 = load ptr, ptr %5, align 8, !tbaa !5
  %283 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %282, i32 0, i32 12
  %284 = getelementptr inbounds %struct._priorityqueueENTRY, ptr %283, i32 0, i32 0
  store i64 %281, ptr %284, align 8, !tbaa !55
  %285 = load ptr, ptr %5, align 8, !tbaa !5
  %286 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %285, i32 0, i32 2
  %287 = load i32, ptr %286, align 8, !tbaa !50
  %288 = zext i32 %287 to i64
  %289 = load ptr, ptr %5, align 8, !tbaa !5
  %290 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %289, i32 0, i32 12
  %291 = getelementptr inbounds %struct._priorityqueueENTRY, ptr %290, i32 0, i32 1
  store i64 %288, ptr %291, align 8, !tbaa !56
  %292 = load ptr, ptr %3, align 8, !tbaa !5
  %293 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %292, i32 0, i32 8
  %294 = load ptr, ptr %293, align 8, !tbaa !9
  %295 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %294, i32 0, i32 18
  %296 = load ptr, ptr %5, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %296, i32 0, i32 12
  call void @PRIORITYQUEUE_ENQUEUE(ptr noundef %295, ptr noundef %297)
  br label %298

298:                                              ; preds = %278, %251
  br label %367

299:                                              ; preds = %215
  %300 = load ptr, ptr %3, align 8, !tbaa !5
  %301 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %300, i32 0, i32 10
  %302 = load i64, ptr %301, align 8, !tbaa !43
  %303 = load ptr, ptr %3, align 8, !tbaa !5
  %304 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %303, i32 0, i32 11
  %305 = load i64, ptr %304, align 8, !tbaa !46
  %306 = add nsw i64 %302, %305
  %307 = load ptr, ptr %5, align 8, !tbaa !5
  %308 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %307, i32 0, i32 5
  %309 = load i64, ptr %308, align 8, !tbaa !41
  %310 = add nsw i64 %306, %309
  %311 = load ptr, ptr %5, align 8, !tbaa !5
  %312 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %311, i32 0, i32 6
  store i64 %310, ptr %312, align 8, !tbaa !42
  %313 = load ptr, ptr %5, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %313, i32 0, i32 0
  %315 = load ptr, ptr %314, align 8, !tbaa !25
  %316 = getelementptr inbounds %struct._PROCESS_ATTRIBUTE_TYPE, ptr %315, i32 0, i32 5
  %317 = load i64, ptr %316, align 8, !tbaa !44
  %318 = icmp ne i64 %317, -1
  br i1 %318, label %319, label %331

319:                                              ; preds = %299
  %320 = load ptr, ptr %5, align 8, !tbaa !5
  %321 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %320, i32 0, i32 6
  %322 = load i64, ptr %321, align 8, !tbaa !42
  %323 = load ptr, ptr %5, align 8, !tbaa !5
  %324 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %323, i32 0, i32 0
  %325 = load ptr, ptr %324, align 8, !tbaa !25
  %326 = getelementptr inbounds %struct._PROCESS_ATTRIBUTE_TYPE, ptr %325, i32 0, i32 5
  %327 = load i64, ptr %326, align 8, !tbaa !44
  %328 = add nsw i64 %322, %327
  %329 = load ptr, ptr %5, align 8, !tbaa !5
  %330 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %329, i32 0, i32 7
  store i64 %328, ptr %330, align 8, !tbaa !45
  br label %334

331:                                              ; preds = %299
  %332 = load ptr, ptr %5, align 8, !tbaa !5
  %333 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %332, i32 0, i32 7
  store i64 -1, ptr %333, align 8, !tbaa !45
  br label %334

334:                                              ; preds = %331, %319
  %335 = load ptr, ptr %5, align 8, !tbaa !5
  %336 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %335, i32 0, i32 4
  store i32 4, ptr %336, align 8, !tbaa !23
  %337 = load ptr, ptr %3, align 8, !tbaa !5
  %338 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %337, i32 0, i32 10
  %339 = load i64, ptr %338, align 8, !tbaa !43
  %340 = load ptr, ptr %3, align 8, !tbaa !5
  %341 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %340, i32 0, i32 11
  %342 = load i64, ptr %341, align 8, !tbaa !46
  %343 = add nsw i64 %339, %342
  %344 = load ptr, ptr %5, align 8, !tbaa !5
  %345 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %344, i32 0, i32 8
  store i64 %343, ptr %345, align 8, !tbaa !47
  %346 = load ptr, ptr %5, align 8, !tbaa !5
  %347 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %346, i32 0, i32 9
  store i64 -1, ptr %347, align 8, !tbaa !48
  %348 = load ptr, ptr %5, align 8, !tbaa !5
  %349 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %348, i32 0, i32 6
  %350 = load i64, ptr %349, align 8, !tbaa !42
  %351 = load ptr, ptr %5, align 8, !tbaa !5
  %352 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %351, i32 0, i32 13
  %353 = getelementptr inbounds %struct._priorityqueueENTRY, ptr %352, i32 0, i32 0
  store i64 %350, ptr %353, align 8, !tbaa !49
  %354 = load ptr, ptr %5, align 8, !tbaa !5
  %355 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %354, i32 0, i32 2
  %356 = load i32, ptr %355, align 8, !tbaa !50
  %357 = zext i32 %356 to i64
  %358 = load ptr, ptr %5, align 8, !tbaa !5
  %359 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %358, i32 0, i32 13
  %360 = getelementptr inbounds %struct._priorityqueueENTRY, ptr %359, i32 0, i32 1
  store i64 %357, ptr %360, align 8, !tbaa !51
  %361 = load ptr, ptr %3, align 8, !tbaa !5
  %362 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %361, i32 0, i32 8
  %363 = load ptr, ptr %362, align 8, !tbaa !9
  %364 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %363, i32 0, i32 19
  %365 = load ptr, ptr %5, align 8, !tbaa !5
  %366 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %365, i32 0, i32 13
  call void @PRIORITYQUEUE_ENQUEUE(ptr noundef %364, ptr noundef %366)
  br label %367

367:                                              ; preds = %334, %298
  br label %368

368:                                              ; preds = %367, %182
  br label %369

369:                                              ; preds = %368, %41
  %370 = load i32, ptr %4, align 4, !tbaa !21
  %371 = add i32 %370, 1
  store i32 %371, ptr %4, align 4, !tbaa !21
  br label %20, !llvm.loop !57

372:                                              ; preds = %20
  %373 = load ptr, ptr %3, align 8, !tbaa !5
  %374 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %373, i32 0, i32 8
  %375 = load ptr, ptr %374, align 8, !tbaa !9
  %376 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %375, i32 0, i32 12
  store ptr null, ptr %376, align 8, !tbaa !58
  call void @PORT_YIELD()
  %377 = load ptr, ptr %2, align 8, !tbaa !5
  store i32 1, ptr %377, align 4, !tbaa !21
  call void @EXIT_CORE()
  store i32 0, ptr %7, align 4
  br label %378

378:                                              ; preds = %372, %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  %379 = load i32, ptr %7, align 4
  switch i32 %379, label %381 [
    i32 0, label %380
    i32 1, label %380
  ]

380:                                              ; preds = %378, %378
  ret void

381:                                              ; preds = %378
  unreachable
}

declare void @ENTER_CORE() #1

declare void @PORT_YIELD() #1

declare void @EXIT_CORE() #1

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

!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, !6, i64 136}
!10 = !{!"_MODULE_INFORMATION_TYPE", !6, i64 0, !11, i64 8, !12, i64 32, !12, i64 36, !12, i64 40, !13, i64 48, !12, i64 120, !6, i64 128, !6, i64 136, !14, i64 144, !15, i64 256, !15, i64 264, !15, i64 272, !16, i64 280}
!11 = !{!"_heapRECORD", !6, i64 0, !12, i64 8, !12, i64 12, !12, i64 16}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_CONTEXT_TYPE", !12, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !12, i64 32, !7, i64 36, !6, i64 40, !6, i64 48, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68}
!14 = !{!"_HEALTHMONITORINGCALLBACK_INFORMATION_TYPE", !7, i64 0, !6, i64 8, !12, i64 16, !13, i64 24, !7, i64 96, !7, i64 97, !7, i64 98, !7, i64 99, !12, i64 100, !12, i64 104}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"_priorityqueueRECORD", !6, i64 0, !12, i64 8, !7, i64 12, !7, i64 13}
!17 = !{!18, !12, i64 144}
!18 = !{!"_PARTITION_INFORMATION_TYPE", !7, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !7, i64 40, !11, i64 48, !13, i64 72, !12, i64 144, !6, i64 152, !6, i64 160, !19, i64 168, !14, i64 272, !12, i64 384, !20, i64 392, !16, i64 432, !16, i64 448, !16, i64 464, !12, i64 480, !12, i64 484, !6, i64 488, !12, i64 496, !6, i64 504, !12, i64 512, !6, i64 520, !12, i64 528, !6, i64 536, !12, i64 544, !6, i64 552, !12, i64 560, !6, i64 568, !12, i64 576, !6, i64 584}
!19 = !{!"_ERRORHANDLER_INFORMATION_TYPE", !7, i64 0, !6, i64 8, !12, i64 16, !13, i64 24, !7, i64 96, !7, i64 97, !7, i64 98, !7, i64 99, !12, i64 100}
!20 = !{!"_priorityqueueENTRY", !15, i64 0, !15, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!21 = !{!12, !12, i64 0}
!22 = !{!18, !6, i64 152}
!23 = !{!24, !12, i64 24}
!24 = !{!"_PROCESS_INFORMATION_TYPE", !6, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !15, i64 32, !15, i64 40, !15, i64 48, !15, i64 56, !15, i64 64, !13, i64 72, !20, i64 144, !20, i64 184, !20, i64 224, !20, i64 264, !7, i64 304, !7, i64 305, !6, i64 312, !12, i64 320, !6, i64 328, !6, i64 336}
!25 = !{!24, !6, i64 0}
!26 = !{!27, !15, i64 24}
!27 = !{!"_PROCESS_ATTRIBUTE_TYPE", !6, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !15, i64 24, !15, i64 32, !12, i64 40}
!28 = !{!18, !12, i64 384}
!29 = !{!18, !6, i64 16}
!30 = !{!31, !6, i64 160}
!31 = !{!"_PARTITION_CONFIGURATION_TYPE", !12, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !6, i64 48, !12, i64 56, !6, i64 64, !12, i64 72, !6, i64 80, !12, i64 88, !6, i64 96, !12, i64 104, !6, i64 112, !12, i64 120, !6, i64 128, !12, i64 136, !6, i64 144, !12, i64 152, !6, i64 160, !6, i64 168, !12, i64 176, !6, i64 184, !6, i64 192}
!32 = !{!33, !12, i64 16}
!33 = !{!"_PARTITION_CONFIGURATION_SCHEDULE_TYPE", !15, i64 0, !15, i64 8, !12, i64 16, !6, i64 24}
!34 = !{!33, !6, i64 24}
!35 = !{!36, !7, i64 16}
!36 = !{!"_PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE", !15, i64 0, !15, i64 8, !7, i64 16}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!10, !15, i64 272}
!40 = !{!36, !15, i64 0}
!41 = !{!24, !15, i64 32}
!42 = !{!24, !15, i64 40}
!43 = !{!10, !15, i64 256}
!44 = !{!27, !15, i64 32}
!45 = !{!24, !15, i64 48}
!46 = !{!10, !15, i64 264}
!47 = !{!24, !15, i64 56}
!48 = !{!24, !15, i64 64}
!49 = !{!24, !15, i64 224}
!50 = !{!24, !12, i64 16}
!51 = !{!24, !15, i64 232}
!52 = !{!24, !12, i64 20}
!53 = !{!24, !15, i64 144}
!54 = !{!24, !15, i64 152}
!55 = !{!24, !15, i64 184}
!56 = !{!24, !15, i64 192}
!57 = distinct !{!57, !38}
!58 = !{!18, !6, i64 160}


; 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._MODULE_INFORMATION_TYPE = type { ptr, %struct._heapRECORD, i32, i32, i32, %struct._CONTEXT_TYPE, i32, ptr, ptr, %struct._HEALTHMONITORINGCALLBACK_INFORMATION_TYPE, i64, i64, i64, %struct._priorityqueueRECORD }
%struct._heapRECORD = type { ptr, i32, i32, i32 }
%struct._CONTEXT_TYPE = type { i32, ptr, ptr, ptr, i32, i8, ptr, ptr, i32, i32, i32, i32 }
%struct._HEALTHMONITORINGCALLBACK_INFORMATION_TYPE = type { i8, ptr, i32, %struct._CONTEXT_TYPE, i8, i8, i8, i8, i32, i32 }
%struct._priorityqueueRECORD = type { ptr, i32, i8, i8 }
%struct._PROCESS_INFORMATION_TYPE = type { ptr, ptr, i32, i32, i32, i64, i64, i64, i64, i64, %struct._CONTEXT_TYPE, %struct._priorityqueueENTRY, %struct._priorityqueueENTRY, %struct._priorityqueueENTRY, %struct._priorityqueueENTRY, i8, i8, ptr, i32, ptr, ptr }
%struct._priorityqueueENTRY = type { i64, i64, ptr, ptr, ptr }
%struct._PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE = type { i64, i64, i8 }

@CORE_MODULE_INFORMATION = external local_unnamed_addr global [2 x %struct._MODULE_INFORMATION_TYPE], align 16

declare i32 @PORT_GETCORE() local_unnamed_addr #0

declare void @PRIORITYQUEUE_ENQUEUE(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @SCHEDULER_STARTPROCESSSCHEDULER(ptr nocapture noundef writeonly %0) local_unnamed_addr #1 {
  %2 = tail call i32 @PORT_GETCORE() #2
  %3 = zext i32 %2 to i64
  %4 = getelementptr inbounds [2 x %struct._MODULE_INFORMATION_TYPE], ptr @CORE_MODULE_INFORMATION, i64 0, i64 %3
  %5 = getelementptr inbounds i8, ptr %4, i64 136
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %6, i64 144
  %8 = load i32, ptr %7, align 8, !tbaa !16
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %10, label %11

10:                                               ; preds = %1
  store i32 1, ptr %0, align 4, !tbaa !20
  br label %126

11:                                               ; preds = %1
  tail call void @ENTER_CORE() #2
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %12, i64 144
  %14 = load i32, ptr %13, align 8, !tbaa !16
  %.not114 = icmp eq i32 %14, 0
  br i1 %.not114, label %._crit_edge112, label %.lr.ph111

.lr.ph111:                                        ; preds = %11
  %15 = getelementptr inbounds i8, ptr %4, i64 272
  %16 = getelementptr inbounds i8, ptr %4, i64 256
  %17 = getelementptr inbounds i8, ptr %4, i64 264
  br label %18

18:                                               ; preds = %.lr.ph111, %119
  %indvars.iv = phi i64 [ 0, %.lr.ph111 ], [ %indvars.iv.next, %119 ]
  %19 = phi ptr [ %12, %.lr.ph111 ], [ %120, %119 ]
  %20 = getelementptr inbounds i8, ptr %19, i64 152
  %21 = load ptr, ptr %20, align 8, !tbaa !21
  %22 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %21, i64 %indvars.iv
  %23 = getelementptr inbounds i8, ptr %22, i64 24
  %24 = load i32, ptr %23, align 8, !tbaa !22
  %.not = icmp eq i32 %24, 4
  br i1 %.not, label %25, label %119

25:                                               ; preds = %18
  %26 = load ptr, ptr %22, align 8, !tbaa !24
  %27 = getelementptr inbounds i8, ptr %26, i64 24
  %28 = load i64, ptr %27, align 8, !tbaa !25
  %.not97 = icmp eq i64 %28, 0
  br i1 %.not97, label %74, label %29

29:                                               ; preds = %25
  %30 = getelementptr inbounds i8, ptr %19, i64 384
  %31 = load i32, ptr %30, align 8, !tbaa !27
  %32 = add i32 %31, 1
  %33 = getelementptr inbounds i8, ptr %19, i64 16
  %34 = load ptr, ptr %33, align 8, !tbaa !28
  %35 = getelementptr inbounds i8, ptr %34, i64 160
  %36 = load ptr, ptr %35, align 8, !tbaa !29
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  %38 = load i32, ptr %37, align 8, !tbaa !31
  %.not101 = icmp ult i32 %32, %38
  %spec.select = select i1 %.not101, i32 %32, i32 0
  %39 = getelementptr inbounds i8, ptr %36, i64 24
  %40 = load ptr, ptr %39, align 8, !tbaa !33
  %41 = zext i32 %spec.select to i64
  %42 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE, ptr %40, i64 %41
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  %44 = load i8, ptr %43, align 8, !tbaa !34
  %45 = icmp eq i8 %44, 0
  br i1 %45, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %29, %.lr.ph
  %.1107 = phi i32 [ %spec.select105, %.lr.ph ], [ %spec.select, %29 ]
  %46 = add i32 %.1107, 1
  %.not104 = icmp ult i32 %46, %38
  %spec.select105 = select i1 %.not104, i32 %46, i32 0
  %47 = zext i32 %spec.select105 to i64
  %48 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE, ptr %40, i64 %47
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  %50 = load i8, ptr %49, align 8, !tbaa !34
  %51 = icmp eq i8 %50, 0
  br i1 %51, label %.lr.ph, label %._crit_edge, !llvm.loop !36

._crit_edge:                                      ; preds = %.lr.ph, %29
  %.1.lcssa = phi i32 [ %spec.select, %29 ], [ %spec.select105, %.lr.ph ]
  %.lcssa = phi ptr [ %42, %29 ], [ %48, %.lr.ph ]
  %.not102 = icmp ugt i32 %.1.lcssa, %31
  %52 = load i64, ptr %.lcssa, align 8, !tbaa !38
  %53 = getelementptr inbounds i8, ptr %22, i64 32
  %54 = load i64, ptr %53, align 8, !tbaa !39
  %. = select i1 %.not102, ptr %16, ptr %15
  %55 = load i64, ptr %., align 8, !tbaa !40
  %56 = add nsw i64 %52, %55
  %57 = add nsw i64 %56, %54
  %58 = getelementptr inbounds i8, ptr %22, i64 40
  store i64 %57, ptr %58, align 8
  %59 = getelementptr inbounds i8, ptr %26, i64 32
  %60 = load i64, ptr %59, align 8, !tbaa !41
  %.not103 = icmp eq i64 %60, -1
  %61 = add nsw i64 %57, %60
  %.sink118 = select i1 %.not103, i64 -1, i64 %61
  %62 = getelementptr inbounds i8, ptr %22, i64 48
  store i64 %.sink118, ptr %62, align 8
  store i32 4, ptr %23, align 8, !tbaa !22
  %63 = load i64, ptr %16, align 8, !tbaa !42
  %64 = load i64, ptr %17, align 8, !tbaa !43
  %65 = add nsw i64 %64, %63
  %66 = getelementptr inbounds i8, ptr %22, i64 56
  store i64 %65, ptr %66, align 8, !tbaa !44
  %67 = getelementptr inbounds i8, ptr %22, i64 64
  store i64 -1, ptr %67, align 8, !tbaa !45
  %68 = getelementptr inbounds i8, ptr %22, i64 224
  store i64 %57, ptr %68, align 8, !tbaa !46
  %69 = getelementptr inbounds i8, ptr %22, i64 16
  %70 = load i32, ptr %69, align 8, !tbaa !47
  %71 = zext i32 %70 to i64
  %72 = getelementptr inbounds i8, ptr %22, i64 232
  store i64 %71, ptr %72, align 8, !tbaa !48
  %73 = getelementptr inbounds i8, ptr %19, i64 464
  tail call void @PRIORITYQUEUE_ENQUEUE(ptr noundef nonnull %73, ptr noundef nonnull %68) #2
  br label %119

74:                                               ; preds = %25
  %75 = getelementptr inbounds i8, ptr %22, i64 32
  %76 = load i64, ptr %75, align 8, !tbaa !39
  %77 = icmp eq i64 %76, 0
  %78 = load i64, ptr %16, align 8, !tbaa !42
  %79 = load i64, ptr %17, align 8, !tbaa !43
  %80 = add nsw i64 %79, %78
  br i1 %77, label %81, label %104

81:                                               ; preds = %74
  %82 = getelementptr inbounds i8, ptr %22, i64 40
  store i64 %80, ptr %82, align 8, !tbaa !49
  %83 = getelementptr inbounds i8, ptr %26, i64 32
  %84 = load i64, ptr %83, align 8, !tbaa !41
  %.not99 = icmp eq i64 %84, -1
  %85 = add nsw i64 %84, %80
  %spec.select124 = select i1 %.not99, i64 -1, i64 %85
  %86 = getelementptr inbounds i8, ptr %22, i64 48
  store i64 %spec.select124, ptr %86, align 8
  store i32 2, ptr %23, align 8, !tbaa !22
  %87 = getelementptr inbounds i8, ptr %22, i64 20
  %88 = load i32, ptr %87, align 4, !tbaa !50
  %89 = zext i32 %88 to i64
  %90 = getelementptr inbounds i8, ptr %22, i64 144
  store i64 %89, ptr %90, align 8, !tbaa !51
  %91 = getelementptr inbounds i8, ptr %22, i64 16
  %92 = load i32, ptr %91, align 8, !tbaa !47
  %93 = zext i32 %92 to i64
  %94 = getelementptr inbounds i8, ptr %22, i64 152
  store i64 %93, ptr %94, align 8, !tbaa !52
  %95 = getelementptr inbounds i8, ptr %19, i64 432
  tail call void @PRIORITYQUEUE_ENQUEUE(ptr noundef nonnull %95, ptr noundef nonnull %90) #2
  %96 = load i64, ptr %86, align 8, !tbaa !53
  %.not100 = icmp eq i64 %96, -1
  br i1 %.not100, label %119, label %97

97:                                               ; preds = %81
  %98 = getelementptr inbounds i8, ptr %22, i64 184
  store i64 %96, ptr %98, align 8, !tbaa !54
  %99 = load i32, ptr %91, align 8, !tbaa !47
  %100 = zext i32 %99 to i64
  %101 = getelementptr inbounds i8, ptr %22, i64 192
  store i64 %100, ptr %101, align 8, !tbaa !55
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds i8, ptr %102, i64 448
  tail call void @PRIORITYQUEUE_ENQUEUE(ptr noundef nonnull %103, ptr noundef nonnull %98) #2
  br label %119

104:                                              ; preds = %74
  %105 = add nsw i64 %80, %76
  %106 = getelementptr inbounds i8, ptr %22, i64 40
  store i64 %105, ptr %106, align 8, !tbaa !49
  %107 = getelementptr inbounds i8, ptr %26, i64 32
  %108 = load i64, ptr %107, align 8, !tbaa !41
  %.not98 = icmp eq i64 %108, -1
  %109 = add nsw i64 %105, %108
  %spec.select125 = select i1 %.not98, i64 -1, i64 %109
  %110 = getelementptr inbounds i8, ptr %22, i64 48
  store i64 %spec.select125, ptr %110, align 8
  store i32 4, ptr %23, align 8, !tbaa !22
  %111 = getelementptr inbounds i8, ptr %22, i64 56
  store i64 %80, ptr %111, align 8, !tbaa !44
  %112 = getelementptr inbounds i8, ptr %22, i64 64
  store i64 -1, ptr %112, align 8, !tbaa !45
  %113 = getelementptr inbounds i8, ptr %22, i64 224
  store i64 %105, ptr %113, align 8, !tbaa !46
  %114 = getelementptr inbounds i8, ptr %22, i64 16
  %115 = load i32, ptr %114, align 8, !tbaa !47
  %116 = zext i32 %115 to i64
  %117 = getelementptr inbounds i8, ptr %22, i64 232
  store i64 %116, ptr %117, align 8, !tbaa !48
  %118 = getelementptr inbounds i8, ptr %19, i64 464
  tail call void @PRIORITYQUEUE_ENQUEUE(ptr noundef nonnull %118, ptr noundef nonnull %113) #2
  br label %119

119:                                              ; preds = %._crit_edge, %81, %97, %104, %18
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = getelementptr inbounds i8, ptr %120, i64 144
  %122 = load i32, ptr %121, align 8, !tbaa !16
  %123 = zext i32 %122 to i64
  %124 = icmp ult i64 %indvars.iv.next, %123
  br i1 %124, label %18, label %._crit_edge112, !llvm.loop !56

._crit_edge112:                                   ; preds = %119, %11
  %.lcssa106 = phi ptr [ %12, %11 ], [ %120, %119 ]
  %125 = getelementptr inbounds i8, ptr %.lcssa106, i64 160
  store ptr null, ptr %125, align 8, !tbaa !57
  tail call void @PORT_YIELD() #2
  store i32 1, ptr %0, align 4, !tbaa !20
  tail call void @EXIT_CORE() #2
  br label %126

126:                                              ; preds = %._crit_edge112, %10
  ret void
}

declare void @ENTER_CORE() local_unnamed_addr #0

declare void @PORT_YIELD() local_unnamed_addr #0

declare void @EXIT_CORE() local_unnamed_addr #0

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 = { 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 = { 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 136}
!6 = !{!"_MODULE_INFORMATION_TYPE", !7, i64 0, !10, i64 8, !11, i64 32, !11, i64 36, !11, i64 40, !12, i64 48, !11, i64 120, !7, i64 128, !7, i64 136, !13, i64 144, !14, i64 256, !14, i64 264, !14, i64 272, !15, i64 280}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_heapRECORD", !7, i64 0, !11, i64 8, !11, i64 12, !11, i64 16}
!11 = !{!"int", !8, i64 0}
!12 = !{!"_CONTEXT_TYPE", !11, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !11, i64 32, !8, i64 36, !7, i64 40, !7, i64 48, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68}
!13 = !{!"_HEALTHMONITORINGCALLBACK_INFORMATION_TYPE", !8, i64 0, !7, i64 8, !11, i64 16, !12, i64 24, !8, i64 96, !8, i64 97, !8, i64 98, !8, i64 99, !11, i64 100, !11, i64 104}
!14 = !{!"long long", !8, i64 0}
!15 = !{!"_priorityqueueRECORD", !7, i64 0, !11, i64 8, !8, i64 12, !8, i64 13}
!16 = !{!17, !11, i64 144}
!17 = !{!"_PARTITION_INFORMATION_TYPE", !8, i64 0, !7, i64 8, !7, i64 16, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !8, i64 40, !10, i64 48, !12, i64 72, !11, i64 144, !7, i64 152, !7, i64 160, !18, i64 168, !13, i64 272, !11, i64 384, !19, i64 392, !15, i64 432, !15, i64 448, !15, i64 464, !11, i64 480, !11, i64 484, !7, i64 488, !11, i64 496, !7, i64 504, !11, i64 512, !7, i64 520, !11, i64 528, !7, i64 536, !11, i64 544, !7, i64 552, !11, i64 560, !7, i64 568, !11, i64 576, !7, i64 584}
!18 = !{!"_ERRORHANDLER_INFORMATION_TYPE", !8, i64 0, !7, i64 8, !11, i64 16, !12, i64 24, !8, i64 96, !8, i64 97, !8, i64 98, !8, i64 99, !11, i64 100}
!19 = !{!"_priorityqueueENTRY", !14, i64 0, !14, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!20 = !{!11, !11, i64 0}
!21 = !{!17, !7, i64 152}
!22 = !{!23, !11, i64 24}
!23 = !{!"_PROCESS_INFORMATION_TYPE", !7, i64 0, !7, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !12, i64 72, !19, i64 144, !19, i64 184, !19, i64 224, !19, i64 264, !8, i64 304, !8, i64 305, !7, i64 312, !11, i64 320, !7, i64 328, !7, i64 336}
!24 = !{!23, !7, i64 0}
!25 = !{!26, !14, i64 24}
!26 = !{!"_PROCESS_ATTRIBUTE_TYPE", !7, i64 0, !7, i64 8, !11, i64 16, !11, i64 20, !14, i64 24, !14, i64 32, !11, i64 40}
!27 = !{!17, !11, i64 384}
!28 = !{!17, !7, i64 16}
!29 = !{!30, !7, i64 160}
!30 = !{!"_PARTITION_CONFIGURATION_TYPE", !11, i64 0, !7, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !7, i64 48, !11, i64 56, !7, i64 64, !11, i64 72, !7, i64 80, !11, i64 88, !7, i64 96, !11, i64 104, !7, i64 112, !11, i64 120, !7, i64 128, !11, i64 136, !7, i64 144, !11, i64 152, !7, i64 160, !7, i64 168, !11, i64 176, !7, i64 184, !7, i64 192}
!31 = !{!32, !11, i64 16}
!32 = !{!"_PARTITION_CONFIGURATION_SCHEDULE_TYPE", !14, i64 0, !14, i64 8, !11, i64 16, !7, i64 24}
!33 = !{!32, !7, i64 24}
!34 = !{!35, !8, i64 16}
!35 = !{!"_PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE", !14, i64 0, !14, i64 8, !8, i64 16}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = !{!35, !14, i64 0}
!39 = !{!23, !14, i64 32}
!40 = !{!14, !14, i64 0}
!41 = !{!26, !14, i64 32}
!42 = !{!6, !14, i64 256}
!43 = !{!6, !14, i64 264}
!44 = !{!23, !14, i64 56}
!45 = !{!23, !14, i64 64}
!46 = !{!23, !14, i64 224}
!47 = !{!23, !11, i64 16}
!48 = !{!23, !14, i64 232}
!49 = !{!23, !14, i64 40}
!50 = !{!23, !11, i64 20}
!51 = !{!23, !14, i64 144}
!52 = !{!23, !14, i64 152}
!53 = !{!23, !14, i64 48}
!54 = !{!23, !14, i64 184}
!55 = !{!23, !14, i64 192}
!56 = distinct !{!56, !37}
!57 = !{!17, !7, i64 160}


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