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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct._MODULE_INFORMATION_TYPE = type { ptr, %struct._heapRECORD, i32, i32, i32, %struct._CONTEXT_TYPE, i32, ptr, ptr, %struct._HEALTHMONITORINGCALLBACK_INFORMATION_TYPE, i64, i64, i64, %struct._priorityqueueRECORD }
%struct._heapRECORD = type { ptr, i32, i32, i32 }
%struct._CONTEXT_TYPE = type { i32, ptr, ptr, ptr, i32, i8, ptr, ptr, i32, i32, i32, i32 }
%struct._HEALTHMONITORINGCALLBACK_INFORMATION_TYPE = type { i8, ptr, i32, %struct._CONTEXT_TYPE, i8, i8, i8, i8, i32, i32 }
%struct._priorityqueueRECORD = type { ptr, i32, i8, i8 }
%struct._PARTITION_INFORMATION_TYPE = type { i8, ptr, ptr, i32, i32, i32, i32, i8, %struct._heapRECORD, %struct._CONTEXT_TYPE, i32, ptr, ptr, %struct._ERRORHANDLER_INFORMATION_TYPE, %struct._HEALTHMONITORINGCALLBACK_INFORMATION_TYPE, i32, %struct._priorityqueueENTRY, %struct._priorityqueueRECORD, %struct._priorityqueueRECORD, %struct._priorityqueueRECORD, i32, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr }
%struct._ERRORHANDLER_INFORMATION_TYPE = type { i8, ptr, i32, %struct._CONTEXT_TYPE, i8, i8, i8, i8, i32 }
%struct._priorityqueueENTRY = type { i64, i64, ptr, ptr, ptr }
%struct._PROCESS_INFORMATION_TYPE = type { ptr, ptr, i32, i32, i32, i64, i64, i64, i64, i64, %struct._CONTEXT_TYPE, %struct._priorityqueueENTRY, %struct._priorityqueueENTRY, %struct._priorityqueueENTRY, %struct._priorityqueueENTRY, i8, i8, ptr, i32, ptr, ptr }

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

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

declare void @ENTER_CORE() #1

declare i32 @PORT_GETCORE() #1

declare void @EXIT_CORE() #1

declare void @PRIORITYQUEUE_REMOVE(ptr noundef) #1

declare void @PORT_YIELD() #1

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

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

12:                                               ; preds = %0
  call void @EXIT_CORE()
  store i32 1, ptr %4, align 4
  br label %142

13:                                               ; preds = %0
  %14 = load ptr, ptr %1, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %14, i32 0, i32 8
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %16, i32 0, i32 4
  %18 = load i32, ptr %17, align 4, !tbaa !17
  %19 = icmp ne i32 %18, 4
  br i1 %19, label %20, label %21

20:                                               ; preds = %13
  call void @EXIT_CORE()
  store i32 1, ptr %4, align 4
  br label %142

21:                                               ; preds = %13
  %22 = load ptr, ptr %1, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %22, i32 0, i32 8
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  %25 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %24, i32 0, i32 13
  %26 = getelementptr inbounds %struct._ERRORHANDLER_INFORMATION_TYPE, ptr %25, i32 0, i32 7
  %27 = load i8, ptr %26, align 1, !tbaa !21
  %28 = icmp ne i8 %27, 0
  br i1 %28, label %84, label %29

29:                                               ; preds = %21
  %30 = load ptr, ptr %1, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %30, i32 0, i32 8
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  %33 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %32, i32 0, i32 12
  %34 = load ptr, ptr %33, align 8, !tbaa !22
  %35 = icmp eq ptr %34, null
  br i1 %35, label %36, label %37

36:                                               ; preds = %29
  call void @EXIT_CORE()
  store i32 1, ptr %4, align 4
  br label %142

37:                                               ; preds = %29
  %38 = load ptr, ptr %1, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %38, i32 0, i32 8
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  %41 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %40, i32 0, i32 6
  store i32 0, ptr %41, align 4, !tbaa !23
  %42 = load ptr, ptr %1, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %42, i32 0, i32 8
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  %45 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %44, i32 0, i32 12
  %46 = load ptr, ptr %45, align 8, !tbaa !22
  %47 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %46, i32 0, i32 11
  call void @PRIORITYQUEUE_REMOVE(ptr noundef %47)
  %48 = load ptr, ptr %1, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %48, i32 0, i32 8
  %50 = load ptr, ptr %49, align 8, !tbaa !9
  %51 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %50, i32 0, i32 12
  %52 = load ptr, ptr %51, align 8, !tbaa !22
  %53 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %52, i32 0, i32 12
  call void @PRIORITYQUEUE_REMOVE(ptr noundef %53)
  %54 = load ptr, ptr %1, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %54, i32 0, i32 8
  %56 = load ptr, ptr %55, align 8, !tbaa !9
  %57 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %56, i32 0, i32 12
  %58 = load ptr, ptr %57, align 8, !tbaa !22
  %59 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %58, i32 0, i32 13
  call void @PRIORITYQUEUE_REMOVE(ptr noundef %59)
  %60 = load ptr, ptr %1, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %60, i32 0, i32 8
  %62 = load ptr, ptr %61, align 8, !tbaa !9
  %63 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %62, i32 0, i32 12
  %64 = load ptr, ptr %63, align 8, !tbaa !22
  %65 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %64, i32 0, i32 14
  call void @PRIORITYQUEUE_REMOVE(ptr noundef %65)
  %66 = load ptr, ptr %1, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %66, i32 0, i32 8
  %68 = load ptr, ptr %67, align 8, !tbaa !9
  %69 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %68, i32 0, i32 12
  %70 = load ptr, ptr %69, align 8, !tbaa !22
  %71 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %70, i32 0, i32 15
  store i8 0, ptr %71, align 8, !tbaa !24
  %72 = load ptr, ptr %1, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %72, i32 0, i32 8
  %74 = load ptr, ptr %73, align 8, !tbaa !9
  %75 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %74, i32 0, i32 12
  %76 = load ptr, ptr %75, align 8, !tbaa !22
  %77 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %76, i32 0, i32 16
  store i8 0, ptr %77, align 1, !tbaa !26
  %78 = load ptr, ptr %1, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %78, i32 0, i32 8
  %80 = load ptr, ptr %79, align 8, !tbaa !9
  %81 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %80, i32 0, i32 12
  %82 = load ptr, ptr %81, align 8, !tbaa !22
  %83 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %82, i32 0, i32 4
  store i32 1, ptr %83, align 8, !tbaa !27
  br label %141

84:                                               ; preds = %21
  %85 = load ptr, ptr %1, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %85, i32 0, i32 8
  %87 = load ptr, ptr %86, align 8, !tbaa !9
  %88 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %87, i32 0, i32 13
  %89 = getelementptr inbounds %struct._ERRORHANDLER_INFORMATION_TYPE, ptr %88, i32 0, i32 8
  %90 = load i32, ptr %89, align 4, !tbaa !28
  store i32 %90, ptr %2, align 4, !tbaa !29
  %91 = load ptr, ptr %1, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %91, i32 0, i32 8
  %93 = load ptr, ptr %92, align 8, !tbaa !9
  %94 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %93, i32 0, i32 13
  %95 = getelementptr inbounds %struct._ERRORHANDLER_INFORMATION_TYPE, ptr %94, i32 0, i32 6
  store i8 1, ptr %95, align 2, !tbaa !30
  %96 = load ptr, ptr %1, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %96, i32 0, i32 8
  %98 = load ptr, ptr %97, align 8, !tbaa !9
  %99 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %98, i32 0, i32 6
  %100 = load i32, ptr %99, align 4, !tbaa !23
  %101 = icmp ugt i32 %100, 0
  br i1 %101, label %102, label %140

102:                                              ; preds = %84
  %103 = load i32, ptr %2, align 4, !tbaa !29
  %104 = load ptr, ptr %1, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %104, i32 0, i32 8
  %106 = load ptr, ptr %105, align 8, !tbaa !9
  %107 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %106, i32 0, i32 10
  %108 = load i32, ptr %107, align 8, !tbaa !31
  %109 = icmp ult i32 %103, %108
  br i1 %109, label %110, label %139

110:                                              ; preds = %102
  %111 = load ptr, ptr %1, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %111, i32 0, i32 8
  %113 = load ptr, ptr %112, align 8, !tbaa !9
  %114 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %113, i32 0, i32 11
  %115 = load ptr, ptr %114, align 8, !tbaa !32
  %116 = load i32, ptr %2, align 4, !tbaa !29
  %117 = zext i32 %116 to i64
  %118 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %115, i64 %117
  store ptr %118, ptr %3, align 8, !tbaa !5
  %119 = load ptr, ptr %3, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %119, i32 0, i32 4
  %121 = load i32, ptr %120, align 8, !tbaa !27
  %122 = icmp ne i32 %121, 1
  br i1 %122, label %123, label %138

123:                                              ; preds = %110
  %124 = load ptr, ptr %3, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %124, i32 0, i32 4
  store i32 3, ptr %125, align 8, !tbaa !27
  %126 = load ptr, ptr %3, align 8, !tbaa !5
  %127 = load ptr, ptr %1, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %127, i32 0, i32 8
  %129 = load ptr, ptr %128, align 8, !tbaa !9
  %130 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %129, i32 0, i32 12
  store ptr %126, ptr %130, align 8, !tbaa !22
  %131 = load ptr, ptr %3, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %131, i32 0, i32 10
  %133 = call i32 @PORT_GETCORE()
  %134 = zext i32 %133 to i64
  %135 = getelementptr inbounds [2 x ptr], ptr @CORE_CURRENT_CONTEXT, i64 0, i64 %134
  store ptr %132, ptr %135, align 8, !tbaa !5
  call void @PORT_SWITCH()
  call void @EXIT_CORE()
  br label %136

136:                                              ; preds = %137, %123
  br label %137

137:                                              ; preds = %136
  br label %136

138:                                              ; preds = %110
  br label %139

139:                                              ; preds = %138, %102
  br label %140

140:                                              ; preds = %139, %84
  br label %141

141:                                              ; preds = %140, %37
  call void @PORT_YIELD()
  call void @EXIT_CORE()
  store i32 0, ptr %4, align 4
  br label %142

142:                                              ; preds = %141, %36, %20, %12
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #3
  %143 = load i32, ptr %4, align 4
  switch i32 %143, label %145 [
    i32 0, label %144
    i32 1, label %144
  ]

144:                                              ; preds = %142, %142
  ret void

145:                                              ; preds = %142
  unreachable
}

declare void @PORT_SWITCH() #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 136}
!10 = !{!"_MODULE_INFORMATION_TYPE", !6, i64 0, !11, i64 8, !12, i64 32, !12, i64 36, !12, i64 40, !13, i64 48, !12, i64 120, !6, i64 128, !6, i64 136, !14, i64 144, !15, i64 256, !15, i64 264, !15, i64 272, !16, i64 280}
!11 = !{!"_heapRECORD", !6, i64 0, !12, i64 8, !12, i64 12, !12, i64 16}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_CONTEXT_TYPE", !12, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !12, i64 32, !7, i64 36, !6, i64 40, !6, i64 48, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68}
!14 = !{!"_HEALTHMONITORINGCALLBACK_INFORMATION_TYPE", !7, i64 0, !6, i64 8, !12, i64 16, !13, i64 24, !7, i64 96, !7, i64 97, !7, i64 98, !7, i64 99, !12, i64 100, !12, i64 104}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"_priorityqueueRECORD", !6, i64 0, !12, i64 8, !7, i64 12, !7, i64 13}
!17 = !{!18, !12, i64 28}
!18 = !{!"_PARTITION_INFORMATION_TYPE", !7, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !7, i64 40, !11, i64 48, !13, i64 72, !12, i64 144, !6, i64 152, !6, i64 160, !19, i64 168, !14, i64 272, !12, i64 384, !20, i64 392, !16, i64 432, !16, i64 448, !16, i64 464, !12, i64 480, !12, i64 484, !6, i64 488, !12, i64 496, !6, i64 504, !12, i64 512, !6, i64 520, !12, i64 528, !6, i64 536, !12, i64 544, !6, i64 552, !12, i64 560, !6, i64 568, !12, i64 576, !6, i64 584}
!19 = !{!"_ERRORHANDLER_INFORMATION_TYPE", !7, i64 0, !6, i64 8, !12, i64 16, !13, i64 24, !7, i64 96, !7, i64 97, !7, i64 98, !7, i64 99, !12, i64 100}
!20 = !{!"_priorityqueueENTRY", !15, i64 0, !15, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!21 = !{!18, !7, i64 267}
!22 = !{!18, !6, i64 160}
!23 = !{!18, !12, i64 36}
!24 = !{!25, !7, i64 304}
!25 = !{!"_PROCESS_INFORMATION_TYPE", !6, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !15, i64 32, !15, i64 40, !15, i64 48, !15, i64 56, !15, i64 64, !13, i64 72, !20, i64 144, !20, i64 184, !20, i64 224, !20, i64 264, !7, i64 304, !7, i64 305, !6, i64 312, !12, i64 320, !6, i64 328, !6, i64 336}
!26 = !{!25, !7, i64 305}
!27 = !{!25, !12, i64 24}
!28 = !{!18, !12, i64 268}
!29 = !{!12, !12, i64 0}
!30 = !{!18, !7, i64 266}
!31 = !{!18, !12, i64 144}
!32 = !{!18, !6, i64 152}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct._MODULE_INFORMATION_TYPE = type { ptr, %struct._heapRECORD, i32, i32, i32, %struct._CONTEXT_TYPE, i32, ptr, ptr, %struct._HEALTHMONITORINGCALLBACK_INFORMATION_TYPE, i64, i64, i64, %struct._priorityqueueRECORD }
%struct._heapRECORD = type { ptr, i32, i32, i32 }
%struct._CONTEXT_TYPE = type { i32, ptr, ptr, ptr, i32, i8, ptr, ptr, i32, i32, i32, i32 }
%struct._HEALTHMONITORINGCALLBACK_INFORMATION_TYPE = type { i8, ptr, i32, %struct._CONTEXT_TYPE, i8, i8, i8, i8, i32, i32 }
%struct._priorityqueueRECORD = type { ptr, i32, i8, i8 }
%struct._PROCESS_INFORMATION_TYPE = type { ptr, ptr, i32, i32, i32, i64, i64, i64, i64, i64, %struct._CONTEXT_TYPE, %struct._priorityqueueENTRY, %struct._priorityqueueENTRY, %struct._priorityqueueENTRY, %struct._priorityqueueENTRY, i8, i8, ptr, i32, ptr, ptr }
%struct._priorityqueueENTRY = type { i64, i64, ptr, ptr, ptr }

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

declare void @ENTER_CORE() local_unnamed_addr #0

declare i32 @PORT_GETCORE() local_unnamed_addr #0

declare void @EXIT_CORE() local_unnamed_addr #0

declare void @PRIORITYQUEUE_REMOVE(ptr noundef) local_unnamed_addr #0

declare void @PORT_YIELD() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @STOP_SELF() local_unnamed_addr #1 {
  tail call void @ENTER_CORE() #2
  %1 = tail call i32 @PORT_GETCORE() #2
  %2 = zext i32 %1 to i64
  %3 = getelementptr inbounds [2 x %struct._MODULE_INFORMATION_TYPE], ptr @CORE_MODULE_INFORMATION, i64 0, i64 %2, i32 8
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = icmp eq ptr %4, null
  br i1 %5, label %62, label %6

6:                                                ; preds = %0
  %7 = getelementptr inbounds i8, ptr %4, i64 28
  %8 = load i32, ptr %7, align 4, !tbaa !16
  %.not = icmp eq i32 %8, 4
  br i1 %.not, label %9, label %62

9:                                                ; preds = %6
  %10 = getelementptr inbounds i8, ptr %4, i64 267
  %11 = load i8, ptr %10, align 1, !tbaa !20
  %.not24 = icmp eq i8 %11, 0
  br i1 %.not24, label %12, label %37

12:                                               ; preds = %9
  %13 = getelementptr inbounds i8, ptr %4, i64 160
  %14 = load ptr, ptr %13, align 8, !tbaa !21
  %15 = icmp eq ptr %14, null
  br i1 %15, label %62, label %16

16:                                               ; preds = %12
  %17 = getelementptr inbounds i8, ptr %4, i64 36
  store i32 0, ptr %17, align 4, !tbaa !22
  %18 = getelementptr inbounds i8, ptr %14, i64 144
  tail call void @PRIORITYQUEUE_REMOVE(ptr noundef nonnull %18) #2
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 160
  %21 = load ptr, ptr %20, align 8, !tbaa !21
  %22 = getelementptr inbounds i8, ptr %21, i64 184
  tail call void @PRIORITYQUEUE_REMOVE(ptr noundef nonnull %22) #2
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %23, i64 160
  %25 = load ptr, ptr %24, align 8, !tbaa !21
  %26 = getelementptr inbounds i8, ptr %25, i64 224
  tail call void @PRIORITYQUEUE_REMOVE(ptr noundef nonnull %26) #2
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %27, i64 160
  %29 = load ptr, ptr %28, align 8, !tbaa !21
  %30 = getelementptr inbounds i8, ptr %29, i64 264
  tail call void @PRIORITYQUEUE_REMOVE(ptr noundef nonnull %30) #2
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %31, i64 160
  %33 = load ptr, ptr %32, align 8, !tbaa !21
  %34 = getelementptr inbounds i8, ptr %33, i64 304
  store i8 0, ptr %34, align 8, !tbaa !23
  %35 = getelementptr inbounds i8, ptr %33, i64 305
  store i8 0, ptr %35, align 1, !tbaa !25
  %36 = getelementptr inbounds i8, ptr %33, i64 24
  store i32 1, ptr %36, align 8, !tbaa !26
  br label %61

37:                                               ; preds = %9
  %38 = getelementptr inbounds i8, ptr %4, i64 268
  %39 = load i32, ptr %38, align 4, !tbaa !27
  %40 = getelementptr inbounds i8, ptr %4, i64 266
  store i8 1, ptr %40, align 2, !tbaa !28
  %41 = getelementptr inbounds i8, ptr %4, i64 36
  %42 = load i32, ptr %41, align 4, !tbaa !22
  %.not25 = icmp eq i32 %42, 0
  br i1 %.not25, label %61, label %43

43:                                               ; preds = %37
  %44 = getelementptr inbounds i8, ptr %4, i64 144
  %45 = load i32, ptr %44, align 8, !tbaa !29
  %46 = icmp ult i32 %39, %45
  br i1 %46, label %47, label %61

47:                                               ; preds = %43
  %48 = getelementptr inbounds i8, ptr %4, i64 152
  %49 = load ptr, ptr %48, align 8, !tbaa !30
  %50 = zext i32 %39 to i64
  %51 = getelementptr inbounds %struct._PROCESS_INFORMATION_TYPE, ptr %49, i64 %50
  %52 = getelementptr inbounds i8, ptr %51, i64 24
  %53 = load i32, ptr %52, align 8, !tbaa !26
  %.not26 = icmp eq i32 %53, 1
  br i1 %.not26, label %61, label %54

54:                                               ; preds = %47
  store i32 3, ptr %52, align 8, !tbaa !26
  %55 = getelementptr inbounds i8, ptr %4, i64 160
  store ptr %51, ptr %55, align 8, !tbaa !21
  %56 = getelementptr inbounds i8, ptr %51, i64 72
  %57 = tail call i32 @PORT_GETCORE() #2
  %58 = zext i32 %57 to i64
  %59 = getelementptr inbounds [2 x ptr], ptr @CORE_CURRENT_CONTEXT, i64 0, i64 %58
  store ptr %56, ptr %59, align 8, !tbaa !31
  tail call void @PORT_SWITCH() #2
  tail call void @EXIT_CORE() #2
  br label %60

60:                                               ; preds = %60, %54
  br label %60

61:                                               ; preds = %37, %47, %43, %16
  tail call void @PORT_YIELD() #2
  br label %62

62:                                               ; preds = %12, %6, %0, %61
  tail call void @EXIT_CORE() #2
  ret void
}

declare void @PORT_SWITCH() local_unnamed_addr #0

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 136}
!6 = !{!"_MODULE_INFORMATION_TYPE", !7, i64 0, !10, i64 8, !11, i64 32, !11, i64 36, !11, i64 40, !12, i64 48, !11, i64 120, !7, i64 128, !7, i64 136, !13, i64 144, !14, i64 256, !14, i64 264, !14, i64 272, !15, i64 280}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_heapRECORD", !7, i64 0, !11, i64 8, !11, i64 12, !11, i64 16}
!11 = !{!"int", !8, i64 0}
!12 = !{!"_CONTEXT_TYPE", !11, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !11, i64 32, !8, i64 36, !7, i64 40, !7, i64 48, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68}
!13 = !{!"_HEALTHMONITORINGCALLBACK_INFORMATION_TYPE", !8, i64 0, !7, i64 8, !11, i64 16, !12, i64 24, !8, i64 96, !8, i64 97, !8, i64 98, !8, i64 99, !11, i64 100, !11, i64 104}
!14 = !{!"long long", !8, i64 0}
!15 = !{!"_priorityqueueRECORD", !7, i64 0, !11, i64 8, !8, i64 12, !8, i64 13}
!16 = !{!17, !11, i64 28}
!17 = !{!"_PARTITION_INFORMATION_TYPE", !8, i64 0, !7, i64 8, !7, i64 16, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !8, i64 40, !10, i64 48, !12, i64 72, !11, i64 144, !7, i64 152, !7, i64 160, !18, i64 168, !13, i64 272, !11, i64 384, !19, i64 392, !15, i64 432, !15, i64 448, !15, i64 464, !11, i64 480, !11, i64 484, !7, i64 488, !11, i64 496, !7, i64 504, !11, i64 512, !7, i64 520, !11, i64 528, !7, i64 536, !11, i64 544, !7, i64 552, !11, i64 560, !7, i64 568, !11, i64 576, !7, i64 584}
!18 = !{!"_ERRORHANDLER_INFORMATION_TYPE", !8, i64 0, !7, i64 8, !11, i64 16, !12, i64 24, !8, i64 96, !8, i64 97, !8, i64 98, !8, i64 99, !11, i64 100}
!19 = !{!"_priorityqueueENTRY", !14, i64 0, !14, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!20 = !{!17, !8, i64 267}
!21 = !{!17, !7, i64 160}
!22 = !{!17, !11, i64 36}
!23 = !{!24, !8, i64 304}
!24 = !{!"_PROCESS_INFORMATION_TYPE", !7, i64 0, !7, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !12, i64 72, !19, i64 144, !19, i64 184, !19, i64 224, !19, i64 264, !8, i64 304, !8, i64 305, !7, i64 312, !11, i64 320, !7, i64 328, !7, i64 336}
!25 = !{!24, !8, i64 305}
!26 = !{!24, !11, i64 24}
!27 = !{!17, !11, i64 268}
!28 = !{!17, !8, i64 266}
!29 = !{!17, !11, i64 144}
!30 = !{!17, !7, i64 152}
!31 = !{!7, !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass