; 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

declare void @SIGNAL_RESOURCE(i32 noundef, ptr noundef, i8 noundef zeroext, ptr noundef) #1

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

26:                                               ; preds = %6
  %27 = load ptr, ptr %12, align 8, !tbaa !9
  store i32 4, ptr %27, align 4, !tbaa !5
  call void @EXIT_CORE()
  store i32 1, ptr %17, align 4
  br label %144

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

40:                                               ; preds = %28
  %41 = load ptr, ptr %12, align 8, !tbaa !9
  store i32 4, ptr %41, align 4, !tbaa !5
  call void @EXIT_CORE()
  store i32 1, ptr %17, align 4
  br label %144

42:                                               ; preds = %28
  %43 = load ptr, ptr %14, align 8, !tbaa !9
  %44 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %43, i32 0, i32 26
  %45 = load ptr, ptr %44, align 8, !tbaa !24
  %46 = load i32, ptr %8, align 4, !tbaa !5
  %47 = zext i32 %46 to i64
  %48 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %45, i64 %47
  store ptr %48, ptr %15, align 8, !tbaa !9
  %49 = load ptr, ptr %15, align 8, !tbaa !9
  %50 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %49, i32 0, i32 4
  %51 = load i32, ptr %50, align 8, !tbaa !25
  %52 = icmp ne i32 %51, 1
  br i1 %52, label %53, label %55

53:                                               ; preds = %42
  %54 = load ptr, ptr %12, align 8, !tbaa !9
  store i32 6, ptr %54, align 4, !tbaa !5
  call void @EXIT_CORE()
  store i32 1, ptr %17, align 4
  br label %144

55:                                               ; preds = %42
  %56 = load ptr, ptr %15, align 8, !tbaa !9
  %57 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %56, i32 0, i32 6
  %58 = load i32, ptr %57, align 8, !tbaa !27
  %59 = icmp ule i32 %58, 0
  br i1 %59, label %60, label %62

60:                                               ; preds = %55
  %61 = load ptr, ptr %12, align 8, !tbaa !9
  store i32 3, ptr %61, align 4, !tbaa !5
  call void @EXIT_CORE()
  store i32 1, ptr %17, align 4
  br label %144

62:                                               ; preds = %55
  %63 = load ptr, ptr %15, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %63, i32 0, i32 10
  %65 = load ptr, ptr %64, align 8, !tbaa !28
  %66 = load ptr, ptr %15, align 8, !tbaa !9
  %67 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %66, i32 0, i32 7
  %68 = load i32, ptr %67, align 4, !tbaa !29
  %69 = zext i32 %68 to i64
  %70 = getelementptr inbounds i32, ptr %65, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = load ptr, ptr %10, align 8, !tbaa !9
  store i32 %71, ptr %72, align 4, !tbaa !5
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %98, %62
  %74 = load i32, ptr %16, align 4, !tbaa !5
  %75 = load ptr, ptr %10, align 8, !tbaa !9
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = icmp ult i32 %74, %76
  br i1 %77, label %78, label %101

78:                                               ; preds = %73
  %79 = load ptr, ptr %15, align 8, !tbaa !9
  %80 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %79, i32 0, i32 9
  %81 = load ptr, ptr %80, align 8, !tbaa !30
  %82 = load ptr, ptr %15, align 8, !tbaa !9
  %83 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %82, i32 0, i32 7
  %84 = load i32, ptr %83, align 4, !tbaa !29
  %85 = load ptr, ptr %15, align 8, !tbaa !9
  %86 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %85, i32 0, i32 2
  %87 = load i32, ptr %86, align 8, !tbaa !31
  %88 = mul i32 %84, %87
  %89 = load i32, ptr %16, align 4, !tbaa !5
  %90 = add i32 %88, %89
  %91 = zext i32 %90 to i64
  %92 = getelementptr inbounds i8, ptr %81, i64 %91
  %93 = load i8, ptr %92, align 1, !tbaa !11
  %94 = load ptr, ptr %9, align 8, !tbaa !9
  %95 = load i32, ptr %16, align 4, !tbaa !5
  %96 = zext i32 %95 to i64
  %97 = getelementptr inbounds i8, ptr %94, i64 %96
  store i8 %93, ptr %97, align 1, !tbaa !11
  br label %98

98:                                               ; preds = %78
  %99 = load i32, ptr %16, align 4, !tbaa !5
  %100 = add i32 %99, 1
  store i32 %100, ptr %16, align 4, !tbaa !5
  br label %73, !llvm.loop !32

101:                                              ; preds = %73
  %102 = load i8, ptr %11, align 1, !tbaa !11
  %103 = icmp ne i8 %102, 0
  br i1 %103, label %142, label %104

104:                                              ; preds = %101
  %105 = load ptr, ptr %15, align 8, !tbaa !9
  %106 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %105, i32 0, i32 6
  %107 = load i32, ptr %106, align 8, !tbaa !27
  %108 = add i32 %107, -1
  store i32 %108, ptr %106, align 8, !tbaa !27
  %109 = load ptr, ptr %15, align 8, !tbaa !9
  %110 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %109, i32 0, i32 7
  %111 = load i32, ptr %110, align 4, !tbaa !29
  %112 = add i32 %111, 1
  store i32 %112, ptr %110, align 4, !tbaa !29
  %113 = load ptr, ptr %15, align 8, !tbaa !9
  %114 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %113, i32 0, i32 7
  %115 = load i32, ptr %114, align 4, !tbaa !29
  %116 = load ptr, ptr %15, align 8, !tbaa !9
  %117 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %116, i32 0, i32 3
  %118 = load i32, ptr %117, align 4, !tbaa !34
  %119 = icmp uge i32 %115, %118
  br i1 %119, label %120, label %128

120:                                              ; preds = %104
  %121 = load ptr, ptr %15, align 8, !tbaa !9
  %122 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %121, i32 0, i32 3
  %123 = load i32, ptr %122, align 4, !tbaa !34
  %124 = load ptr, ptr %15, align 8, !tbaa !9
  %125 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %124, i32 0, i32 7
  %126 = load i32, ptr %125, align 4, !tbaa !29
  %127 = sub i32 %126, %123
  store i32 %127, ptr %125, align 4, !tbaa !29
  br label %128

128:                                              ; preds = %120, %104
  %129 = load ptr, ptr %15, align 8, !tbaa !9
  %130 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %129, i32 0, i32 11
  %131 = getelementptr inbounds %struct._priorityqueueRECORD, ptr %130, i32 0, i32 1
  %132 = load i32, ptr %131, align 8, !tbaa !35
  %133 = icmp eq i32 %132, 0
  br i1 %133, label %141, label %134

134:                                              ; preds = %128
  %135 = load ptr, ptr %14, align 8, !tbaa !9
  %136 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %135, i32 0, i32 3
  %137 = load i32, ptr %136, align 8, !tbaa !36
  %138 = load ptr, ptr %15, align 8, !tbaa !9
  %139 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %138, i32 0, i32 11
  %140 = load ptr, ptr %12, align 8, !tbaa !9
  call void @SIGNAL_RESOURCE(i32 noundef %137, ptr noundef %139, i8 noundef zeroext 0, ptr noundef %140)
  br label %141

141:                                              ; preds = %134, %128
  br label %142

142:                                              ; preds = %141, %101
  %143 = load ptr, ptr %12, align 8, !tbaa !9
  store i32 1, ptr %143, align 4, !tbaa !5
  call void @EXIT_CORE()
  store i32 0, ptr %17, align 4
  br label %144

144:                                              ; preds = %142, %60, %53, %40, %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  %145 = load i32, ptr %17, align 4
  switch i32 %145, label %147 [
    i32 0, label %146
    i32 1, label %146
  ]

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

147:                                              ; preds = %144
  unreachable
}

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 = !{!7, !7, i64 0}
!12 = !{!13, !6, i64 120}
!13 = !{!"_MODULE_INFORMATION_TYPE", !10, i64 0, !14, i64 8, !6, i64 32, !6, i64 36, !6, i64 40, !15, i64 48, !6, i64 120, !10, i64 128, !10, i64 136, !16, i64 144, !17, i64 256, !17, i64 264, !17, i64 272, !18, i64 280}
!14 = !{!"_heapRECORD", !10, i64 0, !6, i64 8, !6, i64 12, !6, i64 16}
!15 = !{!"_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}
!16 = !{!"_HEALTHMONITORINGCALLBACK_INFORMATION_TYPE", !7, i64 0, !10, i64 8, !6, i64 16, !15, i64 24, !7, i64 96, !7, i64 97, !7, i64 98, !7, i64 99, !6, i64 100, !6, i64 104}
!17 = !{!"long long", !7, i64 0}
!18 = !{!"_priorityqueueRECORD", !10, i64 0, !6, i64 8, !7, i64 12, !7, i64 13}
!19 = !{!13, !10, i64 128}
!20 = !{!21, !6, i64 512}
!21 = !{!"_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, !14, i64 48, !15, i64 72, !6, i64 144, !10, i64 152, !10, i64 160, !22, i64 168, !16, i64 272, !6, i64 384, !23, i64 392, !18, i64 432, !18, i64 448, !18, 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}
!22 = !{!"_ERRORHANDLER_INFORMATION_TYPE", !7, i64 0, !10, i64 8, !6, i64 16, !15, i64 24, !7, i64 96, !7, i64 97, !7, i64 98, !7, i64 99, !6, i64 100}
!23 = !{!"_priorityqueueENTRY", !17, i64 0, !17, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!24 = !{!21, !10, i64 520}
!25 = !{!26, !6, i64 24}
!26 = !{!"_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, !18, i64 64}
!27 = !{!26, !6, i64 32}
!28 = !{!26, !10, i64 56}
!29 = !{!26, !6, i64 36}
!30 = !{!26, !10, i64 48}
!31 = !{!26, !6, i64 16}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!26, !6, i64 20}
!35 = !{!26, !6, i64 72}
!36 = !{!21, !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

declare void @SIGNAL_RESOURCE(i32 noundef, ptr noundef, i8 noundef zeroext, ptr noundef) local_unnamed_addr #0

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

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

19:                                               ; preds = %12
  %20 = getelementptr inbounds i8, ptr %16, i64 520
  %21 = load ptr, ptr %20, align 8, !tbaa !21
  %22 = zext i32 %1 to i64
  %23 = getelementptr inbounds %struct._QUEUINGPORT_INFORMATION_TYPE, ptr %21, i64 %22
  %24 = getelementptr inbounds i8, ptr %23, i64 24
  %25 = load i32, ptr %24, align 8, !tbaa !22
  %.not42 = icmp eq i32 %25, 1
  br i1 %.not42, label %26, label %70

26:                                               ; preds = %19
  %27 = getelementptr inbounds i8, ptr %23, i64 32
  %28 = load i32, ptr %27, align 8, !tbaa !24
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %70, label %30

30:                                               ; preds = %26
  %31 = getelementptr inbounds i8, ptr %23, i64 56
  %32 = load ptr, ptr %31, align 8, !tbaa !25
  %33 = getelementptr inbounds i8, ptr %23, i64 36
  %34 = load i32, ptr %33, align 4, !tbaa !26
  %35 = zext i32 %34 to i64
  %36 = getelementptr inbounds i32, ptr %32, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !27
  store i32 %37, ptr %3, align 4, !tbaa !27
  %.not46 = icmp eq i32 %37, 0
  br i1 %.not46, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %30
  %38 = getelementptr inbounds i8, ptr %23, i64 48
  %39 = getelementptr inbounds i8, ptr %23, i64 16
  br label %40

40:                                               ; preds = %.lr.ph, %40
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %40 ]
  %41 = load ptr, ptr %38, align 8, !tbaa !28
  %42 = load i32, ptr %33, align 4, !tbaa !26
  %43 = load i32, ptr %39, align 8, !tbaa !29
  %44 = mul i32 %43, %42
  %45 = trunc nuw i64 %indvars.iv to i32
  %46 = add i32 %44, %45
  %47 = zext i32 %46 to i64
  %48 = getelementptr inbounds i8, ptr %41, i64 %47
  %49 = load i8, ptr %48, align 1, !tbaa !30
  %50 = getelementptr inbounds i8, ptr %2, i64 %indvars.iv
  store i8 %49, ptr %50, align 1, !tbaa !30
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %51 = load i32, ptr %3, align 4, !tbaa !27
  %52 = zext i32 %51 to i64
  %53 = icmp ult i64 %indvars.iv.next, %52
  br i1 %53, label %40, label %._crit_edge, !llvm.loop !31

._crit_edge:                                      ; preds = %40, %30
  %.not43 = icmp eq i8 %4, 0
  br i1 %.not43, label %54, label %70

54:                                               ; preds = %._crit_edge
  %55 = load <2 x i32>, ptr %27, align 8, !tbaa !27
  %56 = add <2 x i32> %55, <i32 -1, i32 1>
  store <2 x i32> %56, ptr %27, align 8, !tbaa !27
  %57 = getelementptr inbounds i8, ptr %23, i64 20
  %58 = load i32, ptr %57, align 4, !tbaa !33
  %59 = extractelement <2 x i32> %56, i64 1
  %.not44 = icmp ult i32 %59, %58
  br i1 %.not44, label %62, label %60

60:                                               ; preds = %54
  %61 = sub i32 %59, %58
  store i32 %61, ptr %33, align 4, !tbaa !26
  br label %62

62:                                               ; preds = %60, %54
  %63 = getelementptr inbounds i8, ptr %23, i64 72
  %64 = load i32, ptr %63, align 8, !tbaa !34
  %65 = icmp eq i32 %64, 0
  br i1 %65, label %70, label %66

66:                                               ; preds = %62
  %67 = getelementptr inbounds i8, ptr %23, i64 64
  %68 = getelementptr inbounds i8, ptr %16, i64 24
  %69 = load i32, ptr %68, align 8, !tbaa !35
  tail call void @SIGNAL_RESOURCE(i32 noundef %69, ptr noundef nonnull %67, i8 noundef zeroext 0, ptr noundef %5) #2
  br label %70

70:                                               ; preds = %._crit_edge, %66, %62, %26, %19, %12, %6
  %.sink = phi i32 [ 4, %6 ], [ 4, %12 ], [ 6, %19 ], [ 3, %26 ], [ 1, %62 ], [ 1, %66 ], [ 1, %._crit_edge ]
  store i32 %.sink, ptr %5, align 4, !tbaa !27
  tail call void @EXIT_CORE() #2
  ret void
}

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 24}
!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 32}
!25 = !{!23, !7, i64 56}
!26 = !{!23, !11, i64 36}
!27 = !{!11, !11, i64 0}
!28 = !{!23, !7, i64 48}
!29 = !{!23, !11, i64 16}
!30 = !{!8, !8, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!23, !11, i64 20}
!34 = !{!23, !11, i64 72}
!35 = !{!18, !11, i64 24}


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