; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal (Ip4BuildEfiRouteTable)

; 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._IP4_PROTOCOL = type { i32, %struct._EFI_IP4_PROTOCOL, ptr, i64, ptr, %struct._LIST_ENTRY, %struct.NET_MAP, %struct.NET_MAP, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct.EFI_LOCK, ptr, %struct._LIST_ENTRY, ptr, ptr, i32, ptr, i32, %struct.EFI_IP4_CONFIG_DATA }
%struct._EFI_IP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.NET_MAP = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64 }
%struct.EFI_LOCK = type { i64, i64, i32 }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.EFI_IP4_CONFIG_DATA = type { i8, i8, i8, i8, i8, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i8, i8, i8, i8, i32, i32 }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct._IP4_ROUTE_TABLE = type { i64, i32, [33 x %struct._LIST_ENTRY], ptr, %struct.IP4_ROUTE_CACHE }
%struct.IP4_ROUTE_CACHE = type { [31 x %struct._LIST_ENTRY] }
%struct.IP4_ROUTE_ENTRY = type { %struct._LIST_ENTRY, i64, i32, i32, i32, i32 }
%struct.EFI_IP4_ROUTE_TABLE = type { %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS }

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

declare ptr @AllocatePool(i64 noundef) #1

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

declare void @FreePool(ptr noundef) #1

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

18:                                               ; preds = %1
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %19, i32 0, i32 14
  %21 = load ptr, ptr %20, align 8, !tbaa !19
  call void @FreePool(ptr noundef %21)
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %22, i32 0, i32 14
  store ptr null, ptr %23, align 8, !tbaa !19
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %24, i32 0, i32 15
  store i32 0, ptr %25, align 8, !tbaa !20
  br label %26

26:                                               ; preds = %18, %1
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._IP4_ROUTE_TABLE, ptr %27, i32 0, i32 1
  %29 = load i32, ptr %28, align 8, !tbaa !21
  store i32 %29, ptr %8, align 4, !tbaa !23
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct._IP4_ROUTE_TABLE, ptr %30, i32 0, i32 3
  %32 = load ptr, ptr %31, align 8, !tbaa !24
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %42

34:                                               ; preds = %26
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct._IP4_ROUTE_TABLE, ptr %35, i32 0, i32 3
  %37 = load ptr, ptr %36, align 8, !tbaa !24
  %38 = getelementptr inbounds %struct._IP4_ROUTE_TABLE, ptr %37, i32 0, i32 1
  %39 = load i32, ptr %38, align 8, !tbaa !21
  %40 = load i32, ptr %8, align 4, !tbaa !23
  %41 = add i32 %40, %39
  store i32 %41, ptr %8, align 4, !tbaa !23
  br label %42

42:                                               ; preds = %34, %26
  %43 = load i32, ptr %8, align 4, !tbaa !23
  %44 = icmp eq i32 %43, 0
  br i1 %44, label %45, label %46

45:                                               ; preds = %42
  store i64 0, ptr %2, align 8
  store i32 1, ptr %10, align 4
  br label %145

46:                                               ; preds = %42
  %47 = load i32, ptr %8, align 4, !tbaa !23
  %48 = zext i32 %47 to i64
  %49 = mul i64 12, %48
  %50 = call ptr @AllocatePool(i64 noundef %49)
  store ptr %50, ptr %7, align 8, !tbaa !5
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = icmp eq ptr %51, null
  br i1 %52, label %53, label %54

53:                                               ; preds = %46
  store i64 -9223372036854775799, ptr %2, align 8
  store i32 1, ptr %10, align 4
  br label %145

54:                                               ; preds = %46
  store i32 0, ptr %8, align 4, !tbaa !23
  store i32 32, ptr %9, align 4, !tbaa !23
  br label %55

55:                                               ; preds = %135, %54
  %56 = load i32, ptr %9, align 4, !tbaa !23
  %57 = icmp sge i32 %56, 0
  br i1 %57, label %58, label %138

58:                                               ; preds = %55
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %59, i32 0, i32 13
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  store ptr %61, ptr %5, align 8, !tbaa !5
  br label %62

62:                                               ; preds = %130, %58
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = icmp ne ptr %63, null
  br i1 %64, label %65, label %134

65:                                               ; preds = %62
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct._IP4_ROUTE_TABLE, ptr %66, i32 0, i32 2
  %68 = load i32, ptr %9, align 4, !tbaa !23
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [33 x %struct._LIST_ENTRY], ptr %67, i64 0, i64 %69
  %71 = getelementptr inbounds %struct._LIST_ENTRY, ptr %70, i32 0, i32 0
  %72 = load ptr, ptr %71, align 8, !tbaa !25
  store ptr %72, ptr %4, align 8, !tbaa !5
  br label %73

73:                                               ; preds = %125, %65
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._IP4_ROUTE_TABLE, ptr %75, i32 0, i32 2
  %77 = load i32, ptr %9, align 4, !tbaa !23
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [33 x %struct._LIST_ENTRY], ptr %76, i64 0, i64 %78
  %80 = icmp ne ptr %74, %79
  br i1 %80, label %81, label %129

81:                                               ; preds = %73
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = ptrtoint ptr %82 to i64
  %84 = sub i64 %83, 0
  %85 = inttoptr i64 %84 to ptr
  store ptr %85, ptr %6, align 8, !tbaa !5
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.IP4_ROUTE_ENTRY, ptr %86, i32 0, i32 2
  %88 = load i32, ptr %87, align 8, !tbaa !26
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.IP4_ROUTE_ENTRY, ptr %89, i32 0, i32 3
  %91 = load i32, ptr %90, align 4, !tbaa !28
  %92 = and i32 %88, %91
  %93 = call i32 @SwapBytes32(i32 noundef %92)
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = load i32, ptr %8, align 4, !tbaa !23
  %96 = zext i32 %95 to i64
  %97 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %94, i64 %96
  %98 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %97, i32 0, i32 0
  %99 = getelementptr inbounds %struct.EFI_IPv4_ADDRESS, ptr %98, i32 0, i32 0
  %100 = getelementptr inbounds [4 x i8], ptr %99, i64 0, i64 0
  store i32 %93, ptr %100, align 1, !tbaa !23
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.IP4_ROUTE_ENTRY, ptr %101, i32 0, i32 3
  %103 = load i32, ptr %102, align 4, !tbaa !28
  %104 = call i32 @SwapBytes32(i32 noundef %103)
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  %106 = load i32, ptr %8, align 4, !tbaa !23
  %107 = zext i32 %106 to i64
  %108 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %105, i64 %107
  %109 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %108, i32 0, i32 1
  %110 = getelementptr inbounds %struct.EFI_IPv4_ADDRESS, ptr %109, i32 0, i32 0
  %111 = getelementptr inbounds [4 x i8], ptr %110, i64 0, i64 0
  store i32 %104, ptr %111, align 1, !tbaa !23
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.IP4_ROUTE_ENTRY, ptr %112, i32 0, i32 4
  %114 = load i32, ptr %113, align 8, !tbaa !29
  %115 = call i32 @SwapBytes32(i32 noundef %114)
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = load i32, ptr %8, align 4, !tbaa !23
  %118 = zext i32 %117 to i64
  %119 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %116, i64 %118
  %120 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %119, i32 0, i32 2
  %121 = getelementptr inbounds %struct.EFI_IPv4_ADDRESS, ptr %120, i32 0, i32 0
  %122 = getelementptr inbounds [4 x i8], ptr %121, i64 0, i64 0
  store i32 %115, ptr %122, align 1, !tbaa !23
  %123 = load i32, ptr %8, align 4, !tbaa !23
  %124 = add i32 %123, 1
  store i32 %124, ptr %8, align 4, !tbaa !23
  br label %125

125:                                              ; preds = %81
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct._LIST_ENTRY, ptr %126, i32 0, i32 0
  %128 = load ptr, ptr %127, align 8, !tbaa !25
  store ptr %128, ptr %4, align 8, !tbaa !5
  br label %73, !llvm.loop !30

129:                                              ; preds = %73
  br label %130

130:                                              ; preds = %129
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct._IP4_ROUTE_TABLE, ptr %131, i32 0, i32 3
  %133 = load ptr, ptr %132, align 8, !tbaa !24
  store ptr %133, ptr %5, align 8, !tbaa !5
  br label %62, !llvm.loop !32

134:                                              ; preds = %62
  br label %135

135:                                              ; preds = %134
  %136 = load i32, ptr %9, align 4, !tbaa !23
  %137 = add nsw i32 %136, -1
  store i32 %137, ptr %9, align 4, !tbaa !23
  br label %55, !llvm.loop !33

138:                                              ; preds = %55
  %139 = load ptr, ptr %7, align 8, !tbaa !5
  %140 = load ptr, ptr %3, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %140, i32 0, i32 14
  store ptr %139, ptr %141, align 8, !tbaa !19
  %142 = load i32, ptr %8, align 4, !tbaa !23
  %143 = load ptr, ptr %3, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %143, i32 0, i32 15
  store i32 %142, ptr %144, align 8, !tbaa !20
  store i64 0, ptr %2, align 8
  store i32 1, ptr %10, align 4
  br label %145

145:                                              ; preds = %138, %53, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %146 = load i64, ptr %2, align 8
  ret i64 %146
}

declare i32 @SwapBytes32(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, !6, i64 272}
!10 = !{!"_IP4_PROTOCOL", !11, i64 0, !12, i64 8, !6, i64 72, !13, i64 80, !6, i64 88, !14, i64 96, !15, i64 112, !15, i64 152, !14, i64 192, !14, i64 208, !16, i64 224, !6, i64 248, !14, i64 256, !6, i64 272, !6, i64 280, !11, i64 288, !6, i64 296, !11, i64 304, !17, i64 308}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_EFI_IP4_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!15 = !{!"", !14, i64 0, !14, i64 16, !13, i64 32}
!16 = !{!"", !13, i64 0, !13, i64 8, !11, i64 16}
!17 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !18, i64 6, !18, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !11, i64 20, !11, i64 24}
!18 = !{!"", !7, i64 0}
!19 = !{!10, !6, i64 280}
!20 = !{!10, !11, i64 288}
!21 = !{!22, !11, i64 8}
!22 = !{!"_IP4_ROUTE_TABLE", !13, i64 0, !11, i64 8, !7, i64 16, !6, i64 544, !18, i64 552}
!23 = !{!11, !11, i64 0}
!24 = !{!22, !6, i64 544}
!25 = !{!14, !6, i64 0}
!26 = !{!27, !11, i64 24}
!27 = !{!"", !14, i64 0, !13, i64 16, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36}
!28 = !{!27, !11, i64 28}
!29 = !{!27, !11, i64 32}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31}
!33 = distinct !{!33, !31}


; 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._LIST_ENTRY = type { ptr, ptr }
%struct.EFI_IP4_ROUTE_TABLE = type { %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }

declare ptr @AllocatePool(i64 noundef) local_unnamed_addr #0

declare void @FreePool(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775799, 1) i64 @Ip4BuildEfiRouteTable(ptr nocapture noundef %0) local_unnamed_addr #1 {
  %2 = getelementptr inbounds i8, ptr %0, i64 272
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 280
  %5 = load ptr, ptr %4, align 8, !tbaa !18
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %8, label %6

6:                                                ; preds = %1
  tail call void @FreePool(ptr noundef nonnull %5) #2
  store ptr null, ptr %4, align 8, !tbaa !18
  %7 = getelementptr inbounds i8, ptr %0, i64 288
  store i32 0, ptr %7, align 8, !tbaa !19
  br label %8

8:                                                ; preds = %6, %1
  %9 = getelementptr inbounds i8, ptr %3, i64 8
  %10 = load i32, ptr %9, align 8, !tbaa !20
  %11 = getelementptr inbounds i8, ptr %3, i64 544
  %12 = load ptr, ptr %11, align 8, !tbaa !22
  %.not46 = icmp eq ptr %12, null
  br i1 %.not46, label %17, label %13

13:                                               ; preds = %8
  %14 = getelementptr inbounds i8, ptr %12, i64 8
  %15 = load i32, ptr %14, align 8, !tbaa !20
  %16 = add i32 %15, %10
  br label %17

17:                                               ; preds = %13, %8
  %.039 = phi i32 [ %16, %13 ], [ %10, %8 ]
  %18 = icmp eq i32 %.039, 0
  br i1 %18, label %46, label %19

19:                                               ; preds = %17
  %20 = zext i32 %.039 to i64
  %21 = mul nuw nsw i64 %20, 12
  %22 = tail call ptr @AllocatePool(i64 noundef %21) #2
  %23 = icmp eq ptr %22, null
  br i1 %23, label %46, label %.preheader49

.preheader49:                                     ; preds = %19
  %24 = load ptr, ptr %2, align 8, !tbaa !23
  %25 = icmp eq ptr %24, null
  br i1 %25, label %.split.us, label %.preheader

.preheaderthread-pre-split:                       ; preds = %._crit_edge59
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %.04254.pr = load ptr, ptr %2, align 8, !tbaa !23
  br label %.preheader

.preheader:                                       ; preds = %.preheader49, %.preheaderthread-pre-split
  %.04254 = phi ptr [ %.04254.pr, %.preheaderthread-pre-split ], [ %24, %.preheader49 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.preheaderthread-pre-split ], [ 32, %.preheader49 ]
  %.161 = phi i32 [ %.2.lcssa, %.preheaderthread-pre-split ], [ 0, %.preheader49 ]
  %.not4755 = icmp eq ptr %.04254, null
  br i1 %.not4755, label %._crit_edge59, label %.lr.ph58

.lr.ph58:                                         ; preds = %.preheader, %._crit_edge
  %.04257 = phi ptr [ %.042, %._crit_edge ], [ %.04254, %.preheader ]
  %.256 = phi i32 [ %.3.lcssa, %._crit_edge ], [ %.161, %.preheader ]
  %26 = getelementptr inbounds i8, ptr %.04257, i64 16
  %27 = getelementptr inbounds [33 x %struct._LIST_ENTRY], ptr %26, i64 0, i64 %indvars.iv
  %.04150 = load ptr, ptr %27, align 8, !tbaa !24
  %.not4851 = icmp eq ptr %.04150, %27
  br i1 %.not4851, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph58, %.lr.ph
  %.04153 = phi ptr [ %.041, %.lr.ph ], [ %.04150, %.lr.ph58 ]
  %.352 = phi i32 [ %43, %.lr.ph ], [ %.256, %.lr.ph58 ]
  %28 = getelementptr inbounds i8, ptr %.04153, i64 24
  %29 = load i32, ptr %28, align 8, !tbaa !25
  %30 = getelementptr inbounds i8, ptr %.04153, i64 28
  %31 = load i32, ptr %30, align 4, !tbaa !27
  %32 = and i32 %31, %29
  %33 = tail call i32 @SwapBytes32(i32 noundef %32) #2
  %34 = zext i32 %.352 to i64
  %35 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %22, i64 %34
  store i32 %33, ptr %35, align 1, !tbaa !28
  %36 = load i32, ptr %30, align 4, !tbaa !27
  %37 = tail call i32 @SwapBytes32(i32 noundef %36) #2
  %38 = getelementptr inbounds i8, ptr %35, i64 4
  store i32 %37, ptr %38, align 1, !tbaa !28
  %39 = getelementptr inbounds i8, ptr %.04153, i64 32
  %40 = load i32, ptr %39, align 8, !tbaa !29
  %41 = tail call i32 @SwapBytes32(i32 noundef %40) #2
  %42 = getelementptr inbounds i8, ptr %35, i64 8
  store i32 %41, ptr %42, align 1, !tbaa !28
  %43 = add i32 %.352, 1
  %.041 = load ptr, ptr %.04153, align 8, !tbaa !24
  %.not48 = icmp eq ptr %.041, %27
  br i1 %.not48, label %._crit_edge, label %.lr.ph, !llvm.loop !30

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph58
  %.3.lcssa = phi i32 [ %.256, %.lr.ph58 ], [ %43, %.lr.ph ]
  %44 = getelementptr inbounds i8, ptr %.04257, i64 544
  %.042 = load ptr, ptr %44, align 8, !tbaa !23
  %.not47 = icmp eq ptr %.042, null
  br i1 %.not47, label %._crit_edge59, label %.lr.ph58, !llvm.loop !32

._crit_edge59:                                    ; preds = %._crit_edge, %.preheader
  %.2.lcssa = phi i32 [ %.161, %.preheader ], [ %.3.lcssa, %._crit_edge ]
  %.not65 = icmp eq i64 %indvars.iv, 0
  br i1 %.not65, label %.split.us, label %.preheaderthread-pre-split, !llvm.loop !33

.split.us:                                        ; preds = %._crit_edge59, %.preheader49
  %.us-phi = phi i32 [ 0, %.preheader49 ], [ %.2.lcssa, %._crit_edge59 ]
  store ptr %22, ptr %4, align 8, !tbaa !18
  %45 = getelementptr inbounds i8, ptr %0, i64 288
  store i32 %.us-phi, ptr %45, align 8, !tbaa !19
  br label %46

46:                                               ; preds = %19, %17, %.split.us
  %.040 = phi i64 [ 0, %.split.us ], [ 0, %17 ], [ -9223372036854775799, %19 ]
  ret i64 %.040
}

declare i32 @SwapBytes32(i32 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 272}
!6 = !{!"_IP4_PROTOCOL", !7, i64 0, !10, i64 8, !11, i64 72, !12, i64 80, !11, i64 88, !13, i64 96, !14, i64 112, !14, i64 152, !13, i64 192, !13, i64 208, !15, i64 224, !11, i64 248, !13, i64 256, !11, i64 272, !11, i64 280, !7, i64 288, !11, i64 296, !7, i64 304, !16, i64 308}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_EFI_IP4_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"long long", !8, i64 0}
!13 = !{!"_LIST_ENTRY", !11, i64 0, !11, i64 8}
!14 = !{!"", !13, i64 0, !13, i64 16, !12, i64 32}
!15 = !{!"", !12, i64 0, !12, i64 8, !7, i64 16}
!16 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !17, i64 6, !17, i64 10, !8, i64 14, !8, i64 15, !8, i64 16, !8, i64 17, !7, i64 20, !7, i64 24}
!17 = !{!"", !8, i64 0}
!18 = !{!6, !11, i64 280}
!19 = !{!6, !7, i64 288}
!20 = !{!21, !7, i64 8}
!21 = !{!"_IP4_ROUTE_TABLE", !12, i64 0, !7, i64 8, !8, i64 16, !11, i64 544, !17, i64 552}
!22 = !{!21, !11, i64 544}
!23 = !{!11, !11, i64 0}
!24 = !{!13, !11, i64 0}
!25 = !{!26, !7, i64 24}
!26 = !{!"", !13, i64 0, !12, i64 16, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36}
!27 = !{!26, !7, i64 28}
!28 = !{!7, !7, i64 0}
!29 = !{!26, !7, i64 32}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31}
!33 = distinct !{!33, !31, !34}
!34 = !{!"llvm.loop.unswitch.partial.disable"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass