; 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.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 }
%struct.xLIST_ITEM = type { i32, ptr, ptr, 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
@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
@xPendingReadyList = external hidden global %struct.xLIST, 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

declare i32 @ulSetInterruptMask() #1

declare void @vClearInterruptMask(i32 noundef) #1

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

22:                                               ; preds = %6
  call void asm sideeffect " cpsid i ", "~{memory},~{dirflag},~{fpsr},~{flags}"() #3, !srcloc !13
  br label %23

23:                                               ; preds = %23, %22
  br label %23

24:                                               ; preds = %6
  %25 = load i64, ptr %8, align 8, !tbaa !9
  %26 = icmp ult i64 %25, 1
  %27 = zext i1 %26 to i32
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %29, label %31

29:                                               ; preds = %24
  call void asm sideeffect " cpsid i ", "~{memory},~{dirflag},~{fpsr},~{flags}"() #3, !srcloc !14
  br label %30

30:                                               ; preds = %30, %29
  br label %30

31:                                               ; preds = %24
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %32, ptr %13, align 8, !tbaa !5
  %33 = call i32 @ulSetInterruptMask()
  %34 = zext i32 %33 to i64
  store i64 %34, ptr %16, align 8, !tbaa !9
  %35 = load ptr, ptr %11, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %44

37:                                               ; preds = %31
  %38 = load ptr, ptr %13, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %38, i32 0, i32 11
  %40 = load i64, ptr %8, align 8, !tbaa !9
  %41 = getelementptr inbounds [1 x i32], ptr %39, i64 0, i64 %40
  %42 = load volatile i32, ptr %41, align 4, !tbaa !11
  %43 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 %42, ptr %43, align 4, !tbaa !11
  br label %44

44:                                               ; preds = %37, %31
  %45 = load ptr, ptr %13, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %45, i32 0, i32 12
  %47 = load i64, ptr %8, align 8, !tbaa !9
  %48 = getelementptr inbounds [1 x i8], ptr %46, i64 0, i64 %47
  %49 = load volatile i8, ptr %48, align 1, !tbaa !15
  store i8 %49, ptr %14, align 1, !tbaa !15
  %50 = load ptr, ptr %13, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %50, i32 0, i32 12
  %52 = load i64, ptr %8, align 8, !tbaa !9
  %53 = getelementptr inbounds [1 x i8], ptr %51, i64 0, i64 %52
  store volatile i8 2, ptr %53, align 1, !tbaa !15
  %54 = load i32, ptr %10, align 4, !tbaa !11
  switch i32 %54, label %88 [
    i32 1, label %55
    i32 2, label %63
    i32 3, label %70
    i32 4, label %76
    i32 0, label %96
  ]

55:                                               ; preds = %44
  %56 = load i32, ptr %9, align 4, !tbaa !11
  %57 = load ptr, ptr %13, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %57, i32 0, i32 11
  %59 = load i64, ptr %8, align 8, !tbaa !9
  %60 = getelementptr inbounds [1 x i32], ptr %58, i64 0, i64 %59
  %61 = load volatile i32, ptr %60, align 4, !tbaa !11
  %62 = or i32 %61, %56
  store volatile i32 %62, ptr %60, align 4, !tbaa !11
  br label %96

63:                                               ; preds = %44
  %64 = load ptr, ptr %13, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %64, i32 0, i32 11
  %66 = load i64, ptr %8, align 8, !tbaa !9
  %67 = getelementptr inbounds [1 x i32], ptr %65, i64 0, i64 %66
  %68 = load volatile i32, ptr %67, align 4, !tbaa !11
  %69 = add i32 %68, 1
  store volatile i32 %69, ptr %67, align 4, !tbaa !11
  br label %96

70:                                               ; preds = %44
  %71 = load i32, ptr %9, align 4, !tbaa !11
  %72 = load ptr, ptr %13, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %72, i32 0, i32 11
  %74 = load i64, ptr %8, align 8, !tbaa !9
  %75 = getelementptr inbounds [1 x i32], ptr %73, i64 0, i64 %74
  store volatile i32 %71, ptr %75, align 4, !tbaa !11
  br label %96

76:                                               ; preds = %44
  %77 = load i8, ptr %14, align 1, !tbaa !15
  %78 = zext i8 %77 to i32
  %79 = icmp ne i32 %78, 2
  br i1 %79, label %80, label %86

80:                                               ; preds = %76
  %81 = load i32, ptr %9, align 4, !tbaa !11
  %82 = load ptr, ptr %13, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %82, i32 0, i32 11
  %84 = load i64, ptr %8, align 8, !tbaa !9
  %85 = getelementptr inbounds [1 x i32], ptr %83, i64 0, i64 %84
  store volatile i32 %81, ptr %85, align 4, !tbaa !11
  br label %87

86:                                               ; preds = %76
  store i64 0, ptr %15, align 8, !tbaa !9
  br label %87

87:                                               ; preds = %86, %80
  br label %96

88:                                               ; preds = %44
  %89 = load volatile i32, ptr @xTickCount, align 4, !tbaa !11
  %90 = icmp eq i32 %89, 0
  %91 = zext i1 %90 to i32
  %92 = icmp eq i32 %91, 0
  br i1 %92, label %93, label %95

93:                                               ; preds = %88
  call void asm sideeffect " cpsid i ", "~{memory},~{dirflag},~{fpsr},~{flags}"() #3, !srcloc !16
  br label %94

94:                                               ; preds = %94, %93
  br label %94

95:                                               ; preds = %88
  br label %96

96:                                               ; preds = %95, %87, %70, %63, %55, %44
  %97 = load i8, ptr %14, align 1, !tbaa !15
  %98 = zext i8 %97 to i32
  %99 = icmp eq i32 %98, 1
  br i1 %99, label %100, label %250

100:                                              ; preds = %96
  %101 = load ptr, ptr %13, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %101, i32 0, i32 3
  %103 = getelementptr inbounds %struct.xLIST_ITEM, ptr %102, i32 0, i32 4
  %104 = load ptr, ptr %103, align 8, !tbaa !17
  %105 = icmp eq ptr %104, null
  %106 = zext i1 %105 to i32
  %107 = icmp eq i32 %106, 0
  br i1 %107, label %108, label %110

108:                                              ; preds = %100
  call void asm sideeffect " cpsid i ", "~{memory},~{dirflag},~{fpsr},~{flags}"() #3, !srcloc !21
  br label %109

109:                                              ; preds = %109, %108
  br label %109

110:                                              ; preds = %100
  %111 = load volatile i64, ptr @uxSchedulerSuspended, align 8, !tbaa !9
  %112 = icmp eq i64 %111, 0
  br i1 %112, label %113, label %207

113:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %114 = load ptr, ptr %13, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %114, i32 0, i32 2
  %116 = getelementptr inbounds %struct.xLIST_ITEM, ptr %115, i32 0, i32 4
  %117 = load ptr, ptr %116, align 8, !tbaa !22
  store ptr %117, ptr %17, align 8, !tbaa !5
  %118 = load ptr, ptr %13, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %118, i32 0, i32 2
  %120 = getelementptr inbounds %struct.xLIST_ITEM, ptr %119, i32 0, i32 2
  %121 = load ptr, ptr %120, align 8, !tbaa !23
  %122 = load ptr, ptr %13, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %122, i32 0, i32 2
  %124 = getelementptr inbounds %struct.xLIST_ITEM, ptr %123, i32 0, i32 1
  %125 = load ptr, ptr %124, align 8, !tbaa !24
  %126 = getelementptr inbounds %struct.xLIST_ITEM, ptr %125, i32 0, i32 2
  store ptr %121, ptr %126, align 8, !tbaa !25
  %127 = load ptr, ptr %13, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %127, i32 0, i32 2
  %129 = getelementptr inbounds %struct.xLIST_ITEM, ptr %128, i32 0, i32 1
  %130 = load ptr, ptr %129, align 8, !tbaa !24
  %131 = load ptr, ptr %13, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %131, i32 0, i32 2
  %133 = getelementptr inbounds %struct.xLIST_ITEM, ptr %132, i32 0, i32 2
  %134 = load ptr, ptr %133, align 8, !tbaa !23
  %135 = getelementptr inbounds %struct.xLIST_ITEM, ptr %134, i32 0, i32 1
  store ptr %130, ptr %135, align 8, !tbaa !26
  %136 = load ptr, ptr %17, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.xLIST, ptr %136, i32 0, i32 1
  %138 = load ptr, ptr %137, align 8, !tbaa !27
  %139 = load ptr, ptr %13, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %139, i32 0, i32 2
  %141 = icmp eq ptr %138, %140
  br i1 %141, label %142, label %149

142:                                              ; preds = %113
  %143 = load ptr, ptr %13, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %143, i32 0, i32 2
  %145 = getelementptr inbounds %struct.xLIST_ITEM, ptr %144, i32 0, i32 2
  %146 = load ptr, ptr %145, align 8, !tbaa !23
  %147 = load ptr, ptr %17, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.xLIST, ptr %147, i32 0, i32 1
  store ptr %146, ptr %148, align 8, !tbaa !27
  br label %149

149:                                              ; preds = %142, %113
  %150 = load ptr, ptr %13, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %150, i32 0, i32 2
  %152 = getelementptr inbounds %struct.xLIST_ITEM, ptr %151, i32 0, i32 4
  store ptr null, ptr %152, align 8, !tbaa !22
  %153 = load ptr, ptr %17, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.xLIST, ptr %153, i32 0, i32 0
  %155 = load volatile i64, ptr %154, align 8, !tbaa !30
  %156 = add i64 %155, -1
  store volatile i64 %156, ptr %154, align 8, !tbaa !30
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  %157 = load ptr, ptr %13, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %157, i32 0, i32 4
  %159 = load i64, ptr %158, align 8, !tbaa !31
  %160 = load volatile i64, ptr @uxTopReadyPriority, align 8, !tbaa !9
  %161 = icmp ugt i64 %159, %160
  br i1 %161, label %162, label %166

162:                                              ; preds = %149
  %163 = load ptr, ptr %13, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %163, i32 0, i32 4
  %165 = load i64, ptr %164, align 8, !tbaa !31
  store volatile i64 %165, ptr @uxTopReadyPriority, align 8, !tbaa !9
  br label %166

166:                                              ; preds = %162, %149
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %167 = load ptr, ptr %13, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %167, i32 0, i32 4
  %169 = load i64, ptr %168, align 8, !tbaa !31
  %170 = getelementptr inbounds [5 x %struct.xLIST], ptr @pxReadyTasksLists, i64 0, i64 %169
  %171 = getelementptr inbounds %struct.xLIST, ptr %170, i32 0, i32 1
  %172 = load ptr, ptr %171, align 8, !tbaa !27
  store ptr %172, ptr %18, align 8, !tbaa !5
  %173 = load ptr, ptr %18, align 8, !tbaa !5
  %174 = load ptr, ptr %13, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %174, i32 0, i32 2
  %176 = getelementptr inbounds %struct.xLIST_ITEM, ptr %175, i32 0, i32 1
  store ptr %173, ptr %176, align 8, !tbaa !24
  %177 = load ptr, ptr %18, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.xLIST_ITEM, ptr %177, i32 0, i32 2
  %179 = load ptr, ptr %178, align 8, !tbaa !25
  %180 = load ptr, ptr %13, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %180, i32 0, i32 2
  %182 = getelementptr inbounds %struct.xLIST_ITEM, ptr %181, i32 0, i32 2
  store ptr %179, ptr %182, align 8, !tbaa !23
  %183 = load ptr, ptr %13, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %183, i32 0, i32 2
  %185 = load ptr, ptr %18, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.xLIST_ITEM, ptr %185, i32 0, i32 2
  %187 = load ptr, ptr %186, align 8, !tbaa !25
  %188 = getelementptr inbounds %struct.xLIST_ITEM, ptr %187, i32 0, i32 1
  store ptr %184, ptr %188, align 8, !tbaa !26
  %189 = load ptr, ptr %13, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %189, i32 0, i32 2
  %191 = load ptr, ptr %18, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.xLIST_ITEM, ptr %191, i32 0, i32 2
  store ptr %190, ptr %192, align 8, !tbaa !25
  %193 = load ptr, ptr %13, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %193, i32 0, i32 4
  %195 = load i64, ptr %194, align 8, !tbaa !31
  %196 = getelementptr inbounds [5 x %struct.xLIST], ptr @pxReadyTasksLists, i64 0, i64 %195
  %197 = load ptr, ptr %13, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %197, i32 0, i32 2
  %199 = getelementptr inbounds %struct.xLIST_ITEM, ptr %198, i32 0, i32 4
  store ptr %196, ptr %199, align 8, !tbaa !22
  %200 = load ptr, ptr %13, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %200, i32 0, i32 4
  %202 = load i64, ptr %201, align 8, !tbaa !31
  %203 = getelementptr inbounds [5 x %struct.xLIST], ptr @pxReadyTasksLists, i64 0, i64 %202
  %204 = getelementptr inbounds %struct.xLIST, ptr %203, i32 0, i32 0
  %205 = load volatile i64, ptr %204, align 8, !tbaa !30
  %206 = add i64 %205, 1
  store volatile i64 %206, ptr %204, align 8, !tbaa !30
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  br label %234

207:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %208 = load ptr, ptr getelementptr inbounds (%struct.xLIST, ptr @xPendingReadyList, i32 0, i32 1), align 8, !tbaa !27
  store ptr %208, ptr %19, align 8, !tbaa !5
  %209 = load ptr, ptr %19, align 8, !tbaa !5
  %210 = load ptr, ptr %13, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %210, i32 0, i32 3
  %212 = getelementptr inbounds %struct.xLIST_ITEM, ptr %211, i32 0, i32 1
  store ptr %209, ptr %212, align 8, !tbaa !32
  %213 = load ptr, ptr %19, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.xLIST_ITEM, ptr %213, i32 0, i32 2
  %215 = load ptr, ptr %214, align 8, !tbaa !25
  %216 = load ptr, ptr %13, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %216, i32 0, i32 3
  %218 = getelementptr inbounds %struct.xLIST_ITEM, ptr %217, i32 0, i32 2
  store ptr %215, ptr %218, align 8, !tbaa !33
  %219 = load ptr, ptr %13, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %219, i32 0, i32 3
  %221 = load ptr, ptr %19, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.xLIST_ITEM, ptr %221, i32 0, i32 2
  %223 = load ptr, ptr %222, align 8, !tbaa !25
  %224 = getelementptr inbounds %struct.xLIST_ITEM, ptr %223, i32 0, i32 1
  store ptr %220, ptr %224, align 8, !tbaa !26
  %225 = load ptr, ptr %13, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %225, i32 0, i32 3
  %227 = load ptr, ptr %19, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.xLIST_ITEM, ptr %227, i32 0, i32 2
  store ptr %226, ptr %228, align 8, !tbaa !25
  %229 = load ptr, ptr %13, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %229, i32 0, i32 3
  %231 = getelementptr inbounds %struct.xLIST_ITEM, ptr %230, i32 0, i32 4
  store ptr @xPendingReadyList, ptr %231, align 8, !tbaa !17
  %232 = load volatile i64, ptr @xPendingReadyList, align 8, !tbaa !30
  %233 = add i64 %232, 1
  store volatile i64 %233, ptr @xPendingReadyList, align 8, !tbaa !30
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  br label %234

234:                                              ; preds = %207, %166
  %235 = load ptr, ptr %13, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %235, i32 0, i32 4
  %237 = load i64, ptr %236, align 8, !tbaa !31
  %238 = load volatile ptr, ptr @pxCurrentTCB, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %238, i32 0, i32 4
  %240 = load i64, ptr %239, align 8, !tbaa !31
  %241 = icmp ugt i64 %237, %240
  br i1 %241, label %242, label %248

242:                                              ; preds = %234
  %243 = load ptr, ptr %12, align 8, !tbaa !5
  %244 = icmp ne ptr %243, null
  br i1 %244, label %245, label %247

245:                                              ; preds = %242
  %246 = load ptr, ptr %12, align 8, !tbaa !5
  store i64 1, ptr %246, align 8, !tbaa !9
  br label %247

247:                                              ; preds = %245, %242
  store volatile i64 1, ptr @xYieldPending, align 8, !tbaa !9
  br label %249

248:                                              ; preds = %234
  br label %249

249:                                              ; preds = %248, %247
  br label %250

250:                                              ; preds = %249, %96
  %251 = load i64, ptr %16, align 8, !tbaa !9
  %252 = trunc i64 %251 to i32
  call void @vClearInterruptMask(i32 noundef %252)
  %253 = load i64, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  ret i64 %253
}

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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i64 2148502367}
!14 = !{i64 2148502516}
!15 = !{!7, !7, i64 0}
!16 = !{i64 2148502775}
!17 = !{!18, !6, i64 120}
!18 = !{!"tskTaskControlBlock", !6, i64 0, !19, i64 8, !20, i64 48, !20, i64 88, !10, i64 128, !6, i64 136, !7, i64 144, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !7, i64 192, !7, i64 196, !7, i64 197, !7, i64 198}
!19 = !{!"MPU_SETTINGS", !12, i64 0, !7, i64 4}
!20 = !{!"xLIST_ITEM", !12, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!21 = !{i64 2148503065}
!22 = !{!18, !6, i64 80}
!23 = !{!18, !6, i64 64}
!24 = !{!18, !6, i64 56}
!25 = !{!20, !6, i64 16}
!26 = !{!20, !6, i64 8}
!27 = !{!28, !6, i64 8}
!28 = !{!"xLIST", !10, i64 0, !6, i64 8, !29, i64 16}
!29 = !{!"xMINI_LIST_ITEM", !12, i64 0, !6, i64 8, !6, i64 16}
!30 = !{!28, !10, i64 0}
!31 = !{!18, !10, i64 128}
!32 = !{!18, !6, i64 96}
!33 = !{!18, !6, i64 104}


; 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
@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
@xPendingReadyList = external hidden global %struct.xLIST, section "privileged_data", align 8

declare i32 @ulSetInterruptMask() local_unnamed_addr #0

declare void @vClearInterruptMask(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i64 0, 2) i64 @xTaskGenericNotifyFromISR(ptr noundef %0, i64 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef writeonly %4, ptr noundef writeonly %5) local_unnamed_addr #1 section "privileged_functions" {
  %7 = icmp eq ptr %0, null
  br i1 %7, label %8, label %10

8:                                                ; preds = %6
  tail call void asm sideeffect " cpsid i ", "~{memory},~{dirflag},~{fpsr},~{flags}"() #2, !srcloc !5
  br label %9

9:                                                ; preds = %9, %8
  br label %9

10:                                               ; preds = %6
  %.not = icmp eq i64 %1, 0
  br i1 %.not, label %13, label %11

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

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

13:                                               ; preds = %10
  %14 = tail call i32 @ulSetInterruptMask() #2
  %.not67 = icmp eq ptr %4, null
  br i1 %.not67, label %18, label %15

15:                                               ; preds = %13
  %16 = getelementptr inbounds i8, ptr %0, i64 192
  %17 = load volatile i32, ptr %16, align 4, !tbaa !7
  store i32 %17, ptr %4, align 4, !tbaa !7
  br label %18

18:                                               ; preds = %15, %13
  %19 = getelementptr inbounds i8, ptr %0, i64 196
  %20 = load volatile i8, ptr %19, align 1, !tbaa !11
  store volatile i8 2, ptr %19, align 1, !tbaa !11
  switch i32 %3, label %34 [
    i32 1, label %21
    i32 2, label %25
    i32 3, label %29
    i32 4, label %31
    i32 0, label %38
  ]

21:                                               ; preds = %18
  %22 = getelementptr inbounds i8, ptr %0, i64 192
  %23 = load volatile i32, ptr %22, align 4, !tbaa !7
  %24 = or i32 %23, %2
  store volatile i32 %24, ptr %22, align 4, !tbaa !7
  br label %38

25:                                               ; preds = %18
  %26 = getelementptr inbounds i8, ptr %0, i64 192
  %27 = load volatile i32, ptr %26, align 4, !tbaa !7
  %28 = add i32 %27, 1
  store volatile i32 %28, ptr %26, align 4, !tbaa !7
  br label %38

29:                                               ; preds = %18
  %30 = getelementptr inbounds i8, ptr %0, i64 192
  store volatile i32 %2, ptr %30, align 4, !tbaa !7
  br label %38

31:                                               ; preds = %18
  %.not68 = icmp eq i8 %20, 2
  br i1 %.not68, label %.thread, label %32

32:                                               ; preds = %31
  %33 = getelementptr inbounds i8, ptr %0, i64 192
  store volatile i32 %2, ptr %33, align 4, !tbaa !7
  br label %38

34:                                               ; preds = %18
  %35 = load volatile i32, ptr @xTickCount, align 4, !tbaa !7
  %.not69 = icmp eq i32 %35, 0
  br i1 %.not69, label %38, label %36

36:                                               ; preds = %34
  tail call void asm sideeffect " cpsid i ", "~{memory},~{dirflag},~{fpsr},~{flags}"() #2, !srcloc !12
  br label %37

37:                                               ; preds = %37, %36
  br label %37

38:                                               ; preds = %34, %32, %29, %25, %21, %18
  %39 = icmp eq i8 %20, 1
  br i1 %39, label %40, label %.thread

40:                                               ; preds = %38
  %41 = getelementptr inbounds i8, ptr %0, i64 88
  %42 = getelementptr inbounds i8, ptr %0, i64 120
  %43 = load ptr, ptr %42, align 8, !tbaa !13
  %.not70 = icmp eq ptr %43, null
  br i1 %.not70, label %46, label %44

44:                                               ; preds = %40
  tail call void asm sideeffect " cpsid i ", "~{memory},~{dirflag},~{fpsr},~{flags}"() #2, !srcloc !19
  br label %45

45:                                               ; preds = %45, %44
  br label %45

46:                                               ; preds = %40
  %47 = load volatile i64, ptr @uxSchedulerSuspended, align 8, !tbaa !20
  %48 = icmp eq i64 %47, 0
  br i1 %48, label %49, label %80

49:                                               ; preds = %46
  %50 = getelementptr inbounds i8, ptr %0, i64 48
  %51 = getelementptr inbounds i8, ptr %0, i64 80
  %52 = load ptr, ptr %51, align 8, !tbaa !21
  %53 = getelementptr inbounds i8, ptr %0, i64 64
  %54 = load ptr, ptr %53, align 8, !tbaa !22
  %55 = getelementptr inbounds i8, ptr %0, i64 56
  %56 = load ptr, ptr %55, align 8, !tbaa !23
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  store ptr %54, ptr %57, align 8, !tbaa !24
  %58 = getelementptr inbounds i8, ptr %54, i64 8
  store ptr %56, ptr %58, align 8, !tbaa !25
  %59 = getelementptr inbounds i8, ptr %52, i64 8
  %60 = load ptr, ptr %59, align 8, !tbaa !26
  %61 = icmp eq ptr %60, %50
  br i1 %61, label %62, label %63

62:                                               ; preds = %49
  store ptr %54, ptr %59, align 8, !tbaa !26
  br label %63

63:                                               ; preds = %62, %49
  %64 = load volatile i64, ptr %52, align 8, !tbaa !29
  %65 = add i64 %64, -1
  store volatile i64 %65, ptr %52, align 8, !tbaa !29
  %66 = getelementptr inbounds i8, ptr %0, i64 128
  %67 = load i64, ptr %66, align 8, !tbaa !30
  %68 = load volatile i64, ptr @uxTopReadyPriority, align 8, !tbaa !20
  %69 = icmp ugt i64 %67, %68
  br i1 %69, label %70, label %71

70:                                               ; preds = %63
  store volatile i64 %67, ptr @uxTopReadyPriority, align 8, !tbaa !20
  br label %71

71:                                               ; preds = %70, %63
  %72 = getelementptr inbounds [5 x %struct.xLIST], ptr @pxReadyTasksLists, i64 0, i64 %67, i32 1
  %73 = load ptr, ptr %72, align 8, !tbaa !26
  store ptr %73, ptr %55, align 8, !tbaa !23
  %74 = getelementptr inbounds i8, ptr %73, i64 16
  %75 = load ptr, ptr %74, align 8, !tbaa !24
  store ptr %75, ptr %53, align 8, !tbaa !22
  %76 = getelementptr inbounds i8, ptr %75, i64 8
  store ptr %50, ptr %76, align 8, !tbaa !25
  store ptr %50, ptr %74, align 8, !tbaa !24
  %77 = getelementptr inbounds [5 x %struct.xLIST], ptr @pxReadyTasksLists, i64 0, i64 %67
  store ptr %77, ptr %51, align 8, !tbaa !21
  %78 = load volatile i64, ptr %77, align 8, !tbaa !29
  %79 = add i64 %78, 1
  store volatile i64 %79, ptr %77, align 8, !tbaa !29
  br label %89

80:                                               ; preds = %46
  %81 = load ptr, ptr getelementptr inbounds (i8, ptr @xPendingReadyList, i64 8), align 8, !tbaa !26
  %82 = getelementptr inbounds i8, ptr %0, i64 96
  store ptr %81, ptr %82, align 8, !tbaa !31
  %83 = getelementptr inbounds i8, ptr %81, i64 16
  %84 = load ptr, ptr %83, align 8, !tbaa !24
  %85 = getelementptr inbounds i8, ptr %0, i64 104
  store ptr %84, ptr %85, align 8, !tbaa !32
  %86 = getelementptr inbounds i8, ptr %84, i64 8
  store ptr %41, ptr %86, align 8, !tbaa !25
  store ptr %41, ptr %83, align 8, !tbaa !24
  store ptr @xPendingReadyList, ptr %42, align 8, !tbaa !13
  %87 = load volatile i64, ptr @xPendingReadyList, align 8, !tbaa !29
  %88 = add i64 %87, 1
  store volatile i64 %88, ptr @xPendingReadyList, align 8, !tbaa !29
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 128
  %.pre = load i64, ptr %.phi.trans.insert, align 8, !tbaa !30
  br label %89

89:                                               ; preds = %80, %71
  %90 = phi i64 [ %.pre, %80 ], [ %67, %71 ]
  %91 = load volatile ptr, ptr @pxCurrentTCB, align 8, !tbaa !33
  %92 = getelementptr inbounds i8, ptr %91, i64 128
  %93 = load i64, ptr %92, align 8, !tbaa !30
  %94 = icmp ugt i64 %90, %93
  br i1 %94, label %95, label %.thread

95:                                               ; preds = %89
  %.not71 = icmp eq ptr %5, null
  br i1 %.not71, label %97, label %96

96:                                               ; preds = %95
  store i64 1, ptr %5, align 8, !tbaa !20
  br label %97

97:                                               ; preds = %96, %95
  store volatile i64 1, ptr @xYieldPending, align 8, !tbaa !20
  br label %.thread

.thread:                                          ; preds = %31, %97, %89, %38
  %.073 = phi i64 [ 1, %97 ], [ 1, %89 ], [ 1, %38 ], [ 0, %31 ]
  tail call void @vClearInterruptMask(i32 noundef %14) #2
  ret i64 %.073
}

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 = !{i64 2148502367}
!6 = !{i64 2148502516}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!9, !9, i64 0}
!12 = !{i64 2148502775}
!13 = !{!14, !15, i64 120}
!14 = !{!"tskTaskControlBlock", !15, i64 0, !16, i64 8, !17, i64 48, !17, i64 88, !18, i64 128, !15, i64 136, !9, i64 144, !18, i64 160, !18, i64 168, !18, i64 176, !18, i64 184, !9, i64 192, !9, i64 196, !9, i64 197, !9, i64 198}
!15 = !{!"any pointer", !9, i64 0}
!16 = !{!"MPU_SETTINGS", !8, i64 0, !9, i64 4}
!17 = !{!"xLIST_ITEM", !8, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !15, i64 32}
!18 = !{!"long", !9, i64 0}
!19 = !{i64 2148503065}
!20 = !{!18, !18, i64 0}
!21 = !{!14, !15, i64 80}
!22 = !{!14, !15, i64 64}
!23 = !{!14, !15, i64 56}
!24 = !{!17, !15, i64 16}
!25 = !{!17, !15, i64 8}
!26 = !{!27, !15, i64 8}
!27 = !{!"xLIST", !18, i64 0, !15, i64 8, !28, i64 16}
!28 = !{!"xMINI_LIST_ITEM", !8, i64 0, !15, i64 8, !15, i64 16}
!29 = !{!27, !18, i64 0}
!30 = !{!14, !18, i64 128}
!31 = !{!14, !15, i64 96}
!32 = !{!14, !15, i64 104}
!33 = !{!15, !15, i64 0}


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