; LLVM IR from CactiLab/Sherloc-Cortex-M-CFVD :: Sherloc_runtime/freertos (tasks)

; 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.xLIST = type { i64, ptr, %struct.xMINI_LIST_ITEM }
%struct.xMINI_LIST_ITEM = type { i32, ptr, ptr }
%struct.xLIST_ITEM = type { i32, ptr, ptr, ptr, ptr }
%struct.tskTaskControlBlock = type { ptr, %struct.MPU_SETTINGS, %struct.xLIST_ITEM, %struct.xLIST_ITEM, i64, ptr, [10 x i8], i64, i64, i64, i64, [1 x i32], [1 x i8], i8, i8 }
%struct.MPU_SETTINGS = type { i32, [4 x %struct.MPURegionSettings] }
%struct.MPURegionSettings = type { i32, i32 }

@pxCurrentTCB = external dso_local global ptr, section "privileged_data", align 8
@uxSchedulerSuspended = external hidden global i64, section "privileged_data", align 8
@xTickCount = external hidden global i32, section "privileged_data", align 4
@pxDelayedTaskList = external hidden global ptr, section "privileged_data", align 8
@pxOverflowDelayedTaskList = external hidden global ptr, section "privileged_data", align 8
@pxReadyTasksLists = external hidden global [5 x %struct.xLIST], section "privileged_data", align 16
@uxTopReadyPriority = external hidden global i64, section "privileged_data", align 8
@xYieldPending = external hidden global i64, section "privileged_data", align 8
@xNextTaskUnblockTime = external hidden global i32, section "privileged_data", align 4
@xPendedTicks = external hidden global i32, section "privileged_data", align 4
@xNumOfOverflows = external hidden global i64, section "privileged_data", 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 uwtable
declare hidden void @prvResetNextTaskUnblockTime() #1 section "privileged_functions"

; Function Attrs: nounwind uwtable
define dso_local i64 @xTaskIncrementTick() #1 section "privileged_functions" {
  %1 = alloca ptr, align 8
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #2
  store i64 0, ptr %3, align 8, !tbaa !5
  %9 = load volatile i64, ptr @uxSchedulerSuspended, align 8, !tbaa !5
  %10 = icmp eq i64 %9, 0
  br i1 %10, label %11, label %238

11:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #2
  %12 = load volatile i32, ptr @xTickCount, align 4, !tbaa !9
  %13 = add i32 %12, 1
  store i32 %13, ptr %4, align 4, !tbaa !9
  %14 = load i32, ptr %4, align 4, !tbaa !9
  store volatile i32 %14, ptr @xTickCount, align 4, !tbaa !9
  %15 = load i32, ptr %4, align 4, !tbaa !9
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %17, label %33

17:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  %18 = load volatile ptr, ptr @pxDelayedTaskList, align 8, !tbaa !11
  %19 = getelementptr inbounds %struct.xLIST, ptr %18, i32 0, i32 0
  %20 = load volatile i64, ptr %19, align 8, !tbaa !13
  %21 = icmp eq i64 %20, 0
  %22 = zext i1 %21 to i64
  %23 = select i1 %21, i64 1, i64 0
  %24 = icmp eq i64 %23, 0
  br i1 %24, label %25, label %27

25:                                               ; preds = %17
  call void asm sideeffect " cpsid i ", "~{memory},~{dirflag},~{fpsr},~{flags}"() #2, !srcloc !16
  br label %26

26:                                               ; preds = %26, %25
  br label %26

27:                                               ; preds = %17
  %28 = load volatile ptr, ptr @pxDelayedTaskList, align 8, !tbaa !11
  store ptr %28, ptr %5, align 8, !tbaa !11
  %29 = load volatile ptr, ptr @pxOverflowDelayedTaskList, align 8, !tbaa !11
  store volatile ptr %29, ptr @pxDelayedTaskList, align 8, !tbaa !11
  %30 = load ptr, ptr %5, align 8, !tbaa !11
  store volatile ptr %30, ptr @pxOverflowDelayedTaskList, align 8, !tbaa !11
  %31 = load volatile i64, ptr @xNumOfOverflows, align 8, !tbaa !5
  %32 = add nsw i64 %31, 1
  store volatile i64 %32, ptr @xNumOfOverflows, align 8, !tbaa !5
  call void @prvResetNextTaskUnblockTime()
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  br label %34

33:                                               ; preds = %11
  br label %34

34:                                               ; preds = %33, %27
  %35 = load i32, ptr %4, align 4, !tbaa !9
  %36 = load volatile i32, ptr @xNextTaskUnblockTime, align 4, !tbaa !9
  %37 = icmp uge i32 %35, %36
  br i1 %37, label %38, label %222

38:                                               ; preds = %34
  br label %39

39:                                               ; preds = %220, %38
  %40 = load volatile ptr, ptr @pxDelayedTaskList, align 8, !tbaa !11
  %41 = getelementptr inbounds %struct.xLIST, ptr %40, i32 0, i32 0
  %42 = load volatile i64, ptr %41, align 8, !tbaa !13
  %43 = icmp eq i64 %42, 0
  %44 = zext i1 %43 to i64
  %45 = select i1 %43, i64 1, i64 0
  %46 = icmp ne i64 %45, 0
  br i1 %46, label %47, label %48

47:                                               ; preds = %39
  store volatile i32 -1, ptr @xNextTaskUnblockTime, align 4, !tbaa !9
  br label %221

48:                                               ; preds = %39
  %49 = load volatile ptr, ptr @pxDelayedTaskList, align 8, !tbaa !11
  %50 = getelementptr inbounds %struct.xLIST, ptr %49, i32 0, i32 2
  %51 = getelementptr inbounds %struct.xMINI_LIST_ITEM, ptr %50, i32 0, i32 1
  %52 = load ptr, ptr %51, align 8, !tbaa !17
  %53 = getelementptr inbounds %struct.xLIST_ITEM, ptr %52, i32 0, i32 3
  %54 = load ptr, ptr %53, align 8, !tbaa !18
  store ptr %54, ptr %1, align 8, !tbaa !11
  %55 = load ptr, ptr %1, align 8, !tbaa !11
  %56 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %55, i32 0, i32 2
  %57 = getelementptr inbounds %struct.xLIST_ITEM, ptr %56, i32 0, i32 0
  %58 = load i32, ptr %57, align 8, !tbaa !20
  store i32 %58, ptr %2, align 4, !tbaa !9
  %59 = load i32, ptr %4, align 4, !tbaa !9
  %60 = load i32, ptr %2, align 4, !tbaa !9
  %61 = icmp ult i32 %59, %60
  br i1 %61, label %62, label %64

62:                                               ; preds = %48
  %63 = load i32, ptr %2, align 4, !tbaa !9
  store volatile i32 %63, ptr @xNextTaskUnblockTime, align 4, !tbaa !9
  br label %221

64:                                               ; preds = %48
  br label %65

65:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2
  %66 = load ptr, ptr %1, align 8, !tbaa !11
  %67 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %66, i32 0, i32 2
  %68 = getelementptr inbounds %struct.xLIST_ITEM, ptr %67, i32 0, i32 4
  %69 = load ptr, ptr %68, align 8, !tbaa !23
  store ptr %69, ptr %6, align 8, !tbaa !11
  %70 = load ptr, ptr %1, align 8, !tbaa !11
  %71 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %70, i32 0, i32 2
  %72 = getelementptr inbounds %struct.xLIST_ITEM, ptr %71, i32 0, i32 2
  %73 = load ptr, ptr %72, align 8, !tbaa !24
  %74 = load ptr, ptr %1, align 8, !tbaa !11
  %75 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %74, i32 0, i32 2
  %76 = getelementptr inbounds %struct.xLIST_ITEM, ptr %75, i32 0, i32 1
  %77 = load ptr, ptr %76, align 8, !tbaa !25
  %78 = getelementptr inbounds %struct.xLIST_ITEM, ptr %77, i32 0, i32 2
  store ptr %73, ptr %78, align 8, !tbaa !26
  %79 = load ptr, ptr %1, align 8, !tbaa !11
  %80 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %79, i32 0, i32 2
  %81 = getelementptr inbounds %struct.xLIST_ITEM, ptr %80, i32 0, i32 1
  %82 = load ptr, ptr %81, align 8, !tbaa !25
  %83 = load ptr, ptr %1, align 8, !tbaa !11
  %84 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %83, i32 0, i32 2
  %85 = getelementptr inbounds %struct.xLIST_ITEM, ptr %84, i32 0, i32 2
  %86 = load ptr, ptr %85, align 8, !tbaa !24
  %87 = getelementptr inbounds %struct.xLIST_ITEM, ptr %86, i32 0, i32 1
  store ptr %82, ptr %87, align 8, !tbaa !27
  %88 = load ptr, ptr %6, align 8, !tbaa !11
  %89 = getelementptr inbounds %struct.xLIST, ptr %88, i32 0, i32 1
  %90 = load ptr, ptr %89, align 8, !tbaa !28
  %91 = load ptr, ptr %1, align 8, !tbaa !11
  %92 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %91, i32 0, i32 2
  %93 = icmp eq ptr %90, %92
  br i1 %93, label %94, label %101

94:                                               ; preds = %65
  %95 = load ptr, ptr %1, align 8, !tbaa !11
  %96 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %95, i32 0, i32 2
  %97 = getelementptr inbounds %struct.xLIST_ITEM, ptr %96, i32 0, i32 2
  %98 = load ptr, ptr %97, align 8, !tbaa !24
  %99 = load ptr, ptr %6, align 8, !tbaa !11
  %100 = getelementptr inbounds %struct.xLIST, ptr %99, i32 0, i32 1
  store ptr %98, ptr %100, align 8, !tbaa !28
  br label %101

101:                                              ; preds = %94, %65
  %102 = load ptr, ptr %1, align 8, !tbaa !11
  %103 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %102, i32 0, i32 2
  %104 = getelementptr inbounds %struct.xLIST_ITEM, ptr %103, i32 0, i32 4
  store ptr null, ptr %104, align 8, !tbaa !23
  %105 = load ptr, ptr %6, align 8, !tbaa !11
  %106 = getelementptr inbounds %struct.xLIST, ptr %105, i32 0, i32 0
  %107 = load volatile i64, ptr %106, align 8, !tbaa !13
  %108 = add i64 %107, -1
  store volatile i64 %108, ptr %106, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2
  %109 = load ptr, ptr %1, align 8, !tbaa !11
  %110 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %109, i32 0, i32 3
  %111 = getelementptr inbounds %struct.xLIST_ITEM, ptr %110, i32 0, i32 4
  %112 = load ptr, ptr %111, align 8, !tbaa !29
  %113 = icmp ne ptr %112, null
  br i1 %113, label %114, label %158

114:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #2
  %115 = load ptr, ptr %1, align 8, !tbaa !11
  %116 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %115, i32 0, i32 3
  %117 = getelementptr inbounds %struct.xLIST_ITEM, ptr %116, i32 0, i32 4
  %118 = load ptr, ptr %117, align 8, !tbaa !29
  store ptr %118, ptr %7, align 8, !tbaa !11
  %119 = load ptr, ptr %1, align 8, !tbaa !11
  %120 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %119, i32 0, i32 3
  %121 = getelementptr inbounds %struct.xLIST_ITEM, ptr %120, i32 0, i32 2
  %122 = load ptr, ptr %121, align 8, !tbaa !30
  %123 = load ptr, ptr %1, align 8, !tbaa !11
  %124 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %123, i32 0, i32 3
  %125 = getelementptr inbounds %struct.xLIST_ITEM, ptr %124, i32 0, i32 1
  %126 = load ptr, ptr %125, align 8, !tbaa !31
  %127 = getelementptr inbounds %struct.xLIST_ITEM, ptr %126, i32 0, i32 2
  store ptr %122, ptr %127, align 8, !tbaa !26
  %128 = load ptr, ptr %1, align 8, !tbaa !11
  %129 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %128, i32 0, i32 3
  %130 = getelementptr inbounds %struct.xLIST_ITEM, ptr %129, i32 0, i32 1
  %131 = load ptr, ptr %130, align 8, !tbaa !31
  %132 = load ptr, ptr %1, align 8, !tbaa !11
  %133 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %132, i32 0, i32 3
  %134 = getelementptr inbounds %struct.xLIST_ITEM, ptr %133, i32 0, i32 2
  %135 = load ptr, ptr %134, align 8, !tbaa !30
  %136 = getelementptr inbounds %struct.xLIST_ITEM, ptr %135, i32 0, i32 1
  store ptr %131, ptr %136, align 8, !tbaa !27
  %137 = load ptr, ptr %7, align 8, !tbaa !11
  %138 = getelementptr inbounds %struct.xLIST, ptr %137, i32 0, i32 1
  %139 = load ptr, ptr %138, align 8, !tbaa !28
  %140 = load ptr, ptr %1, align 8, !tbaa !11
  %141 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %140, i32 0, i32 3
  %142 = icmp eq ptr %139, %141
  br i1 %142, label %143, label %150

143:                                              ; preds = %114
  %144 = load ptr, ptr %1, align 8, !tbaa !11
  %145 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %144, i32 0, i32 3
  %146 = getelementptr inbounds %struct.xLIST_ITEM, ptr %145, i32 0, i32 2
  %147 = load ptr, ptr %146, align 8, !tbaa !30
  %148 = load ptr, ptr %7, align 8, !tbaa !11
  %149 = getelementptr inbounds %struct.xLIST, ptr %148, i32 0, i32 1
  store ptr %147, ptr %149, align 8, !tbaa !28
  br label %150

150:                                              ; preds = %143, %114
  %151 = load ptr, ptr %1, align 8, !tbaa !11
  %152 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %151, i32 0, i32 3
  %153 = getelementptr inbounds %struct.xLIST_ITEM, ptr %152, i32 0, i32 4
  store ptr null, ptr %153, align 8, !tbaa !29
  %154 = load ptr, ptr %7, align 8, !tbaa !11
  %155 = getelementptr inbounds %struct.xLIST, ptr %154, i32 0, i32 0
  %156 = load volatile i64, ptr %155, align 8, !tbaa !13
  %157 = add i64 %156, -1
  store volatile i64 %157, ptr %155, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #2
  br label %159

158:                                              ; preds = %101
  br label %159

159:                                              ; preds = %158, %150
  %160 = load ptr, ptr %1, align 8, !tbaa !11
  %161 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %160, i32 0, i32 4
  %162 = load i64, ptr %161, align 8, !tbaa !32
  %163 = load volatile i64, ptr @uxTopReadyPriority, align 8, !tbaa !5
  %164 = icmp ugt i64 %162, %163
  br i1 %164, label %165, label %169

165:                                              ; preds = %159
  %166 = load ptr, ptr %1, align 8, !tbaa !11
  %167 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %166, i32 0, i32 4
  %168 = load i64, ptr %167, align 8, !tbaa !32
  store volatile i64 %168, ptr @uxTopReadyPriority, align 8, !tbaa !5
  br label %169

169:                                              ; preds = %165, %159
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #2
  %170 = load ptr, ptr %1, align 8, !tbaa !11
  %171 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %170, i32 0, i32 4
  %172 = load i64, ptr %171, align 8, !tbaa !32
  %173 = getelementptr inbounds [5 x %struct.xLIST], ptr @pxReadyTasksLists, i64 0, i64 %172
  %174 = getelementptr inbounds %struct.xLIST, ptr %173, i32 0, i32 1
  %175 = load ptr, ptr %174, align 8, !tbaa !28
  store ptr %175, ptr %8, align 8, !tbaa !11
  %176 = load ptr, ptr %8, align 8, !tbaa !11
  %177 = load ptr, ptr %1, align 8, !tbaa !11
  %178 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %177, i32 0, i32 2
  %179 = getelementptr inbounds %struct.xLIST_ITEM, ptr %178, i32 0, i32 1
  store ptr %176, ptr %179, align 8, !tbaa !25
  %180 = load ptr, ptr %8, align 8, !tbaa !11
  %181 = getelementptr inbounds %struct.xLIST_ITEM, ptr %180, i32 0, i32 2
  %182 = load ptr, ptr %181, align 8, !tbaa !26
  %183 = load ptr, ptr %1, align 8, !tbaa !11
  %184 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %183, i32 0, i32 2
  %185 = getelementptr inbounds %struct.xLIST_ITEM, ptr %184, i32 0, i32 2
  store ptr %182, ptr %185, align 8, !tbaa !24
  %186 = load ptr, ptr %1, align 8, !tbaa !11
  %187 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %186, i32 0, i32 2
  %188 = load ptr, ptr %8, align 8, !tbaa !11
  %189 = getelementptr inbounds %struct.xLIST_ITEM, ptr %188, i32 0, i32 2
  %190 = load ptr, ptr %189, align 8, !tbaa !26
  %191 = getelementptr inbounds %struct.xLIST_ITEM, ptr %190, i32 0, i32 1
  store ptr %187, ptr %191, align 8, !tbaa !27
  %192 = load ptr, ptr %1, align 8, !tbaa !11
  %193 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %192, i32 0, i32 2
  %194 = load ptr, ptr %8, align 8, !tbaa !11
  %195 = getelementptr inbounds %struct.xLIST_ITEM, ptr %194, i32 0, i32 2
  store ptr %193, ptr %195, align 8, !tbaa !26
  %196 = load ptr, ptr %1, align 8, !tbaa !11
  %197 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %196, i32 0, i32 4
  %198 = load i64, ptr %197, align 8, !tbaa !32
  %199 = getelementptr inbounds [5 x %struct.xLIST], ptr @pxReadyTasksLists, i64 0, i64 %198
  %200 = load ptr, ptr %1, align 8, !tbaa !11
  %201 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %200, i32 0, i32 2
  %202 = getelementptr inbounds %struct.xLIST_ITEM, ptr %201, i32 0, i32 4
  store ptr %199, ptr %202, align 8, !tbaa !23
  %203 = load ptr, ptr %1, align 8, !tbaa !11
  %204 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %203, i32 0, i32 4
  %205 = load i64, ptr %204, align 8, !tbaa !32
  %206 = getelementptr inbounds [5 x %struct.xLIST], ptr @pxReadyTasksLists, i64 0, i64 %205
  %207 = getelementptr inbounds %struct.xLIST, ptr %206, i32 0, i32 0
  %208 = load volatile i64, ptr %207, align 8, !tbaa !13
  %209 = add i64 %208, 1
  store volatile i64 %209, ptr %207, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #2
  %210 = load ptr, ptr %1, align 8, !tbaa !11
  %211 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %210, i32 0, i32 4
  %212 = load i64, ptr %211, align 8, !tbaa !32
  %213 = load volatile ptr, ptr @pxCurrentTCB, align 8, !tbaa !11
  %214 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %213, i32 0, i32 4
  %215 = load i64, ptr %214, align 8, !tbaa !32
  %216 = icmp uge i64 %212, %215
  br i1 %216, label %217, label %218

217:                                              ; preds = %169
  store i64 1, ptr %3, align 8, !tbaa !5
  br label %219

218:                                              ; preds = %169
  br label %219

219:                                              ; preds = %218, %217
  br label %220

220:                                              ; preds = %219
  br label %39

221:                                              ; preds = %62, %47
  br label %222

222:                                              ; preds = %221, %34
  %223 = load volatile ptr, ptr @pxCurrentTCB, align 8, !tbaa !11
  %224 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %223, i32 0, i32 4
  %225 = load i64, ptr %224, align 8, !tbaa !32
  %226 = getelementptr inbounds [5 x %struct.xLIST], ptr @pxReadyTasksLists, i64 0, i64 %225
  %227 = getelementptr inbounds %struct.xLIST, ptr %226, i32 0, i32 0
  %228 = load volatile i64, ptr %227, align 8, !tbaa !13
  %229 = icmp ugt i64 %228, 1
  br i1 %229, label %230, label %231

230:                                              ; preds = %222
  store i64 1, ptr %3, align 8, !tbaa !5
  br label %232

231:                                              ; preds = %222
  br label %232

232:                                              ; preds = %231, %230
  %233 = load volatile i64, ptr @xYieldPending, align 8, !tbaa !5
  %234 = icmp ne i64 %233, 0
  br i1 %234, label %235, label %236

235:                                              ; preds = %232
  store i64 1, ptr %3, align 8, !tbaa !5
  br label %237

236:                                              ; preds = %232
  br label %237

237:                                              ; preds = %236, %235
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #2
  br label %241

238:                                              ; preds = %0
  %239 = load volatile i32, ptr @xPendedTicks, align 4, !tbaa !9
  %240 = add i32 %239, 1
  store volatile i32 %240, ptr @xPendedTicks, align 4, !tbaa !9
  br label %241

241:                                              ; preds = %238, %237
  %242 = load i64, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #2
  ret i64 %242
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 0}
!6 = !{!"long", !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, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"xLIST", !6, i64 0, !12, i64 8, !15, i64 16}
!15 = !{!"xMINI_LIST_ITEM", !10, i64 0, !12, i64 8, !12, i64 16}
!16 = !{i64 2148454177}
!17 = !{!14, !12, i64 24}
!18 = !{!19, !12, i64 24}
!19 = !{!"xLIST_ITEM", !10, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32}
!20 = !{!21, !10, i64 48}
!21 = !{!"tskTaskControlBlock", !12, i64 0, !22, i64 8, !19, i64 48, !19, i64 88, !6, i64 128, !12, i64 136, !7, i64 144, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !7, i64 192, !7, i64 196, !7, i64 197, !7, i64 198}
!22 = !{!"MPU_SETTINGS", !10, i64 0, !7, i64 4}
!23 = !{!21, !12, i64 80}
!24 = !{!21, !12, i64 64}
!25 = !{!21, !12, i64 56}
!26 = !{!19, !12, i64 16}
!27 = !{!19, !12, i64 8}
!28 = !{!14, !12, i64 8}
!29 = !{!21, !12, i64 120}
!30 = !{!21, !12, i64 104}
!31 = !{!21, !12, i64 96}
!32 = !{!21, !6, i64 128}


; 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.xLIST = type { i64, ptr, %struct.xMINI_LIST_ITEM }
%struct.xMINI_LIST_ITEM = type { i32, ptr, ptr }

@pxCurrentTCB = external dso_local global ptr, section "privileged_data", align 8
@uxSchedulerSuspended = external hidden global i64, section "privileged_data", align 8
@xTickCount = external hidden global i32, section "privileged_data", align 4
@pxDelayedTaskList = external hidden global ptr, section "privileged_data", align 8
@pxOverflowDelayedTaskList = external hidden global ptr, section "privileged_data", align 8
@pxReadyTasksLists = external hidden global [5 x %struct.xLIST], section "privileged_data", align 16
@uxTopReadyPriority = external hidden global i64, section "privileged_data", align 8
@xYieldPending = external hidden global i64, section "privileged_data", align 8
@xNextTaskUnblockTime = external hidden global i32, section "privileged_data", align 4
@xPendedTicks = external hidden global i32, section "privileged_data", align 4
@xNumOfOverflows = external hidden global i64, section "privileged_data", align 8

; Function Attrs: nounwind uwtable
declare hidden void @prvResetNextTaskUnblockTime() local_unnamed_addr #0 section "privileged_functions"

; Function Attrs: nounwind uwtable
define dso_local range(i64 0, 2) i64 @xTaskIncrementTick() local_unnamed_addr #0 section "privileged_functions" {
  %1 = load volatile i64, ptr @uxSchedulerSuspended, align 8, !tbaa !5
  %2 = icmp eq i64 %1, 0
  br i1 %2, label %3, label %92

3:                                                ; preds = %0
  %4 = load volatile i32, ptr @xTickCount, align 4, !tbaa !9
  %5 = add i32 %4, 1
  store volatile i32 %5, ptr @xTickCount, align 4, !tbaa !9
  %6 = icmp eq i32 %5, 0
  br i1 %6, label %7, label %17

7:                                                ; preds = %3
  %8 = load volatile ptr, ptr @pxDelayedTaskList, align 8, !tbaa !11
  %9 = load volatile i64, ptr %8, align 8, !tbaa !13
  %.not = icmp eq i64 %9, 0
  br i1 %.not, label %12, label %10

10:                                               ; preds = %7
  tail call void asm sideeffect " cpsid i ", "~{memory},~{dirflag},~{fpsr},~{flags}"() #1, !srcloc !16
  br label %11

11:                                               ; preds = %11, %10
  br label %11

12:                                               ; preds = %7
  %13 = load volatile ptr, ptr @pxDelayedTaskList, align 8, !tbaa !11
  %14 = load volatile ptr, ptr @pxOverflowDelayedTaskList, align 8, !tbaa !11
  store volatile ptr %14, ptr @pxDelayedTaskList, align 8, !tbaa !11
  store volatile ptr %13, ptr @pxOverflowDelayedTaskList, align 8, !tbaa !11
  %15 = load volatile i64, ptr @xNumOfOverflows, align 8, !tbaa !5
  %16 = add nsw i64 %15, 1
  store volatile i64 %16, ptr @xNumOfOverflows, align 8, !tbaa !5
  tail call void @prvResetNextTaskUnblockTime()
  br label %17

17:                                               ; preds = %3, %12
  %18 = load volatile i32, ptr @xNextTaskUnblockTime, align 4, !tbaa !9
  %.not48 = icmp ult i32 %5, %18
  br i1 %.not48, label %84, label %.preheader

.preheader:                                       ; preds = %17
  %19 = load volatile ptr, ptr @pxDelayedTaskList, align 8, !tbaa !11
  %20 = load volatile i64, ptr %19, align 8, !tbaa !13
  %21 = icmp eq i64 %20, 0
  br i1 %21, label %.sink.split, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %69
  %.054 = phi i64 [ %spec.select, %69 ], [ 0, %.preheader ]
  %22 = load volatile ptr, ptr @pxDelayedTaskList, align 8, !tbaa !11
  %23 = getelementptr inbounds i8, ptr %22, i64 24
  %24 = load ptr, ptr %23, align 8, !tbaa !17
  %25 = getelementptr inbounds i8, ptr %24, i64 24
  %26 = load ptr, ptr %25, align 8, !tbaa !18
  %27 = getelementptr inbounds i8, ptr %26, i64 48
  %28 = load i32, ptr %27, align 8, !tbaa !20
  %29 = icmp ult i32 %5, %28
  br i1 %29, label %.sink.split, label %30

30:                                               ; preds = %.lr.ph
  %31 = getelementptr inbounds i8, ptr %26, i64 80
  %32 = load ptr, ptr %31, align 8, !tbaa !23
  %33 = getelementptr inbounds i8, ptr %26, i64 64
  %34 = load ptr, ptr %33, align 8, !tbaa !24
  %35 = getelementptr inbounds i8, ptr %26, i64 56
  %36 = load ptr, ptr %35, align 8, !tbaa !25
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  store ptr %34, ptr %37, align 8, !tbaa !26
  %38 = getelementptr inbounds i8, ptr %34, i64 8
  store ptr %36, ptr %38, align 8, !tbaa !27
  %39 = getelementptr inbounds i8, ptr %32, i64 8
  %40 = load ptr, ptr %39, align 8, !tbaa !28
  %41 = icmp eq ptr %40, %27
  br i1 %41, label %42, label %43

42:                                               ; preds = %30
  store ptr %34, ptr %39, align 8, !tbaa !28
  br label %43

43:                                               ; preds = %42, %30
  %44 = load volatile i64, ptr %32, align 8, !tbaa !13
  %45 = add i64 %44, -1
  store volatile i64 %45, ptr %32, align 8, !tbaa !13
  %46 = getelementptr inbounds i8, ptr %26, i64 120
  %47 = load ptr, ptr %46, align 8, !tbaa !29
  %.not49 = icmp eq ptr %47, null
  br i1 %.not49, label %63, label %48

48:                                               ; preds = %43
  %49 = getelementptr inbounds i8, ptr %26, i64 88
  %50 = getelementptr inbounds i8, ptr %26, i64 104
  %51 = load ptr, ptr %50, align 8, !tbaa !30
  %52 = getelementptr inbounds i8, ptr %26, i64 96
  %53 = load ptr, ptr %52, align 8, !tbaa !31
  %54 = getelementptr inbounds i8, ptr %53, i64 16
  store ptr %51, ptr %54, align 8, !tbaa !26
  %55 = getelementptr inbounds i8, ptr %51, i64 8
  store ptr %53, ptr %55, align 8, !tbaa !27
  %56 = getelementptr inbounds i8, ptr %47, i64 8
  %57 = load ptr, ptr %56, align 8, !tbaa !28
  %58 = icmp eq ptr %57, %49
  br i1 %58, label %59, label %60

59:                                               ; preds = %48
  store ptr %51, ptr %56, align 8, !tbaa !28
  br label %60

60:                                               ; preds = %59, %48
  store ptr null, ptr %46, align 8, !tbaa !29
  %61 = load volatile i64, ptr %47, align 8, !tbaa !13
  %62 = add i64 %61, -1
  store volatile i64 %62, ptr %47, align 8, !tbaa !13
  br label %63

63:                                               ; preds = %43, %60
  %64 = getelementptr inbounds i8, ptr %26, i64 128
  %65 = load i64, ptr %64, align 8, !tbaa !32
  %66 = load volatile i64, ptr @uxTopReadyPriority, align 8, !tbaa !5
  %67 = icmp ugt i64 %65, %66
  br i1 %67, label %68, label %69

68:                                               ; preds = %63
  store volatile i64 %65, ptr @uxTopReadyPriority, align 8, !tbaa !5
  br label %69

69:                                               ; preds = %68, %63
  %70 = getelementptr inbounds [5 x %struct.xLIST], ptr @pxReadyTasksLists, i64 0, i64 %65, i32 1
  %71 = load ptr, ptr %70, align 8, !tbaa !28
  store ptr %71, ptr %35, align 8, !tbaa !25
  %72 = getelementptr inbounds i8, ptr %71, i64 16
  %73 = load ptr, ptr %72, align 8, !tbaa !26
  store ptr %73, ptr %33, align 8, !tbaa !24
  %74 = getelementptr inbounds i8, ptr %73, i64 8
  store ptr %27, ptr %74, align 8, !tbaa !27
  store ptr %27, ptr %72, align 8, !tbaa !26
  %75 = getelementptr inbounds [5 x %struct.xLIST], ptr @pxReadyTasksLists, i64 0, i64 %65
  store ptr %75, ptr %31, align 8, !tbaa !23
  %76 = load volatile i64, ptr %75, align 8, !tbaa !13
  %77 = add i64 %76, 1
  store volatile i64 %77, ptr %75, align 8, !tbaa !13
  %78 = load volatile ptr, ptr @pxCurrentTCB, align 8, !tbaa !11
  %79 = getelementptr inbounds i8, ptr %78, i64 128
  %80 = load i64, ptr %79, align 8, !tbaa !32
  %.not50 = icmp ult i64 %65, %80
  %spec.select = select i1 %.not50, i64 %.054, i64 1
  %81 = load volatile ptr, ptr @pxDelayedTaskList, align 8, !tbaa !11
  %82 = load volatile i64, ptr %81, align 8, !tbaa !13
  %83 = icmp eq i64 %82, 0
  br i1 %83, label %.sink.split, label %.lr.ph

.sink.split:                                      ; preds = %.lr.ph, %69, %.preheader
  %.sink = phi i32 [ -1, %.preheader ], [ -1, %69 ], [ %28, %.lr.ph ]
  %.2.ph = phi i64 [ 0, %.preheader ], [ %spec.select, %69 ], [ %.054, %.lr.ph ]
  store volatile i32 %.sink, ptr @xNextTaskUnblockTime, align 4, !tbaa !9
  br label %84

84:                                               ; preds = %.sink.split, %17
  %.2 = phi i64 [ 0, %17 ], [ %.2.ph, %.sink.split ]
  %85 = load volatile ptr, ptr @pxCurrentTCB, align 8, !tbaa !11
  %86 = getelementptr inbounds i8, ptr %85, i64 128
  %87 = load i64, ptr %86, align 8, !tbaa !32
  %88 = getelementptr inbounds [5 x %struct.xLIST], ptr @pxReadyTasksLists, i64 0, i64 %87
  %89 = load volatile i64, ptr %88, align 8, !tbaa !13
  %90 = icmp ugt i64 %89, 1
  %spec.select52 = select i1 %90, i64 1, i64 %.2
  %91 = load volatile i64, ptr @xYieldPending, align 8, !tbaa !5
  %.not51 = icmp eq i64 %91, 0
  %.4 = select i1 %.not51, i64 %spec.select52, i64 1
  br label %95

92:                                               ; preds = %0
  %93 = load volatile i32, ptr @xPendedTicks, align 4, !tbaa !9
  %94 = add i32 %93, 1
  store volatile i32 %94, ptr @xPendedTicks, align 4, !tbaa !9
  br label %95

95:                                               ; preds = %92, %84
  %.5 = phi i64 [ %.4, %84 ], [ 0, %92 ]
  ret i64 %.5
}

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = !{!"long", !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, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"xLIST", !6, i64 0, !12, i64 8, !15, i64 16}
!15 = !{!"xMINI_LIST_ITEM", !10, i64 0, !12, i64 8, !12, i64 16}
!16 = !{i64 2148454177}
!17 = !{!14, !12, i64 24}
!18 = !{!19, !12, i64 24}
!19 = !{!"xLIST_ITEM", !10, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32}
!20 = !{!21, !10, i64 48}
!21 = !{!"tskTaskControlBlock", !12, i64 0, !22, i64 8, !19, i64 48, !19, i64 88, !6, i64 128, !12, i64 136, !7, i64 144, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !7, i64 192, !7, i64 196, !7, i64 197, !7, i64 198}
!22 = !{!"MPU_SETTINGS", !10, i64 0, !7, i64 4}
!23 = !{!21, !12, i64 80}
!24 = !{!21, !12, i64 64}
!25 = !{!21, !12, i64 56}
!26 = !{!19, !12, i64 16}
!27 = !{!19, !12, i64 8}
!28 = !{!14, !12, i64 8}
!29 = !{!21, !12, i64 120}
!30 = !{!21, !12, i64 104}
!31 = !{!21, !12, i64 96}
!32 = !{!21, !6, i64 128}


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