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

; 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._QUEUINGPORT_INFORMATION_TYPE = type { i32, ptr, i32, i32, i32, i32, i32, i32, i8, ptr, ptr, %struct._priorityqueueRECORD }

@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 i32 @PORT_GETCORE() #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

; Function Attrs: nounwind uwtable
define dso_local void @SEND_PARTITION_QUEUING_MESSAGE(i32 noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4) #2 {
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store i32 %0, ptr %6, align 4, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  call void @ENTER_CORE()
  %17 = call i32 @PORT_GETCORE()
  %18 = zext i32 %17 to i64
  %19 = getelementptr inbounds [2 x %struct._MODULE_INFORMATION_TYPE], ptr @CORE_MODULE_INFORMATION, i64 0, i64 %18
  store ptr %19, ptr %11, align 8, !tbaa !9
  %20 = load i32, ptr %6, align 4, !tbaa !5
  %21 = load ptr, ptr %11, align 8, !tbaa !9
  %22 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %21, i32 0, i32 6
  %23 = load i32, ptr %22, align 8, !tbaa !11
  %24 = icmp uge i32 %20, %23
  br i1 %24, label %25, label %27

25:                                               ; preds = %5
  %26 = load ptr, ptr %10, align 8, !tbaa !9
  store i32 4, ptr %26, align 4, !tbaa !5
  call void @EXIT_CORE()
  store i32 1, ptr %16, align 4
  br label %145

27:                                               ; preds = %5
  %28 = load ptr, ptr %11, align 8, !tbaa !9
  %29 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %28, i32 0, i32 7
  %30 = load ptr, ptr %29, align 8, !tbaa !18
  %31 = load i32, ptr %6, align 4, !tbaa !5
  %32 = zext i32 %31 to i64
  %33 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %30, i64 %32
  store ptr %33, ptr %12, align 8, !tbaa !9
  %34 = load i32, ptr %7, align 4, !tbaa !5
  %35 = load ptr, ptr %12, align 8, !tbaa !9
  %36 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %35, i32 0, i32 25
  %37 = load i32, ptr %36, align 8, !tbaa !19
  %38 = icmp uge i32 %34, %37
  br i1 %38, label %39, label %41

39:                                               ; preds = %27
  %40 = load ptr, ptr %10, align 8, !tbaa !9
  store i32 4, ptr %40, align 4, !tbaa !5
  call void @EXIT_CORE()
  store i32 1, ptr %16, align 4
  br label %145

41:                                               ; preds = %27
  %42 = load ptr, ptr %12, align 8, !tbaa !9
  %43 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %42, i32 0, i32 26
  %44 = load ptr, ptr %43, align 8, !tbaa !23
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = zext i32 %45 to i64
  %47 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %44, i64 %46
  store ptr %47, ptr %13, align 8, !tbaa !9
  %48 = load i32, ptr %9, align 4, !tbaa !5
  %49 = load ptr, ptr %13, align 8, !tbaa !9
  %50 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %49, i32 0, i32 2
  %51 = load i32, ptr %50, align 8, !tbaa !24
  %52 = icmp ugt i32 %48, %51
  br i1 %52, label %53, label %55

53:                                               ; preds = %41
  %54 = load ptr, ptr %10, align 8, !tbaa !9
  store i32 5, ptr %54, align 4, !tbaa !5
  call void @EXIT_CORE()
  store i32 1, ptr %16, align 4
  br label %145

55:                                               ; preds = %41
  %56 = load ptr, ptr %13, align 8, !tbaa !9
  %57 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %56, i32 0, i32 4
  %58 = load i32, ptr %57, align 8, !tbaa !26
  %59 = icmp ne i32 %58, 2
  br i1 %59, label %60, label %62

60:                                               ; preds = %55
  %61 = load ptr, ptr %10, align 8, !tbaa !9
  store i32 6, ptr %61, align 4, !tbaa !5
  call void @EXIT_CORE()
  store i32 1, ptr %16, align 4
  br label %145

62:                                               ; preds = %55
  %63 = load ptr, ptr %13, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %63, i32 0, i32 6
  %65 = load i32, ptr %64, align 8, !tbaa !27
  %66 = load ptr, ptr %13, align 8, !tbaa !9
  %67 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %66, i32 0, i32 3
  %68 = load i32, ptr %67, align 4, !tbaa !28
  %69 = icmp uge i32 %65, %68
  br i1 %69, label %70, label %74

70:                                               ; preds = %62
  %71 = load ptr, ptr %13, align 8, !tbaa !9
  %72 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %71, i32 0, i32 8
  store i8 1, ptr %72, align 8, !tbaa !29
  %73 = load ptr, ptr %10, align 8, !tbaa !9
  store i32 3, ptr %73, align 4, !tbaa !5
  call void @EXIT_CORE()
  store i32 1, ptr %16, align 4
  br label %145

74:                                               ; preds = %62
  %75 = load ptr, ptr %13, align 8, !tbaa !9
  %76 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %75, i32 0, i32 7
  %77 = load i32, ptr %76, align 4, !tbaa !30
  %78 = load ptr, ptr %13, align 8, !tbaa !9
  %79 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %78, i32 0, i32 6
  %80 = load i32, ptr %79, align 8, !tbaa !27
  %81 = add i32 %77, %80
  store i32 %81, ptr %14, align 4, !tbaa !5
  %82 = load i32, ptr %14, align 4, !tbaa !5
  %83 = load ptr, ptr %13, align 8, !tbaa !9
  %84 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %83, i32 0, i32 3
  %85 = load i32, ptr %84, align 4, !tbaa !28
  %86 = icmp uge i32 %82, %85
  br i1 %86, label %87, label %93

87:                                               ; preds = %74
  %88 = load ptr, ptr %13, align 8, !tbaa !9
  %89 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %88, i32 0, i32 3
  %90 = load i32, ptr %89, align 4, !tbaa !28
  %91 = load i32, ptr %14, align 4, !tbaa !5
  %92 = sub i32 %91, %90
  store i32 %92, ptr %14, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %87, %74
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %116, %93
  %95 = load i32, ptr %15, align 4, !tbaa !5
  %96 = load i32, ptr %9, align 4, !tbaa !5
  %97 = icmp ult i32 %95, %96
  br i1 %97, label %98, label %119

98:                                               ; preds = %94
  %99 = load ptr, ptr %8, align 8, !tbaa !9
  %100 = load i32, ptr %15, align 4, !tbaa !5
  %101 = zext i32 %100 to i64
  %102 = getelementptr inbounds i8, ptr %99, i64 %101
  %103 = load i8, ptr %102, align 1, !tbaa !31
  %104 = load ptr, ptr %13, align 8, !tbaa !9
  %105 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %104, i32 0, i32 9
  %106 = load ptr, ptr %105, align 8, !tbaa !32
  %107 = load i32, ptr %14, align 4, !tbaa !5
  %108 = load ptr, ptr %13, align 8, !tbaa !9
  %109 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %108, i32 0, i32 2
  %110 = load i32, ptr %109, align 8, !tbaa !24
  %111 = mul i32 %107, %110
  %112 = load i32, ptr %15, align 4, !tbaa !5
  %113 = add i32 %111, %112
  %114 = zext i32 %113 to i64
  %115 = getelementptr inbounds i8, ptr %106, i64 %114
  store i8 %103, ptr %115, align 1, !tbaa !31
  br label %116

116:                                              ; preds = %98
  %117 = load i32, ptr %15, align 4, !tbaa !5
  %118 = add i32 %117, 1
  store i32 %118, ptr %15, align 4, !tbaa !5
  br label %94, !llvm.loop !33

119:                                              ; preds = %94
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = load ptr, ptr %13, align 8, !tbaa !9
  %122 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %121, i32 0, i32 10
  %123 = load ptr, ptr %122, align 8, !tbaa !35
  %124 = load i32, ptr %14, align 4, !tbaa !5
  %125 = zext i32 %124 to i64
  %126 = getelementptr inbounds i32, ptr %123, i64 %125
  store i32 %120, ptr %126, align 4, !tbaa !5
  %127 = load ptr, ptr %13, align 8, !tbaa !9
  %128 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %127, i32 0, i32 6
  %129 = load i32, ptr %128, align 8, !tbaa !27
  %130 = add i32 %129, 1
  store i32 %130, ptr %128, align 8, !tbaa !27
  %131 = load ptr, ptr %13, align 8, !tbaa !9
  %132 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %131, i32 0, i32 11
  %133 = getelementptr inbounds %struct._priorityqueueRECORD, ptr %132, i32 0, i32 1
  %134 = load i32, ptr %133, align 8, !tbaa !36
  %135 = icmp eq i32 %134, 0
  br i1 %135, label %143, label %136

136:                                              ; preds = %119
  %137 = load ptr, ptr %12, align 8, !tbaa !9
  %138 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %137, i32 0, i32 3
  %139 = load i32, ptr %138, align 8, !tbaa !37
  %140 = load ptr, ptr %13, align 8, !tbaa !9
  %141 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %140, i32 0, i32 11
  %142 = load ptr, ptr %10, align 8, !tbaa !9
  call void @SIGNAL_RESOURCE(i32 noundef %139, ptr noundef %141, i8 noundef zeroext 0, ptr noundef %142)
  br label %143

143:                                              ; preds = %136, %119
  %144 = load ptr, ptr %10, align 8, !tbaa !9
  store i32 1, ptr %144, align 4, !tbaa !5
  call void @EXIT_CORE()
  store i32 0, ptr %16, align 4
  br label %145

145:                                              ; preds = %143, %70, %60, %53, %39, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  %146 = load i32, ptr %16, align 4
  switch i32 %146, label %148 [
    i32 0, label %147
    i32 1, label %147
  ]

147:                                              ; preds = %145, %145
  ret void

148:                                              ; preds = %145
  unreachable
}

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


; 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_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._QUEUINGPORT_INFORMATION_TYPE = type { i32, ptr, i32, i32, i32, i32, i32, i32, i8, ptr, ptr, %struct._priorityqueueRECORD }

@CORE_MODULE_INFORMATION = external local_unnamed_addr global [2 x %struct._MODULE_INFORMATION_TYPE], 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

; Function Attrs: nounwind uwtable
define dso_local void @SEND_PARTITION_QUEUING_MESSAGE(i32 noundef %0, i32 noundef %1, ptr nocapture noundef readonly %2, i32 noundef %3, ptr noundef %4) local_unnamed_addr #1 {
  tail call void @ENTER_CORE() #2
  %6 = tail call i32 @PORT_GETCORE() #2
  %7 = zext i32 %6 to i64
  %8 = getelementptr inbounds [2 x %struct._MODULE_INFORMATION_TYPE], ptr @CORE_MODULE_INFORMATION, i64 0, i64 %7
  %9 = getelementptr inbounds i8, ptr %8, i64 120
  %10 = load i32, ptr %9, align 8, !tbaa !5
  %.not = icmp ugt i32 %10, %0
  br i1 %.not, label %11, label %84

11:                                               ; preds = %5
  %12 = getelementptr inbounds i8, ptr %8, i64 128
  %13 = load ptr, ptr %12, align 8, !tbaa !16
  %14 = zext i32 %0 to i64
  %15 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %13, i64 %14
  %16 = getelementptr inbounds i8, ptr %15, i64 512
  %17 = load i32, ptr %16, align 8, !tbaa !17
  %.not49 = icmp ugt i32 %17, %1
  br i1 %.not49, label %18, label %84

18:                                               ; preds = %11
  %19 = getelementptr inbounds i8, ptr %15, i64 520
  %20 = load ptr, ptr %19, align 8, !tbaa !21
  %21 = zext i32 %1 to i64
  %22 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %20, i64 %21
  %23 = getelementptr inbounds i8, ptr %22, i64 16
  %24 = load i32, ptr %23, align 8, !tbaa !22
  %25 = icmp ult i32 %24, %3
  br i1 %25, label %84, label %26

26:                                               ; preds = %18
  %27 = getelementptr inbounds i8, ptr %22, i64 24
  %28 = load i32, ptr %27, align 8, !tbaa !24
  %.not50 = icmp eq i32 %28, 2
  br i1 %.not50, label %29, label %84

29:                                               ; preds = %26
  %30 = getelementptr inbounds i8, ptr %22, i64 32
  %31 = load i32, ptr %30, align 8, !tbaa !25
  %32 = getelementptr inbounds i8, ptr %22, i64 20
  %33 = load i32, ptr %32, align 4, !tbaa !26
  %.not51 = icmp ult i32 %31, %33
  br i1 %.not51, label %36, label %34

34:                                               ; preds = %29
  %35 = getelementptr inbounds i8, ptr %22, i64 40
  store i8 1, ptr %35, align 8, !tbaa !27
  br label %84

36:                                               ; preds = %29
  %37 = getelementptr inbounds i8, ptr %22, i64 36
  %38 = load i32, ptr %37, align 4, !tbaa !28
  %39 = add i32 %38, %31
  %.not52 = icmp ult i32 %39, %33
  %40 = select i1 %.not52, i32 0, i32 %33
  %spec.select = sub i32 %39, %40
  %.not54 = icmp eq i32 %3, 0
  br i1 %.not54, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %36
  %41 = getelementptr inbounds i8, ptr %22, i64 48
  %wide.trip.count = zext i32 %3 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %42 = icmp eq i32 %3, 1
  br i1 %42, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %wide.trip.count, 4294967294
  br label %43

43:                                               ; preds = %43, %.lr.ph.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.new ], [ %indvars.iv.next.1, %43 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %43 ]
  %44 = getelementptr inbounds i8, ptr %2, i64 %indvars.iv
  %45 = load i8, ptr %44, align 1, !tbaa !29
  %46 = load ptr, ptr %41, align 8, !tbaa !30
  %47 = load i32, ptr %23, align 8, !tbaa !22
  %48 = mul i32 %47, %spec.select
  %49 = trunc nuw i64 %indvars.iv to i32
  %50 = add i32 %48, %49
  %51 = zext i32 %50 to i64
  %52 = getelementptr inbounds i8, ptr %46, i64 %51
  store i8 %45, ptr %52, align 1, !tbaa !29
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %53 = getelementptr inbounds i8, ptr %2, i64 %indvars.iv.next
  %54 = load i8, ptr %53, align 1, !tbaa !29
  %55 = load ptr, ptr %41, align 8, !tbaa !30
  %56 = load i32, ptr %23, align 8, !tbaa !22
  %57 = mul i32 %56, %spec.select
  %58 = trunc nuw i64 %indvars.iv.next to i32
  %59 = add i32 %57, %58
  %60 = zext i32 %59 to i64
  %61 = getelementptr inbounds i8, ptr %55, i64 %60
  store i8 %54, ptr %61, align 1, !tbaa !29
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %43, !llvm.loop !31

._crit_edge.loopexit.unr-lcssa:                   ; preds = %43, %.lr.ph
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next.1, %43 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %._crit_edge.loopexit.epilog-lcssa

._crit_edge.loopexit.epilog-lcssa:                ; preds = %._crit_edge.loopexit.unr-lcssa
  %62 = getelementptr inbounds i8, ptr %2, i64 %indvars.iv.unr
  %63 = load i8, ptr %62, align 1, !tbaa !29
  %64 = load ptr, ptr %41, align 8, !tbaa !30
  %65 = load i32, ptr %23, align 8, !tbaa !22
  %66 = mul i32 %65, %spec.select
  %67 = trunc nuw i64 %indvars.iv.unr to i32
  %68 = add i32 %66, %67
  %69 = zext i32 %68 to i64
  %70 = getelementptr inbounds i8, ptr %64, i64 %69
  store i8 %63, ptr %70, align 1, !tbaa !29
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.epilog-lcssa, %._crit_edge.loopexit.unr-lcssa, %36
  %71 = getelementptr inbounds i8, ptr %22, i64 56
  %72 = load ptr, ptr %71, align 8, !tbaa !33
  %73 = zext i32 %spec.select to i64
  %74 = getelementptr inbounds i32, ptr %72, i64 %73
  store i32 %3, ptr %74, align 4, !tbaa !34
  %75 = load i32, ptr %30, align 8, !tbaa !25
  %76 = add i32 %75, 1
  store i32 %76, ptr %30, align 8, !tbaa !25
  %77 = getelementptr inbounds i8, ptr %22, i64 72
  %78 = load i32, ptr %77, align 8, !tbaa !35
  %79 = icmp eq i32 %78, 0
  br i1 %79, label %84, label %80

80:                                               ; preds = %._crit_edge
  %81 = getelementptr inbounds i8, ptr %22, i64 64
  %82 = getelementptr inbounds i8, ptr %15, i64 24
  %83 = load i32, ptr %82, align 8, !tbaa !36
  tail call void @SIGNAL_RESOURCE(i32 noundef %83, ptr noundef nonnull %81, i8 noundef zeroext 0, ptr noundef %4) #2
  br label %84

84:                                               ; preds = %._crit_edge, %80, %26, %18, %11, %5, %34
  %.sink = phi i32 [ 3, %34 ], [ 4, %5 ], [ 4, %11 ], [ 5, %18 ], [ 6, %26 ], [ 1, %80 ], [ 1, %._crit_edge ]
  store i32 %.sink, ptr %4, align 4, !tbaa !34
  tail call void @EXIT_CORE() #2
  ret void
}

declare void @SIGNAL_RESOURCE(i32 noundef, ptr noundef, i8 noundef zeroext, ptr noundef) 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, !11, i64 120}
!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 = !{!6, !7, i64 128}
!17 = !{!18, !11, i64 512}
!18 = !{!"_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, !19, i64 168, !13, i64 272, !11, i64 384, !20, 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}
!19 = !{!"_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}
!20 = !{!"_priorityqueueENTRY", !14, i64 0, !14, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!21 = !{!18, !7, i64 520}
!22 = !{!23, !11, i64 16}
!23 = !{!"_QUEUINGPORT_INFORMATION_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, !8, i64 40, !7, i64 48, !7, i64 56, !15, i64 64}
!24 = !{!23, !11, i64 24}
!25 = !{!23, !11, i64 32}
!26 = !{!23, !11, i64 20}
!27 = !{!23, !8, i64 40}
!28 = !{!23, !11, i64 36}
!29 = !{!8, !8, i64 0}
!30 = !{!23, !7, i64 48}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!23, !7, i64 56}
!34 = !{!11, !11, i64 0}
!35 = !{!23, !11, i64 72}
!36 = !{!18, !11, i64 24}


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