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

; 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._PARTITION_CONFIGURATION_TYPE = type { i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, ptr, i32, ptr, ptr }
%struct._PARTITION_CONFIGURATION_HEALTHMONITORING_TYPE = type { ptr, i32, i32, ptr }
%struct._PARTITION_CONFIGURATION_HEALTHMONITORING_SYSTEMSTATE_TYPE = type { i32, i32, ptr }
%struct._PARTITION_CONFIGURATION_HEALTHMONITORING_ERROR_TYPE = type { i32, i32 }

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

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

declare void @ENTER_CORE() #1

declare void @EXIT_CORE() #1

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

declare i32 @PORT_GETCORE() #1

; Function Attrs: nounwind uwtable
define dso_local void @RUN_PARTITION_ERROR_ACTION(i8 noundef zeroext %0, i8 noundef zeroext %1, i32 noundef %2, i32 noundef %3) #2 {
  %5 = alloca i8, align 1
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i8 %0, ptr %5, align 1, !tbaa !5
  store i8 %1, ptr %6, align 1, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !8
  store i32 %3, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %15 = load i8, ptr %5, align 1, !tbaa !5
  %16 = icmp ne i8 %15, 0
  br i1 %16, label %17, label %18

17:                                               ; preds = %4
  call void @ENTER_CORE()
  br label %18

18:                                               ; preds = %17, %4
  %19 = call i32 @PORT_GETCORE()
  %20 = zext i32 %19 to i64
  %21 = getelementptr inbounds [2 x %struct._MODULE_INFORMATION_TYPE], ptr @CORE_MODULE_INFORMATION, i64 0, i64 %20
  store ptr %21, ptr %9, align 8, !tbaa !10
  store i32 1, ptr %10, align 4, !tbaa !8
  %22 = load ptr, ptr %9, align 8, !tbaa !10
  %23 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %22, i32 0, i32 8
  %24 = load ptr, ptr %23, align 8, !tbaa !12
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %151

26:                                               ; preds = %18
  %27 = load ptr, ptr %9, align 8, !tbaa !10
  %28 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %27, i32 0, i32 8
  %29 = load ptr, ptr %28, align 8, !tbaa !12
  %30 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %29, i32 0, i32 2
  %31 = load ptr, ptr %30, align 8, !tbaa !19
  %32 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_TYPE, ptr %31, i32 0, i32 25
  %33 = load ptr, ptr %32, align 8, !tbaa !23
  store ptr %33, ptr %11, align 8, !tbaa !10
  %34 = load ptr, ptr %11, align 8, !tbaa !10
  %35 = icmp ne ptr %34, null
  br i1 %35, label %36, label %106

36:                                               ; preds = %26
  store i32 0, ptr %12, align 4, !tbaa !8
  br label %37

37:                                               ; preds = %102, %36
  %38 = load i32, ptr %12, align 4, !tbaa !8
  %39 = load ptr, ptr %11, align 8, !tbaa !10
  %40 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_HEALTHMONITORING_TYPE, ptr %39, i32 0, i32 2
  %41 = load i32, ptr %40, align 4, !tbaa !25
  %42 = icmp ult i32 %38, %41
  br i1 %42, label %43, label %105

43:                                               ; preds = %37
  %44 = load ptr, ptr %11, align 8, !tbaa !10
  %45 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_HEALTHMONITORING_TYPE, ptr %44, i32 0, i32 3
  %46 = load ptr, ptr %45, align 8, !tbaa !27
  %47 = load i32, ptr %12, align 4, !tbaa !8
  %48 = zext i32 %47 to i64
  %49 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_HEALTHMONITORING_SYSTEMSTATE_TYPE, ptr %46, i64 %48
  %50 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_HEALTHMONITORING_SYSTEMSTATE_TYPE, ptr %49, i32 0, i32 0
  %51 = load i32, ptr %50, align 8, !tbaa !28
  %52 = load i32, ptr %7, align 4, !tbaa !8
  %53 = icmp eq i32 %51, %52
  br i1 %53, label %54, label %101

54:                                               ; preds = %43
  store i32 0, ptr %13, align 4, !tbaa !8
  br label %55

55:                                               ; preds = %97, %54
  %56 = load i32, ptr %13, align 4, !tbaa !8
  %57 = load ptr, ptr %11, align 8, !tbaa !10
  %58 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_HEALTHMONITORING_TYPE, ptr %57, i32 0, i32 3
  %59 = load ptr, ptr %58, align 8, !tbaa !27
  %60 = load i32, ptr %12, align 4, !tbaa !8
  %61 = zext i32 %60 to i64
  %62 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_HEALTHMONITORING_SYSTEMSTATE_TYPE, ptr %59, i64 %61
  %63 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_HEALTHMONITORING_SYSTEMSTATE_TYPE, ptr %62, i32 0, i32 1
  %64 = load i32, ptr %63, align 4, !tbaa !30
  %65 = icmp ult i32 %56, %64
  br i1 %65, label %66, label %100

66:                                               ; preds = %55
  %67 = load ptr, ptr %11, align 8, !tbaa !10
  %68 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_HEALTHMONITORING_TYPE, ptr %67, i32 0, i32 3
  %69 = load ptr, ptr %68, align 8, !tbaa !27
  %70 = load i32, ptr %12, align 4, !tbaa !8
  %71 = zext i32 %70 to i64
  %72 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_HEALTHMONITORING_SYSTEMSTATE_TYPE, ptr %69, i64 %71
  %73 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_HEALTHMONITORING_SYSTEMSTATE_TYPE, ptr %72, i32 0, i32 2
  %74 = load ptr, ptr %73, align 8, !tbaa !31
  %75 = load i32, ptr %13, align 4, !tbaa !8
  %76 = zext i32 %75 to i64
  %77 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_HEALTHMONITORING_ERROR_TYPE, ptr %74, i64 %76
  %78 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_HEALTHMONITORING_ERROR_TYPE, ptr %77, i32 0, i32 0
  %79 = load i32, ptr %78, align 4, !tbaa !32
  %80 = load i32, ptr %8, align 4, !tbaa !8
  %81 = icmp eq i32 %79, %80
  br i1 %81, label %82, label %96

82:                                               ; preds = %66
  %83 = load ptr, ptr %11, align 8, !tbaa !10
  %84 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_HEALTHMONITORING_TYPE, ptr %83, i32 0, i32 3
  %85 = load ptr, ptr %84, align 8, !tbaa !27
  %86 = load i32, ptr %12, align 4, !tbaa !8
  %87 = zext i32 %86 to i64
  %88 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_HEALTHMONITORING_SYSTEMSTATE_TYPE, ptr %85, i64 %87
  %89 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_HEALTHMONITORING_SYSTEMSTATE_TYPE, ptr %88, i32 0, i32 2
  %90 = load ptr, ptr %89, align 8, !tbaa !31
  %91 = load i32, ptr %13, align 4, !tbaa !8
  %92 = zext i32 %91 to i64
  %93 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_HEALTHMONITORING_ERROR_TYPE, ptr %90, i64 %92
  %94 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_HEALTHMONITORING_ERROR_TYPE, ptr %93, i32 0, i32 1
  %95 = load i32, ptr %94, align 4, !tbaa !34
  store i32 %95, ptr %10, align 4, !tbaa !8
  br label %100

96:                                               ; preds = %66
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %13, align 4, !tbaa !8
  %99 = add i32 %98, 1
  store i32 %99, ptr %13, align 4, !tbaa !8
  br label %55, !llvm.loop !35

100:                                              ; preds = %82, %55
  br label %105

101:                                              ; preds = %43
  br label %102

102:                                              ; preds = %101
  %103 = load i32, ptr %12, align 4, !tbaa !8
  %104 = add i32 %103, 1
  store i32 %104, ptr %12, align 4, !tbaa !8
  br label %37, !llvm.loop !37

105:                                              ; preds = %100, %37
  br label %106

106:                                              ; preds = %105, %26
  %107 = load i32, ptr %10, align 4, !tbaa !8
  %108 = icmp eq i32 %107, 1
  br i1 %108, label %109, label %110

109:                                              ; preds = %106
  br label %150

110:                                              ; preds = %106
  %111 = load i32, ptr %10, align 4, !tbaa !8
  %112 = icmp eq i32 %111, 2
  br i1 %112, label %113, label %114

113:                                              ; preds = %110
  call void @SET_PARTITION_MODE(i32 noundef 1, ptr noundef %14)
  br label %149

114:                                              ; preds = %110
  %115 = load i32, ptr %10, align 4, !tbaa !8
  %116 = icmp eq i32 %115, 3
  br i1 %116, label %117, label %135

117:                                              ; preds = %114
  %118 = load ptr, ptr %9, align 8, !tbaa !10
  %119 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %118, i32 0, i32 8
  %120 = load ptr, ptr %119, align 8, !tbaa !12
  %121 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %120, i32 0, i32 7
  store i8 1, ptr %121, align 8, !tbaa !38
  %122 = load ptr, ptr %9, align 8, !tbaa !10
  %123 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %122, i32 0, i32 8
  %124 = load ptr, ptr %123, align 8, !tbaa !12
  %125 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %124, i32 0, i32 4
  %126 = load i32, ptr %125, align 4, !tbaa !39
  %127 = icmp eq i32 %126, 2
  br i1 %127, label %128, label %129

128:                                              ; preds = %117
  call void @SET_PARTITION_MODE(i32 noundef 2, ptr noundef %14)
  br label %130

129:                                              ; preds = %117
  call void @SET_PARTITION_MODE(i32 noundef 3, ptr noundef %14)
  br label %130

130:                                              ; preds = %129, %128
  %131 = load ptr, ptr %9, align 8, !tbaa !10
  %132 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %131, i32 0, i32 8
  %133 = load ptr, ptr %132, align 8, !tbaa !12
  %134 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %133, i32 0, i32 7
  store i8 0, ptr %134, align 8, !tbaa !38
  br label %148

135:                                              ; preds = %114
  %136 = load i32, ptr %10, align 4, !tbaa !8
  %137 = icmp eq i32 %136, 4
  br i1 %137, label %138, label %147

138:                                              ; preds = %135
  %139 = load ptr, ptr %9, align 8, !tbaa !10
  %140 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %139, i32 0, i32 8
  %141 = load ptr, ptr %140, align 8, !tbaa !12
  %142 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %141, i32 0, i32 7
  store i8 1, ptr %142, align 8, !tbaa !38
  call void @SET_PARTITION_MODE(i32 noundef 2, ptr noundef %14)
  %143 = load ptr, ptr %9, align 8, !tbaa !10
  %144 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %143, i32 0, i32 8
  %145 = load ptr, ptr %144, align 8, !tbaa !12
  %146 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %145, i32 0, i32 7
  store i8 0, ptr %146, align 8, !tbaa !38
  br label %147

147:                                              ; preds = %138, %135
  br label %148

148:                                              ; preds = %147, %130
  br label %149

149:                                              ; preds = %148, %113
  br label %150

150:                                              ; preds = %149, %109
  br label %151

151:                                              ; preds = %150, %18
  %152 = load i8, ptr %5, align 1, !tbaa !5
  %153 = icmp ne i8 %152, 0
  br i1 %153, label %154, label %155

154:                                              ; preds = %151
  call void @EXIT_CORE()
  br label %155

155:                                              ; preds = %154, %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  ret void
}

declare void @SET_PARTITION_MODE(i32 noundef, ptr noundef) #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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !6, i64 0}
!12 = !{!13, !11, i64 136}
!13 = !{!"_MODULE_INFORMATION_TYPE", !11, i64 0, !14, i64 8, !9, i64 32, !9, i64 36, !9, i64 40, !15, i64 48, !9, i64 120, !11, i64 128, !11, i64 136, !16, i64 144, !17, i64 256, !17, i64 264, !17, i64 272, !18, i64 280}
!14 = !{!"_heapRECORD", !11, i64 0, !9, i64 8, !9, i64 12, !9, i64 16}
!15 = !{!"_CONTEXT_TYPE", !9, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !9, i64 32, !6, i64 36, !11, i64 40, !11, i64 48, !9, i64 56, !9, i64 60, !9, i64 64, !9, i64 68}
!16 = !{!"_HEALTHMONITORINGCALLBACK_INFORMATION_TYPE", !6, i64 0, !11, i64 8, !9, i64 16, !15, i64 24, !6, i64 96, !6, i64 97, !6, i64 98, !6, i64 99, !9, i64 100, !9, i64 104}
!17 = !{!"long long", !6, i64 0}
!18 = !{!"_priorityqueueRECORD", !11, i64 0, !9, i64 8, !6, i64 12, !6, i64 13}
!19 = !{!20, !11, i64 16}
!20 = !{!"_PARTITION_INFORMATION_TYPE", !6, i64 0, !11, i64 8, !11, i64 16, !9, i64 24, !9, i64 28, !9, i64 32, !9, i64 36, !6, i64 40, !14, i64 48, !15, i64 72, !9, i64 144, !11, i64 152, !11, i64 160, !21, i64 168, !16, i64 272, !9, i64 384, !22, i64 392, !18, i64 432, !18, i64 448, !18, i64 464, !9, i64 480, !9, i64 484, !11, i64 488, !9, i64 496, !11, i64 504, !9, i64 512, !11, i64 520, !9, i64 528, !11, i64 536, !9, i64 544, !11, i64 552, !9, i64 560, !11, i64 568, !9, i64 576, !11, i64 584}
!21 = !{!"_ERRORHANDLER_INFORMATION_TYPE", !6, i64 0, !11, i64 8, !9, i64 16, !15, i64 24, !6, i64 96, !6, i64 97, !6, i64 98, !6, i64 99, !9, i64 100}
!22 = !{!"_priorityqueueENTRY", !17, i64 0, !17, i64 8, !11, i64 16, !11, i64 24, !11, i64 32}
!23 = !{!24, !11, i64 168}
!24 = !{!"_PARTITION_CONFIGURATION_TYPE", !9, i64 0, !11, i64 8, !9, i64 16, !9, i64 20, !9, i64 24, !9, i64 28, !9, i64 32, !9, i64 36, !9, i64 40, !9, i64 44, !11, i64 48, !9, i64 56, !11, i64 64, !9, i64 72, !11, i64 80, !9, i64 88, !11, i64 96, !9, i64 104, !11, i64 112, !9, i64 120, !11, i64 128, !9, i64 136, !11, i64 144, !9, i64 152, !11, i64 160, !11, i64 168, !9, i64 176, !11, i64 184, !11, i64 192}
!25 = !{!26, !9, i64 12}
!26 = !{!"_PARTITION_CONFIGURATION_HEALTHMONITORING_TYPE", !11, i64 0, !9, i64 8, !9, i64 12, !11, i64 16}
!27 = !{!26, !11, i64 16}
!28 = !{!29, !9, i64 0}
!29 = !{!"_PARTITION_CONFIGURATION_HEALTHMONITORING_SYSTEMSTATE_TYPE", !9, i64 0, !9, i64 4, !11, i64 8}
!30 = !{!29, !9, i64 4}
!31 = !{!29, !11, i64 8}
!32 = !{!33, !9, i64 0}
!33 = !{!"_PARTITION_CONFIGURATION_HEALTHMONITORING_ERROR_TYPE", !9, i64 0, !9, i64 4}
!34 = !{!33, !9, i64 4}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = distinct !{!37, !36}
!38 = !{!20, !6, i64 40}
!39 = !{!20, !9, i64 28}


; 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._PARTITION_CONFIGURATION_HEALTHMONITORING_SYSTEMSTATE_TYPE = type { i32, i32, ptr }
%struct._PARTITION_CONFIGURATION_HEALTHMONITORING_ERROR_TYPE = type { i32, i32 }

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

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

declare void @ENTER_CORE() local_unnamed_addr #1

declare void @EXIT_CORE() local_unnamed_addr #1

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

declare i32 @PORT_GETCORE() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @RUN_PARTITION_ERROR_ACTION(i8 noundef zeroext %0, i8 noundef zeroext %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #2 {
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  %.not = icmp eq i8 %0, 0
  br i1 %.not, label %7, label %6

6:                                                ; preds = %4
  tail call void @ENTER_CORE() #3
  br label %7

7:                                                ; preds = %6, %4
  %8 = tail call i32 @PORT_GETCORE() #3
  %9 = zext i32 %8 to i64
  %10 = getelementptr inbounds [2 x %struct._MODULE_INFORMATION_TYPE], ptr @CORE_MODULE_INFORMATION, i64 0, i64 %9, i32 8
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %.not34 = icmp eq ptr %11, null
  br i1 %.not34, label %.thread, label %12

12:                                               ; preds = %7
  %13 = getelementptr inbounds i8, ptr %11, i64 16
  %14 = load ptr, ptr %13, align 8, !tbaa !16
  %15 = getelementptr inbounds i8, ptr %14, i64 168
  %16 = load ptr, ptr %15, align 8, !tbaa !20
  %.not35 = icmp eq ptr %16, null
  br i1 %.not35, label %.thread, label %.preheader37

.preheader37:                                     ; preds = %12
  %17 = getelementptr inbounds i8, ptr %16, i64 12
  %18 = load i32, ptr %17, align 4, !tbaa !22
  %.not45 = icmp eq i32 %18, 0
  br i1 %.not45, label %.thread, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader37
  %19 = getelementptr inbounds i8, ptr %16, i64 16
  %20 = load ptr, ptr %19, align 8, !tbaa !24
  %wide.trip.count = zext i32 %18 to i64
  br label %22

21:                                               ; preds = %22
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.thread, label %22, !llvm.loop !25

22:                                               ; preds = %.lr.ph, %21
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %21 ]
  %23 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_HEALTHMONITORING_SYSTEMSTATE_TYPE, ptr %20, i64 %indvars.iv
  %24 = load i32, ptr %23, align 8, !tbaa !27
  %25 = icmp eq i32 %24, %2
  br i1 %25, label %.preheader, label %21

.preheader:                                       ; preds = %22
  %26 = getelementptr inbounds i8, ptr %23, i64 4
  %27 = load i32, ptr %26, align 4, !tbaa !29
  %.not46 = icmp eq i32 %27, 0
  br i1 %.not46, label %.thread, label %.lr.ph44

.lr.ph44:                                         ; preds = %.preheader
  %28 = getelementptr inbounds i8, ptr %23, i64 8
  %29 = load ptr, ptr %28, align 8, !tbaa !30
  %wide.trip.count55 = zext i32 %27 to i64
  br label %31

30:                                               ; preds = %31
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  %exitcond56.not = icmp eq i64 %indvars.iv.next53, %wide.trip.count55
  br i1 %exitcond56.not, label %.thread, label %31, !llvm.loop !31

31:                                               ; preds = %.lr.ph44, %30
  %indvars.iv52 = phi i64 [ 0, %.lr.ph44 ], [ %indvars.iv.next53, %30 ]
  %32 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_HEALTHMONITORING_ERROR_TYPE, ptr %29, i64 %indvars.iv52
  %33 = load i32, ptr %32, align 4, !tbaa !32
  %34 = icmp eq i32 %33, %3
  br i1 %34, label %35, label %30

35:                                               ; preds = %31
  %36 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_HEALTHMONITORING_ERROR_TYPE, ptr %29, i64 %indvars.iv52, i32 1
  %37 = load i32, ptr %36, align 4, !tbaa !34
  switch i32 %37, label %.thread [
    i32 4, label %46
    i32 2, label %38
    i32 3, label %39
  ]

38:                                               ; preds = %35
  call void @SET_PARTITION_MODE(i32 noundef 1, ptr noundef nonnull %5) #3
  br label %.thread

39:                                               ; preds = %35
  %40 = getelementptr inbounds i8, ptr %11, i64 40
  store i8 1, ptr %40, align 8, !tbaa !35
  %41 = getelementptr inbounds i8, ptr %11, i64 28
  %42 = load i32, ptr %41, align 4, !tbaa !36
  %43 = icmp eq i32 %42, 2
  %. = select i1 %43, i32 2, i32 3
  call void @SET_PARTITION_MODE(i32 noundef %., ptr noundef nonnull %5) #3
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %44, i64 40
  store i8 0, ptr %45, align 8, !tbaa !35
  br label %.thread

46:                                               ; preds = %35
  %47 = getelementptr inbounds i8, ptr %11, i64 40
  store i8 1, ptr %47, align 8, !tbaa !35
  call void @SET_PARTITION_MODE(i32 noundef 2, ptr noundef nonnull %5) #3
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %48, i64 40
  store i8 0, ptr %49, align 8, !tbaa !35
  br label %.thread

.thread:                                          ; preds = %21, %30, %.preheader37, %.preheader, %12, %35, %39, %46, %38, %7
  br i1 %.not, label %51, label %50

50:                                               ; preds = %.thread
  call void @EXIT_CORE() #3
  br label %51

51:                                               ; preds = %50, %.thread
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  ret void
}

declare void @SET_PARTITION_MODE(i32 noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress 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, !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, !7, i64 16}
!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 = !{!21, !7, i64 168}
!21 = !{!"_PARTITION_CONFIGURATION_TYPE", !11, i64 0, !7, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !7, i64 48, !11, i64 56, !7, i64 64, !11, i64 72, !7, i64 80, !11, i64 88, !7, i64 96, !11, i64 104, !7, i64 112, !11, i64 120, !7, i64 128, !11, i64 136, !7, i64 144, !11, i64 152, !7, i64 160, !7, i64 168, !11, i64 176, !7, i64 184, !7, i64 192}
!22 = !{!23, !11, i64 12}
!23 = !{!"_PARTITION_CONFIGURATION_HEALTHMONITORING_TYPE", !7, i64 0, !11, i64 8, !11, i64 12, !7, i64 16}
!24 = !{!23, !7, i64 16}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!28, !11, i64 0}
!28 = !{!"_PARTITION_CONFIGURATION_HEALTHMONITORING_SYSTEMSTATE_TYPE", !11, i64 0, !11, i64 4, !7, i64 8}
!29 = !{!28, !11, i64 4}
!30 = !{!28, !7, i64 8}
!31 = distinct !{!31, !26}
!32 = !{!33, !11, i64 0}
!33 = !{!"_PARTITION_CONFIGURATION_HEALTHMONITORING_ERROR_TYPE", !11, i64 0, !11, i64 4}
!34 = !{!33, !11, i64 4}
!35 = !{!17, !8, i64 40}
!36 = !{!17, !11, i64 28}


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