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

; 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._ERROR_STATUS_TYPE = type { i32, [64 x i8], i32, i32, 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 }

@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 @GET_ERROR_STATUS(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  call void @ENTER_CORE()
  %9 = call i32 @PORT_GETCORE()
  %10 = zext i32 %9 to i64
  %11 = getelementptr inbounds [2 x %struct._MODULE_INFORMATION_TYPE], ptr @CORE_MODULE_INFORMATION, i64 0, i64 %10
  store ptr %11, ptr %5, align 8, !tbaa !5
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %12, i32 0, i32 8
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %18

16:                                               ; preds = %2
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  store i32 6, ptr %17, align 4, !tbaa !17
  call void @EXIT_CORE()
  store i32 1, ptr %8, align 4
  br label %152

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

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

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

35:                                               ; preds = %28
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  store i32 2, ptr %36, align 4, !tbaa !17
  call void @EXIT_CORE()
  store i32 1, ptr %8, align 4
  br label %152

37:                                               ; preds = %28
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %38, i32 0, i32 8
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  %41 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %40, i32 0, i32 21
  %42 = load i32, ptr %41, align 4, !tbaa !23
  store i32 %42, ptr %6, align 4, !tbaa !17
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %43, i32 0, i32 8
  %45 = load ptr, ptr %44, align 8, !tbaa !9
  %46 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %45, i32 0, i32 22
  %47 = load ptr, ptr %46, align 8, !tbaa !24
  %48 = load i32, ptr %6, align 4, !tbaa !17
  %49 = zext i32 %48 to i64
  %50 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %47, i64 %49
  %51 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %50, i32 0, i32 0
  %52 = load i32, ptr %51, align 8, !tbaa !25
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %53, i32 0, i32 0
  store i32 %52, ptr %54, align 8, !tbaa !25
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %55, i32 0, i32 8
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  %58 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %57, i32 0, i32 22
  %59 = load ptr, ptr %58, align 8, !tbaa !24
  %60 = load i32, ptr %6, align 4, !tbaa !17
  %61 = zext i32 %60 to i64
  %62 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %59, i64 %61
  %63 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %62, i32 0, i32 2
  %64 = load i32, ptr %63, align 4, !tbaa !27
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %65, i32 0, i32 2
  store i32 %64, ptr %66, align 4, !tbaa !27
  store i32 0, ptr %7, align 4, !tbaa !17
  br label %67

67:                                               ; preds = %92, %37
  %68 = load i32, ptr %7, align 4, !tbaa !17
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %69, i32 0, i32 2
  %71 = load i32, ptr %70, align 4, !tbaa !27
  %72 = icmp ult i32 %68, %71
  br i1 %72, label %73, label %95

73:                                               ; preds = %67
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %74, i32 0, i32 8
  %76 = load ptr, ptr %75, align 8, !tbaa !9
  %77 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %76, i32 0, i32 22
  %78 = load ptr, ptr %77, align 8, !tbaa !24
  %79 = load i32, ptr %6, align 4, !tbaa !17
  %80 = zext i32 %79 to i64
  %81 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %78, i64 %80
  %82 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %81, i32 0, i32 1
  %83 = load i32, ptr %7, align 4, !tbaa !17
  %84 = zext i32 %83 to i64
  %85 = getelementptr inbounds [64 x i8], ptr %82, i64 0, i64 %84
  %86 = load i8, ptr %85, align 1, !tbaa !28
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %87, i32 0, i32 1
  %89 = load i32, ptr %7, align 4, !tbaa !17
  %90 = zext i32 %89 to i64
  %91 = getelementptr inbounds [64 x i8], ptr %88, i64 0, i64 %90
  store i8 %86, ptr %91, align 1, !tbaa !28
  br label %92

92:                                               ; preds = %73
  %93 = load i32, ptr %7, align 4, !tbaa !17
  %94 = add i32 %93, 1
  store i32 %94, ptr %7, align 4, !tbaa !17
  br label %67, !llvm.loop !29

95:                                               ; preds = %67
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %96, i32 0, i32 8
  %98 = load ptr, ptr %97, align 8, !tbaa !9
  %99 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %98, i32 0, i32 22
  %100 = load ptr, ptr %99, align 8, !tbaa !24
  %101 = load i32, ptr %6, align 4, !tbaa !17
  %102 = zext i32 %101 to i64
  %103 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %100, i64 %102
  %104 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %103, i32 0, i32 3
  %105 = load i32, ptr %104, align 8, !tbaa !31
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %106, i32 0, i32 3
  store i32 %105, ptr %107, align 8, !tbaa !31
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %108, i32 0, i32 8
  %110 = load ptr, ptr %109, align 8, !tbaa !9
  %111 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %110, i32 0, i32 22
  %112 = load ptr, ptr %111, align 8, !tbaa !24
  %113 = load i32, ptr %6, align 4, !tbaa !17
  %114 = zext i32 %113 to i64
  %115 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %112, i64 %114
  %116 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %115, i32 0, i32 4
  %117 = load ptr, ptr %116, align 8, !tbaa !32
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %118, i32 0, i32 4
  store ptr %117, ptr %119, align 8, !tbaa !32
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %120, i32 0, i32 8
  %122 = load ptr, ptr %121, align 8, !tbaa !9
  %123 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %122, i32 0, i32 21
  %124 = load i32, ptr %123, align 4, !tbaa !23
  %125 = add i32 %124, 1
  store i32 %125, ptr %123, align 4, !tbaa !23
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %126, i32 0, i32 8
  %128 = load ptr, ptr %127, align 8, !tbaa !9
  %129 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %128, i32 0, i32 21
  %130 = load i32, ptr %129, align 4, !tbaa !23
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %131, i32 0, i32 8
  %133 = load ptr, ptr %132, align 8, !tbaa !9
  %134 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %133, i32 0, i32 2
  %135 = load ptr, ptr %134, align 8, !tbaa !33
  %136 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_TYPE, ptr %135, i32 0, i32 3
  %137 = load i32, ptr %136, align 4, !tbaa !34
  %138 = icmp uge i32 %130, %137
  br i1 %138, label %139, label %144

139:                                              ; preds = %95
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %140, i32 0, i32 8
  %142 = load ptr, ptr %141, align 8, !tbaa !9
  %143 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %142, i32 0, i32 21
  store i32 0, ptr %143, align 4, !tbaa !23
  br label %144

144:                                              ; preds = %139, %95
  %145 = load ptr, ptr %5, 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 !9
  %148 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %147, i32 0, i32 20
  %149 = load i32, ptr %148, align 8, !tbaa !22
  %150 = add i32 %149, -1
  store i32 %150, ptr %148, align 8, !tbaa !22
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  store i32 1, ptr %151, align 4, !tbaa !17
  call void @EXIT_CORE()
  store i32 0, ptr %8, align 4
  br label %152

152:                                              ; preds = %144, %35, %26, %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  %153 = load i32, ptr %8, align 4
  switch i32 %153, label %155 [
    i32 0, label %154
    i32 1, label %154
  ]

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

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


; 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._ERROR_STATUS_TYPE = type { i32, [64 x i8], i32, i32, ptr }

@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 void @EXIT_CORE() local_unnamed_addr #0

declare i32 @PORT_GETCORE() local_unnamed_addr #0

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

8:                                                ; preds = %2
  %9 = getelementptr inbounds i8, ptr %6, i64 267
  %10 = load i8, ptr %9, align 1, !tbaa !16
  %.not = icmp eq i8 %10, 0
  br i1 %.not, label %55, label %11

11:                                               ; preds = %8
  %12 = getelementptr inbounds i8, ptr %6, i64 480
  %13 = load i32, ptr %12, align 8, !tbaa !20
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %55, label %15

15:                                               ; preds = %11
  %16 = getelementptr inbounds i8, ptr %6, i64 484
  %17 = load i32, ptr %16, align 4, !tbaa !21
  %18 = getelementptr inbounds i8, ptr %6, i64 488
  %19 = load ptr, ptr %18, align 8, !tbaa !22
  %20 = zext i32 %17 to i64
  %21 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %19, i64 %20
  %22 = load i32, ptr %21, align 8, !tbaa !23
  store i32 %22, ptr %0, align 8, !tbaa !23
  %23 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %19, i64 %20, i32 2
  %24 = load i32, ptr %23, align 4, !tbaa !25
  %25 = getelementptr inbounds i8, ptr %0, i64 68
  store i32 %24, ptr %25, align 4, !tbaa !25
  %.not35 = icmp eq i32 %24, 0
  br i1 %.not35, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %15
  %26 = getelementptr inbounds i8, ptr %0, i64 4
  br label %27

27:                                               ; preds = %.lr.ph, %27
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %27 ]
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %28, i64 488
  %30 = load ptr, ptr %29, align 8, !tbaa !22
  %31 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %30, i64 %20, i32 1, i64 %indvars.iv
  %32 = load i8, ptr %31, align 1, !tbaa !26
  %33 = getelementptr inbounds [64 x i8], ptr %26, i64 0, i64 %indvars.iv
  store i8 %32, ptr %33, align 1, !tbaa !26
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = load i32, ptr %25, align 4, !tbaa !25
  %35 = zext i32 %34 to i64
  %36 = icmp ult i64 %indvars.iv.next, %35
  br i1 %36, label %27, label %._crit_edge.loopexit, !llvm.loop !27

._crit_edge.loopexit:                             ; preds = %27
  %.pre = load ptr, ptr %5, align 8, !tbaa !5
  %.phi.trans.insert = getelementptr inbounds i8, ptr %.pre, i64 488
  %.pre37 = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !22
  %.phi.trans.insert38 = getelementptr inbounds i8, ptr %.pre, i64 484
  %.pre39 = load i32, ptr %.phi.trans.insert38, align 4, !tbaa !21
  %.phi.trans.insert40 = getelementptr inbounds i8, ptr %.pre, i64 480
  %.pre41 = load i32, ptr %.phi.trans.insert40, align 8, !tbaa !20
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %15
  %37 = phi i32 [ %.pre41, %._crit_edge.loopexit ], [ %13, %15 ]
  %38 = phi i32 [ %.pre39, %._crit_edge.loopexit ], [ %17, %15 ]
  %39 = phi ptr [ %.pre37, %._crit_edge.loopexit ], [ %19, %15 ]
  %40 = phi ptr [ %.pre, %._crit_edge.loopexit ], [ %6, %15 ]
  %41 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %39, i64 %20, i32 3
  %42 = load i32, ptr %41, align 8, !tbaa !29
  %43 = getelementptr inbounds i8, ptr %0, i64 72
  store i32 %42, ptr %43, align 8, !tbaa !29
  %44 = getelementptr inbounds %struct._ERROR_STATUS_TYPE, ptr %39, i64 %20, i32 4
  %45 = load ptr, ptr %44, align 8, !tbaa !30
  %46 = getelementptr inbounds i8, ptr %0, i64 80
  store ptr %45, ptr %46, align 8, !tbaa !30
  %47 = getelementptr inbounds i8, ptr %40, i64 484
  %48 = add i32 %38, 1
  %49 = getelementptr inbounds i8, ptr %40, i64 16
  %50 = load ptr, ptr %49, align 8, !tbaa !31
  %51 = getelementptr inbounds i8, ptr %50, i64 20
  %52 = load i32, ptr %51, align 4, !tbaa !32
  %.not33 = icmp ult i32 %48, %52
  %spec.store.select = select i1 %.not33, i32 %48, i32 0
  store i32 %spec.store.select, ptr %47, align 4
  %53 = getelementptr inbounds i8, ptr %40, i64 480
  %54 = add i32 %37, -1
  store i32 %54, ptr %53, align 8, !tbaa !20
  br label %55

55:                                               ; preds = %11, %8, %2, %._crit_edge
  %.sink = phi i32 [ 1, %._crit_edge ], [ 6, %2 ], [ 5, %8 ], [ 2, %11 ]
  store i32 %.sink, ptr %1, align 4, !tbaa !34
  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, !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, !8, i64 267}
!17 = !{!"_PARTITION_INFORMATION_TYPE", !8, i64 0, !7, i64 8, !7, i64 16, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !8, i64 40, !10, i64 48, !12, i64 72, !11, i64 144, !7, i64 152, !7, i64 160, !18, i64 168, !13, i64 272, !11, i64 384, !19, i64 392, !15, i64 432, !15, i64 448, !15, i64 464, !11, i64 480, !11, i64 484, !7, i64 488, !11, i64 496, !7, i64 504, !11, i64 512, !7, i64 520, !11, i64 528, !7, i64 536, !11, i64 544, !7, i64 552, !11, i64 560, !7, i64 568, !11, i64 576, !7, i64 584}
!18 = !{!"_ERRORHANDLER_INFORMATION_TYPE", !8, i64 0, !7, i64 8, !11, i64 16, !12, i64 24, !8, i64 96, !8, i64 97, !8, i64 98, !8, i64 99, !11, i64 100}
!19 = !{!"_priorityqueueENTRY", !14, i64 0, !14, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!20 = !{!17, !11, i64 480}
!21 = !{!17, !11, i64 484}
!22 = !{!17, !7, i64 488}
!23 = !{!24, !11, i64 0}
!24 = !{!"_ERROR_STATUS_TYPE", !11, i64 0, !8, i64 4, !11, i64 68, !11, i64 72, !7, i64 80}
!25 = !{!24, !11, i64 68}
!26 = !{!8, !8, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!24, !11, i64 72}
!30 = !{!24, !7, i64 80}
!31 = !{!17, !7, i64 16}
!32 = !{!33, !11, i64 20}
!33 = !{!"_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}
!34 = !{!11, !11, i64 0}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass