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

; 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._SAMPLINGPORT_INFORMATION_TYPE = type { i32, ptr, i32, i32, i64, i64, i64, i32, i32, ptr, 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 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 @CREATE_SAMPLING_PORT(ptr noundef %0, i32 noundef %1, i32 noundef %2, i64 noundef %3, ptr noundef %4, ptr noundef %5) #2 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i64 %3, ptr %10, align 8, !tbaa !11
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  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 8, 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 %13, align 8, !tbaa !5
  %20 = load ptr, ptr %13, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %20, i32 0, i32 8
  %22 = load ptr, ptr %21, align 8, !tbaa !13
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %26

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

26:                                               ; preds = %6
  %27 = load ptr, ptr %13, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %27, i32 0, i32 8
  %29 = load ptr, ptr %28, align 8, !tbaa !13
  %30 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %29, i32 0, i32 4
  %31 = load i32, ptr %30, align 4, !tbaa !19
  %32 = icmp eq i32 %31, 4
  br i1 %32, label %33, label %35

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

35:                                               ; preds = %26
  %36 = load ptr, ptr %13, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %36, i32 0, i32 8
  %38 = load ptr, ptr %37, align 8, !tbaa !13
  %39 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %38, i32 0, i32 23
  %40 = load i32, ptr %39, align 8, !tbaa !23
  store i32 %40, ptr %14, align 4, !tbaa !9
  %41 = load i32, ptr %14, align 4, !tbaa !9
  %42 = load ptr, ptr %13, 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 !13
  %45 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %44, i32 0, i32 2
  %46 = load ptr, ptr %45, align 8, !tbaa !24
  %47 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_TYPE, ptr %46, i32 0, i32 4
  %48 = load i32, ptr %47, align 8, !tbaa !25
  %49 = icmp uge i32 %41, %48
  br i1 %49, label %50, label %52

50:                                               ; preds = %35
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 5, ptr %51, align 4, !tbaa !9
  call void @EXIT_CORE()
  store i32 1, ptr %16, align 4
  br label %154

52:                                               ; preds = %35
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = load ptr, ptr %12, align 8, !tbaa !5
  call void @GET_SAMPLING_PORT_ID(ptr noundef %53, ptr noundef %14, ptr noundef %54)
  %55 = load ptr, ptr %12, align 8, !tbaa !5
  %56 = load i32, ptr %55, align 4, !tbaa !9
  %57 = icmp eq i32 %56, 1
  br i1 %57, label %58, label %60

58:                                               ; preds = %52
  %59 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 2, ptr %59, align 4, !tbaa !9
  call void @EXIT_CORE()
  store i32 1, ptr %16, align 4
  br label %154

60:                                               ; preds = %52
  %61 = load i32, ptr %8, align 4, !tbaa !9
  %62 = icmp ult i32 %61, 1
  br i1 %62, label %66, label %63

63:                                               ; preds = %60
  %64 = load i32, ptr %8, align 4, !tbaa !9
  %65 = icmp ugt i32 %64, 512
  br i1 %65, label %66, label %68

66:                                               ; preds = %63, %60
  %67 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 5, ptr %67, align 4, !tbaa !9
  call void @EXIT_CORE()
  store i32 1, ptr %16, align 4
  br label %154

68:                                               ; preds = %63
  %69 = load i32, ptr %9, align 4, !tbaa !9
  %70 = icmp ne i32 %69, 1
  br i1 %70, label %71, label %76

71:                                               ; preds = %68
  %72 = load i32, ptr %9, align 4, !tbaa !9
  %73 = icmp ne i32 %72, 2
  br i1 %73, label %74, label %76

74:                                               ; preds = %71
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 5, ptr %75, align 4, !tbaa !9
  call void @EXIT_CORE()
  store i32 1, ptr %16, align 4
  br label %154

76:                                               ; preds = %71, %68
  %77 = load i64, ptr %10, align 8, !tbaa !11
  %78 = icmp slt i64 %77, 1000000
  br i1 %78, label %79, label %84

79:                                               ; preds = %76
  %80 = load i64, ptr %10, align 8, !tbaa !11
  %81 = icmp ne i64 %80, -1
  br i1 %81, label %82, label %84

82:                                               ; preds = %79
  %83 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 5, ptr %83, align 4, !tbaa !9
  call void @EXIT_CORE()
  store i32 1, ptr %16, align 4
  br label %154

84:                                               ; preds = %79, %76
  %85 = load ptr, ptr %13, 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 !13
  %88 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %87, i32 0, i32 24
  %89 = load ptr, ptr %88, align 8, !tbaa !27
  %90 = load i32, ptr %14, align 4, !tbaa !9
  %91 = zext i32 %90 to i64
  %92 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %89, i64 %91
  store ptr %92, ptr %15, align 8, !tbaa !5
  %93 = load ptr, ptr %13, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %93, i32 0, i32 8
  %95 = load ptr, ptr %94, align 8, !tbaa !13
  %96 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %95, i32 0, i32 8
  %97 = load ptr, ptr %15, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %97, i32 0, i32 9
  %99 = load i32, ptr %8, align 4, !tbaa !9
  call void @HEAP_ALLOCATE(ptr noundef %96, ptr noundef %98, i32 noundef %99, i8 noundef zeroext 0)
  %100 = load ptr, ptr %15, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %100, i32 0, i32 9
  %102 = load ptr, ptr %101, align 8, !tbaa !28
  %103 = icmp eq ptr %102, null
  br i1 %103, label %104, label %106

104:                                              ; preds = %84
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 5, ptr %105, align 4, !tbaa !9
  call void @EXIT_CORE()
  store i32 1, ptr %16, align 4
  br label %154

106:                                              ; preds = %84
  %107 = load ptr, ptr %13, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %107, i32 0, i32 8
  %109 = load ptr, ptr %108, align 8, !tbaa !13
  %110 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %109, i32 0, i32 8
  %111 = load ptr, ptr %15, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %111, i32 0, i32 1
  call void @HEAP_ALLOCATE(ptr noundef %110, ptr noundef %112, i32 noundef 30, i8 noundef zeroext 0)
  %113 = load ptr, ptr %15, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %113, i32 0, i32 1
  %115 = load ptr, ptr %114, align 8, !tbaa !30
  %116 = icmp eq ptr %115, null
  br i1 %116, label %117, label %119

117:                                              ; preds = %106
  %118 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 5, ptr %118, align 4, !tbaa !9
  call void @EXIT_CORE()
  store i32 1, ptr %16, align 4
  br label %154

119:                                              ; preds = %106
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = load ptr, ptr %15, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %121, i32 0, i32 1
  %123 = load ptr, ptr %122, align 8, !tbaa !30
  %124 = call zeroext i8 @COMMON_COPYSTRING(ptr noundef %120, ptr noundef %123, i32 noundef 30)
  %125 = icmp ne i8 %124, 0
  br i1 %125, label %128, label %126

126:                                              ; preds = %119
  %127 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 5, ptr %127, align 4, !tbaa !9
  call void @EXIT_CORE()
  store i32 1, ptr %16, align 4
  br label %154

128:                                              ; preds = %119
  %129 = load ptr, ptr %13, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %129, i32 0, i32 8
  %131 = load ptr, ptr %130, align 8, !tbaa !13
  %132 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %131, i32 0, i32 23
  %133 = load i32, ptr %132, align 8, !tbaa !23
  %134 = load ptr, ptr %15, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %134, i32 0, i32 0
  store i32 %133, ptr %135, align 8, !tbaa !31
  %136 = load i32, ptr %8, align 4, !tbaa !9
  %137 = load ptr, ptr %15, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %137, i32 0, i32 2
  store i32 %136, ptr %138, align 8, !tbaa !32
  %139 = load i32, ptr %9, align 4, !tbaa !9
  %140 = load ptr, ptr %15, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %140, i32 0, i32 3
  store i32 %139, ptr %141, align 4, !tbaa !33
  %142 = load i64, ptr %10, align 8, !tbaa !11
  %143 = load ptr, ptr %15, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %143, i32 0, i32 4
  store i64 %142, ptr %144, align 8, !tbaa !34
  %145 = load ptr, ptr %13, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %145, i32 0, i32 8
  %147 = load ptr, ptr %146, align 8, !tbaa !13
  %148 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %147, i32 0, i32 23
  %149 = load i32, ptr %148, align 8, !tbaa !23
  %150 = add i32 %149, 1
  store i32 %150, ptr %148, align 8, !tbaa !23
  %151 = load i32, ptr %14, align 4, !tbaa !9
  %152 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 %151, ptr %152, align 4, !tbaa !9
  %153 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 1, ptr %153, align 4, !tbaa !9
  call void @EXIT_CORE()
  store i32 0, ptr %16, align 4
  br label %154

154:                                              ; preds = %128, %126, %117, %104, %82, %74, %66, %58, %50, %33, %24
  call void @llvm.lifetime.end.p0(i64 8, 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
  %155 = load i32, ptr %16, align 4
  switch i32 %155, label %157 [
    i32 0, label %156
    i32 1, label %156
  ]

156:                                              ; preds = %154, %154
  ret void

157:                                              ; preds = %154
  unreachable
}

; Function Attrs: nounwind uwtable
declare dso_local void @GET_SAMPLING_PORT_ID(ptr noundef, ptr noundef, ptr noundef) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @CREATE_SAMPLING_PORT(ptr noundef %0, i32 noundef %1, i32 noundef %2, i64 noundef %3, ptr nocapture noundef writeonly %4, ptr noundef %5) local_unnamed_addr #2 {
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  tail call void @ENTER_CORE() #3
  %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
  %12 = icmp eq ptr %11, null
  br i1 %12, label %13, label %14

13:                                               ; preds = %6
  store i32 6, ptr %5, align 4, !tbaa !16
  tail call void @EXIT_CORE() #3
  br label %72

14:                                               ; preds = %6
  %15 = getelementptr inbounds i8, ptr %11, i64 28
  %16 = load i32, ptr %15, align 4, !tbaa !17
  %17 = icmp eq i32 %16, 4
  br i1 %17, label %18, label %19

18:                                               ; preds = %14
  store i32 6, ptr %5, align 4, !tbaa !16
  tail call void @EXIT_CORE() #3
  br label %72

19:                                               ; preds = %14
  %20 = getelementptr inbounds i8, ptr %11, i64 496
  %21 = load i32, ptr %20, align 8, !tbaa !21
  store i32 %21, ptr %7, align 4, !tbaa !16
  %22 = getelementptr inbounds i8, ptr %11, i64 16
  %23 = load ptr, ptr %22, align 8, !tbaa !22
  %24 = getelementptr inbounds i8, ptr %23, i64 24
  %25 = load i32, ptr %24, align 8, !tbaa !23
  %.not = icmp ult i32 %21, %25
  br i1 %.not, label %27, label %26

26:                                               ; preds = %19
  store i32 5, ptr %5, align 4, !tbaa !16
  tail call void @EXIT_CORE() #3
  br label %72

27:                                               ; preds = %19
  call void @GET_SAMPLING_PORT_ID(ptr noundef %0, ptr noundef nonnull %7, ptr noundef %5)
  %28 = load i32, ptr %5, align 4, !tbaa !16
  %29 = icmp eq i32 %28, 1
  br i1 %29, label %30, label %31

30:                                               ; preds = %27
  store i32 2, ptr %5, align 4, !tbaa !16
  call void @EXIT_CORE() #3
  br label %72

31:                                               ; preds = %27
  %32 = add i32 %1, -513
  %or.cond = icmp ult i32 %32, -512
  br i1 %or.cond, label %33, label %34

33:                                               ; preds = %31
  store i32 5, ptr %5, align 4, !tbaa !16
  call void @EXIT_CORE() #3
  br label %72

34:                                               ; preds = %31
  %35 = add i32 %2, -3
  %or.cond3 = icmp ult i32 %35, -2
  br i1 %or.cond3, label %36, label %37

36:                                               ; preds = %34
  store i32 5, ptr %5, align 4, !tbaa !16
  call void @EXIT_CORE() #3
  br label %72

37:                                               ; preds = %34
  %38 = icmp slt i64 %3, 1000000
  %39 = icmp ne i64 %3, -1
  %or.cond5 = and i1 %38, %39
  br i1 %or.cond5, label %40, label %41

40:                                               ; preds = %37
  store i32 5, ptr %5, align 4, !tbaa !16
  call void @EXIT_CORE() #3
  br label %72

41:                                               ; preds = %37
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %42, i64 504
  %44 = load ptr, ptr %43, align 8, !tbaa !25
  %45 = load i32, ptr %7, align 4, !tbaa !16
  %46 = zext i32 %45 to i64
  %47 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %44, i64 %46
  %48 = getelementptr inbounds i8, ptr %42, i64 48
  %49 = getelementptr inbounds i8, ptr %47, i64 56
  call void @HEAP_ALLOCATE(ptr noundef nonnull %48, ptr noundef nonnull %49, i32 noundef %1, i8 noundef zeroext 0) #3
  %50 = load ptr, ptr %49, align 8, !tbaa !26
  %51 = icmp eq ptr %50, null
  br i1 %51, label %52, label %53

52:                                               ; preds = %41
  store i32 5, ptr %5, align 4, !tbaa !16
  call void @EXIT_CORE() #3
  br label %72

53:                                               ; preds = %41
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %54, i64 48
  %56 = getelementptr inbounds i8, ptr %47, i64 8
  call void @HEAP_ALLOCATE(ptr noundef nonnull %55, ptr noundef nonnull %56, i32 noundef 30, i8 noundef zeroext 0) #3
  %57 = load ptr, ptr %56, align 8, !tbaa !28
  %58 = icmp eq ptr %57, null
  br i1 %58, label %59, label %60

59:                                               ; preds = %53
  store i32 5, ptr %5, align 4, !tbaa !16
  call void @EXIT_CORE() #3
  br label %72

60:                                               ; preds = %53
  %61 = call zeroext i8 @COMMON_COPYSTRING(ptr noundef %0, ptr noundef nonnull %57, i32 noundef 30) #3
  %.not50 = icmp eq i8 %61, 0
  br i1 %.not50, label %62, label %63

62:                                               ; preds = %60
  store i32 5, ptr %5, align 4, !tbaa !16
  call void @EXIT_CORE() #3
  br label %72

63:                                               ; preds = %60
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %64, i64 496
  %66 = load i32, ptr %65, align 8, !tbaa !21
  store i32 %66, ptr %47, align 8, !tbaa !29
  %67 = getelementptr inbounds i8, ptr %47, i64 16
  store i32 %1, ptr %67, align 8, !tbaa !30
  %68 = getelementptr inbounds i8, ptr %47, i64 20
  store i32 %2, ptr %68, align 4, !tbaa !31
  %69 = getelementptr inbounds i8, ptr %47, i64 24
  store i64 %3, ptr %69, align 8, !tbaa !32
  %70 = add i32 %66, 1
  store i32 %70, ptr %65, align 8, !tbaa !21
  %71 = load i32, ptr %7, align 4, !tbaa !16
  store i32 %71, ptr %4, align 4, !tbaa !16
  store i32 1, ptr %5, align 4, !tbaa !16
  call void @EXIT_CORE() #3
  br label %72

72:                                               ; preds = %63, %62, %59, %52, %40, %36, %33, %30, %26, %18, %13
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @GET_SAMPLING_PORT_ID(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare zeroext i8 @COMMON_COPYSTRING(ptr noundef, ptr noundef, i32 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 = !{!11, !11, i64 0}
!17 = !{!18, !11, i64 28}
!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, !11, i64 496}
!22 = !{!18, !7, i64 16}
!23 = !{!24, !11, i64 24}
!24 = !{!"_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}
!25 = !{!18, !7, i64 504}
!26 = !{!27, !7, i64 56}
!27 = !{!"_SAMPLINGPORT_INFORMATION_TYPE", !11, i64 0, !7, i64 8, !11, i64 16, !11, i64 20, !14, i64 24, !14, i64 32, !14, i64 40, !11, i64 48, !11, i64 52, !7, i64 56, !11, i64 64}
!28 = !{!27, !7, i64 8}
!29 = !{!27, !11, i64 0}
!30 = !{!27, !11, i64 16}
!31 = !{!27, !11, i64 20}
!32 = !{!27, !14, i64 24}


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