; 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
@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

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

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

18:                                               ; preds = %18, %17
  br label %18

19:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %20, i32 0, i32 3
  %22 = getelementptr inbounds %struct.xLIST_ITEM, ptr %21, i32 0, i32 4
  %23 = load ptr, ptr %22, align 8, !tbaa !17
  store ptr %23, ptr %5, align 8, !tbaa !5
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %24, i32 0, i32 3
  %26 = getelementptr inbounds %struct.xLIST_ITEM, ptr %25, i32 0, i32 2
  %27 = load ptr, ptr %26, align 8, !tbaa !20
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %28, i32 0, i32 3
  %30 = getelementptr inbounds %struct.xLIST_ITEM, ptr %29, i32 0, i32 1
  %31 = load ptr, ptr %30, align 8, !tbaa !21
  %32 = getelementptr inbounds %struct.xLIST_ITEM, ptr %31, i32 0, i32 2
  store ptr %27, ptr %32, align 8, !tbaa !22
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %33, i32 0, i32 3
  %35 = getelementptr inbounds %struct.xLIST_ITEM, ptr %34, i32 0, i32 1
  %36 = load ptr, ptr %35, align 8, !tbaa !21
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %37, i32 0, i32 3
  %39 = getelementptr inbounds %struct.xLIST_ITEM, ptr %38, i32 0, i32 2
  %40 = load ptr, ptr %39, align 8, !tbaa !20
  %41 = getelementptr inbounds %struct.xLIST_ITEM, ptr %40, i32 0, i32 1
  store ptr %36, ptr %41, align 8, !tbaa !23
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.xLIST, ptr %42, i32 0, i32 1
  %44 = load ptr, ptr %43, align 8, !tbaa !24
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %45, i32 0, i32 3
  %47 = icmp eq ptr %44, %46
  br i1 %47, label %48, label %55

48:                                               ; preds = %19
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %49, i32 0, i32 3
  %51 = getelementptr inbounds %struct.xLIST_ITEM, ptr %50, i32 0, i32 2
  %52 = load ptr, ptr %51, align 8, !tbaa !20
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.xLIST, ptr %53, i32 0, i32 1
  store ptr %52, ptr %54, align 8, !tbaa !24
  br label %55

55:                                               ; preds = %48, %19
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %56, i32 0, i32 3
  %58 = getelementptr inbounds %struct.xLIST_ITEM, ptr %57, i32 0, i32 4
  store ptr null, ptr %58, align 8, !tbaa !17
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.xLIST, ptr %59, i32 0, i32 0
  %61 = load volatile i64, ptr %60, align 8, !tbaa !25
  %62 = add i64 %61, -1
  store volatile i64 %62, ptr %60, align 8, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  %63 = load volatile i64, ptr @uxSchedulerSuspended, align 8, !tbaa !26
  %64 = icmp eq i64 %63, 0
  br i1 %64, label %65, label %159

65:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %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 !27
  store ptr %69, ptr %6, align 8, !tbaa !5
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %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 !28
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %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 !29
  %78 = getelementptr inbounds %struct.xLIST_ITEM, ptr %77, i32 0, i32 2
  store ptr %73, ptr %78, align 8, !tbaa !22
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %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 !29
  %83 = load ptr, ptr %3, align 8, !tbaa !5
  %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 !28
  %87 = getelementptr inbounds %struct.xLIST_ITEM, ptr %86, i32 0, i32 1
  store ptr %82, ptr %87, align 8, !tbaa !23
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.xLIST, ptr %88, i32 0, i32 1
  %90 = load ptr, ptr %89, align 8, !tbaa !24
  %91 = load ptr, ptr %3, align 8, !tbaa !5
  %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 %3, align 8, !tbaa !5
  %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 !28
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.xLIST, ptr %99, i32 0, i32 1
  store ptr %98, ptr %100, align 8, !tbaa !24
  br label %101

101:                                              ; preds = %94, %65
  %102 = load ptr, ptr %3, align 8, !tbaa !5
  %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 !27
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.xLIST, ptr %105, i32 0, i32 0
  %107 = load volatile i64, ptr %106, align 8, !tbaa !25
  %108 = add i64 %107, -1
  store volatile i64 %108, ptr %106, align 8, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %109, i32 0, i32 4
  %111 = load i64, ptr %110, align 8, !tbaa !30
  %112 = load volatile i64, ptr @uxTopReadyPriority, align 8, !tbaa !26
  %113 = icmp ugt i64 %111, %112
  br i1 %113, label %114, label %118

114:                                              ; preds = %101
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %115, i32 0, i32 4
  %117 = load i64, ptr %116, align 8, !tbaa !30
  store volatile i64 %117, ptr @uxTopReadyPriority, align 8, !tbaa !26
  br label %118

118:                                              ; preds = %114, %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #2
  %119 = load ptr, ptr %3, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %119, i32 0, i32 4
  %121 = load i64, ptr %120, align 8, !tbaa !30
  %122 = getelementptr inbounds [5 x %struct.xLIST], ptr @pxReadyTasksLists, i64 0, i64 %121
  %123 = getelementptr inbounds %struct.xLIST, ptr %122, i32 0, i32 1
  %124 = load ptr, ptr %123, align 8, !tbaa !24
  store ptr %124, ptr %7, align 8, !tbaa !5
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = load ptr, ptr %3, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %126, i32 0, i32 2
  %128 = getelementptr inbounds %struct.xLIST_ITEM, ptr %127, i32 0, i32 1
  store ptr %125, ptr %128, align 8, !tbaa !29
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.xLIST_ITEM, ptr %129, i32 0, i32 2
  %131 = load ptr, ptr %130, align 8, !tbaa !22
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %132, i32 0, i32 2
  %134 = getelementptr inbounds %struct.xLIST_ITEM, ptr %133, i32 0, i32 2
  store ptr %131, ptr %134, align 8, !tbaa !28
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %135, i32 0, i32 2
  %137 = load ptr, ptr %7, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.xLIST_ITEM, ptr %137, i32 0, i32 2
  %139 = load ptr, ptr %138, align 8, !tbaa !22
  %140 = getelementptr inbounds %struct.xLIST_ITEM, ptr %139, i32 0, i32 1
  store ptr %136, ptr %140, align 8, !tbaa !23
  %141 = load ptr, ptr %3, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %141, i32 0, i32 2
  %143 = load ptr, ptr %7, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.xLIST_ITEM, ptr %143, i32 0, i32 2
  store ptr %142, ptr %144, align 8, !tbaa !22
  %145 = load ptr, ptr %3, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %145, i32 0, i32 4
  %147 = load i64, ptr %146, align 8, !tbaa !30
  %148 = getelementptr inbounds [5 x %struct.xLIST], ptr @pxReadyTasksLists, i64 0, i64 %147
  %149 = load ptr, ptr %3, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %149, i32 0, i32 2
  %151 = getelementptr inbounds %struct.xLIST_ITEM, ptr %150, i32 0, i32 4
  store ptr %148, ptr %151, align 8, !tbaa !27
  %152 = load ptr, ptr %3, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %152, i32 0, i32 4
  %154 = load i64, ptr %153, align 8, !tbaa !30
  %155 = getelementptr inbounds [5 x %struct.xLIST], ptr @pxReadyTasksLists, i64 0, i64 %154
  %156 = getelementptr inbounds %struct.xLIST, ptr %155, i32 0, i32 0
  %157 = load volatile i64, ptr %156, align 8, !tbaa !25
  %158 = add i64 %157, 1
  store volatile i64 %158, ptr %156, align 8, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #2
  br label %186

159:                                              ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #2
  %160 = load ptr, ptr getelementptr inbounds (%struct.xLIST, ptr @xPendingReadyList, i32 0, i32 1), align 8, !tbaa !24
  store ptr %160, ptr %8, align 8, !tbaa !5
  %161 = load ptr, ptr %8, align 8, !tbaa !5
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %162, i32 0, i32 3
  %164 = getelementptr inbounds %struct.xLIST_ITEM, ptr %163, i32 0, i32 1
  store ptr %161, ptr %164, align 8, !tbaa !21
  %165 = load ptr, ptr %8, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.xLIST_ITEM, ptr %165, i32 0, i32 2
  %167 = load ptr, ptr %166, align 8, !tbaa !22
  %168 = load ptr, ptr %3, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %168, i32 0, i32 3
  %170 = getelementptr inbounds %struct.xLIST_ITEM, ptr %169, i32 0, i32 2
  store ptr %167, ptr %170, align 8, !tbaa !20
  %171 = load ptr, ptr %3, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %171, i32 0, i32 3
  %173 = load ptr, ptr %8, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.xLIST_ITEM, ptr %173, i32 0, i32 2
  %175 = load ptr, ptr %174, align 8, !tbaa !22
  %176 = getelementptr inbounds %struct.xLIST_ITEM, ptr %175, i32 0, i32 1
  store ptr %172, ptr %176, align 8, !tbaa !23
  %177 = load ptr, ptr %3, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %177, i32 0, i32 3
  %179 = load ptr, ptr %8, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.xLIST_ITEM, ptr %179, i32 0, i32 2
  store ptr %178, ptr %180, align 8, !tbaa !22
  %181 = load ptr, ptr %3, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %181, i32 0, i32 3
  %183 = getelementptr inbounds %struct.xLIST_ITEM, ptr %182, i32 0, i32 4
  store ptr @xPendingReadyList, ptr %183, align 8, !tbaa !17
  %184 = load volatile i64, ptr @xPendingReadyList, align 8, !tbaa !25
  %185 = add i64 %184, 1
  store volatile i64 %185, ptr @xPendingReadyList, align 8, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #2
  br label %186

186:                                              ; preds = %159, %118
  %187 = load ptr, ptr %3, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %187, i32 0, i32 4
  %189 = load i64, ptr %188, align 8, !tbaa !30
  %190 = load volatile ptr, ptr @pxCurrentTCB, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.tskTaskControlBlock, ptr %190, i32 0, i32 4
  %192 = load i64, ptr %191, align 8, !tbaa !30
  %193 = icmp ugt i64 %189, %192
  br i1 %193, label %194, label %195

194:                                              ; preds = %186
  store i64 1, ptr %4, align 8, !tbaa !26
  store volatile i64 1, ptr @xYieldPending, align 8, !tbaa !26
  br label %196

195:                                              ; preds = %186
  store i64 0, ptr %4, align 8, !tbaa !26
  br label %196

196:                                              ; preds = %195, %194
  %197 = load i64, ptr %4, align 8, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #2
  ret i64 %197
}

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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 24}
!10 = !{!"xLIST", !11, i64 0, !6, i64 8, !12, i64 16}
!11 = !{!"long", !7, i64 0}
!12 = !{!"xMINI_LIST_ITEM", !13, i64 0, !6, i64 8, !6, i64 16}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !6, i64 24}
!15 = !{!"xLIST_ITEM", !13, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!16 = !{i64 2148467477}
!17 = !{!18, !6, i64 120}
!18 = !{!"tskTaskControlBlock", !6, i64 0, !19, i64 8, !15, i64 48, !15, i64 88, !11, i64 128, !6, i64 136, !7, i64 144, !11, i64 160, !11, i64 168, !11, i64 176, !11, i64 184, !7, i64 192, !7, i64 196, !7, i64 197, !7, i64 198}
!19 = !{!"MPU_SETTINGS", !13, i64 0, !7, i64 4}
!20 = !{!18, !6, i64 104}
!21 = !{!18, !6, i64 96}
!22 = !{!15, !6, i64 16}
!23 = !{!15, !6, i64 8}
!24 = !{!10, !6, i64 8}
!25 = !{!10, !11, i64 0}
!26 = !{!11, !11, i64 0}
!27 = !{!18, !6, i64 80}
!28 = !{!18, !6, i64 64}
!29 = !{!18, !6, i64 56}
!30 = !{!18, !11, 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
@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: nounwind uwtable
define dso_local range(i64 0, 2) i64 @xTaskRemoveFromEventList(ptr nocapture noundef readonly %0) local_unnamed_addr #0 section "privileged_functions" {
  %2 = getelementptr inbounds i8, ptr %0, i64 24
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 24
  %5 = load ptr, ptr %4, align 8, !tbaa !13
  %6 = icmp eq ptr %5, null
  br i1 %6, label %7, label %9

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

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

9:                                                ; preds = %1
  %10 = getelementptr inbounds i8, ptr %5, i64 88
  %11 = getelementptr inbounds i8, ptr %5, i64 120
  %12 = load ptr, ptr %11, align 8, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %5, i64 104
  %14 = load ptr, ptr %13, align 8, !tbaa !19
  %15 = getelementptr inbounds i8, ptr %5, i64 96
  %16 = load ptr, ptr %15, align 8, !tbaa !20
  %17 = getelementptr inbounds i8, ptr %16, i64 16
  store ptr %14, ptr %17, align 8, !tbaa !21
  %18 = getelementptr inbounds i8, ptr %14, i64 8
  store ptr %16, ptr %18, align 8, !tbaa !22
  %19 = getelementptr inbounds i8, ptr %12, i64 8
  %20 = load ptr, ptr %19, align 8, !tbaa !23
  %21 = icmp eq ptr %20, %10
  br i1 %21, label %22, label %23

22:                                               ; preds = %9
  store ptr %14, ptr %19, align 8, !tbaa !23
  br label %23

23:                                               ; preds = %22, %9
  store ptr null, ptr %11, align 8, !tbaa !16
  %24 = load volatile i64, ptr %12, align 8, !tbaa !24
  %25 = add i64 %24, -1
  store volatile i64 %25, ptr %12, align 8, !tbaa !24
  %26 = load volatile i64, ptr @uxSchedulerSuspended, align 8, !tbaa !25
  %27 = icmp eq i64 %26, 0
  br i1 %27, label %28, label %59

28:                                               ; preds = %23
  %29 = getelementptr inbounds i8, ptr %5, i64 48
  %30 = getelementptr inbounds i8, ptr %5, i64 80
  %31 = load ptr, ptr %30, align 8, !tbaa !26
  %32 = getelementptr inbounds i8, ptr %5, i64 64
  %33 = load ptr, ptr %32, align 8, !tbaa !27
  %34 = getelementptr inbounds i8, ptr %5, i64 56
  %35 = load ptr, ptr %34, align 8, !tbaa !28
  %36 = getelementptr inbounds i8, ptr %35, i64 16
  store ptr %33, ptr %36, align 8, !tbaa !21
  %37 = getelementptr inbounds i8, ptr %33, i64 8
  store ptr %35, ptr %37, align 8, !tbaa !22
  %38 = getelementptr inbounds i8, ptr %31, i64 8
  %39 = load ptr, ptr %38, align 8, !tbaa !23
  %40 = icmp eq ptr %39, %29
  br i1 %40, label %41, label %42

41:                                               ; preds = %28
  store ptr %33, ptr %38, align 8, !tbaa !23
  br label %42

42:                                               ; preds = %41, %28
  %43 = load volatile i64, ptr %31, align 8, !tbaa !24
  %44 = add i64 %43, -1
  store volatile i64 %44, ptr %31, align 8, !tbaa !24
  %45 = getelementptr inbounds i8, ptr %5, i64 128
  %46 = load i64, ptr %45, align 8, !tbaa !29
  %47 = load volatile i64, ptr @uxTopReadyPriority, align 8, !tbaa !25
  %48 = icmp ugt i64 %46, %47
  br i1 %48, label %49, label %50

49:                                               ; preds = %42
  store volatile i64 %46, ptr @uxTopReadyPriority, align 8, !tbaa !25
  br label %50

50:                                               ; preds = %49, %42
  %51 = getelementptr inbounds [5 x %struct.xLIST], ptr @pxReadyTasksLists, i64 0, i64 %46, i32 1
  %52 = load ptr, ptr %51, align 8, !tbaa !23
  store ptr %52, ptr %34, align 8, !tbaa !28
  %53 = getelementptr inbounds i8, ptr %52, i64 16
  %54 = load ptr, ptr %53, align 8, !tbaa !21
  store ptr %54, ptr %32, align 8, !tbaa !27
  %55 = getelementptr inbounds i8, ptr %54, i64 8
  store ptr %29, ptr %55, align 8, !tbaa !22
  store ptr %29, ptr %53, align 8, !tbaa !21
  %56 = getelementptr inbounds [5 x %struct.xLIST], ptr @pxReadyTasksLists, i64 0, i64 %46
  store ptr %56, ptr %30, align 8, !tbaa !26
  %57 = load volatile i64, ptr %56, align 8, !tbaa !24
  %58 = add i64 %57, 1
  store volatile i64 %58, ptr %56, align 8, !tbaa !24
  br label %66

59:                                               ; preds = %23
  %60 = load ptr, ptr getelementptr inbounds (i8, ptr @xPendingReadyList, i64 8), align 8, !tbaa !23
  store ptr %60, ptr %15, align 8, !tbaa !20
  %61 = getelementptr inbounds i8, ptr %60, i64 16
  %62 = load ptr, ptr %61, align 8, !tbaa !21
  store ptr %62, ptr %13, align 8, !tbaa !19
  %63 = getelementptr inbounds i8, ptr %62, i64 8
  store ptr %10, ptr %63, align 8, !tbaa !22
  store ptr %10, ptr %61, align 8, !tbaa !21
  store ptr @xPendingReadyList, ptr %11, align 8, !tbaa !16
  %64 = load volatile i64, ptr @xPendingReadyList, align 8, !tbaa !24
  %65 = add i64 %64, 1
  store volatile i64 %65, ptr @xPendingReadyList, align 8, !tbaa !24
  %.phi.trans.insert = getelementptr inbounds i8, ptr %5, i64 128
  %.pre = load i64, ptr %.phi.trans.insert, align 8, !tbaa !29
  br label %66

66:                                               ; preds = %59, %50
  %67 = phi i64 [ %.pre, %59 ], [ %46, %50 ]
  %68 = load volatile ptr, ptr @pxCurrentTCB, align 8, !tbaa !30
  %69 = getelementptr inbounds i8, ptr %68, i64 128
  %70 = load i64, ptr %69, align 8, !tbaa !29
  %71 = icmp ugt i64 %67, %70
  br i1 %71, label %72, label %73

72:                                               ; preds = %66
  store volatile i64 1, ptr @xYieldPending, align 8, !tbaa !25
  br label %73

73:                                               ; preds = %66, %72
  %.0 = phi i64 [ 1, %72 ], [ 0, %66 ]
  ret i64 %.0
}

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


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