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

; 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.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.EFI_UDP4_CONFIG_DATA = type { i8, i8, i8, i8, i8, i8, i8, i32, i32, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, %struct.EFI_IPv4_ADDRESS, i16 }
%struct._MTFTP4_PROTOCOL = type { i32, %struct._LIST_ENTRY, %struct._EFI_MTFTP4_PROTOCOL, i64, i8, ptr, ptr, %struct.EFI_MTFTP4_CONFIG_DATA, ptr, %struct.MTFTP4_OPTION, i16, i16, i16, %struct._LIST_ENTRY, i32, i16, i16, i32, ptr, ptr, i32, i32, i32, i32, i32, i16, i8, ptr }
%struct._EFI_MTFTP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_MTFTP4_CONFIG_DATA = type { i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, i16, i16 }
%struct.MTFTP4_OPTION = type { i16, i8, i32, i32, i16, i8, i32 }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct._UDP_IO = type { i32, %struct._LIST_ENTRY, i64, i8, ptr, ptr, ptr, %struct.EFI_SIMPLE_NETWORK_MODE, %struct._LIST_ENTRY, ptr, %union.anon, %union.anon.0 }
%struct.EFI_SIMPLE_NETWORK_MODE = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [16 x %struct.EFI_MAC_ADDRESS], %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, i8, i8, i8, i8, i8 }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%union.anon = type { ptr }
%union.anon.0 = type { %struct.EFI_UDP6_CONFIG_DATA }
%struct.EFI_UDP6_CONFIG_DATA = type { i8, i8, i8, i8, i8, i32, i32, %struct.EFI_IPv6_ADDRESS, i16, %struct.EFI_IPv6_ADDRESS, i16 }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }
%struct._EFI_UDP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@mZeroIp4Addr = external global %struct.EFI_IPv4_ADDRESS, align 1

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

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

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i64 @Mtftp4RrqConfigMcastPort(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %struct.EFI_UDP4_CONFIG_DATA, align 4
  %9 = alloca %struct.EFI_IPv4_ADDRESS, align 1
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 36, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %13, ptr %6, align 8, !tbaa !5
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %14, i32 0, i32 7
  store ptr %15, ptr %7, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %8, i32 0, i32 0
  store i8 0, ptr %16, align 4, !tbaa !9
  %17 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %8, i32 0, i32 1
  store i8 0, ptr %17, align 1, !tbaa !14
  %18 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %8, i32 0, i32 2
  store i8 0, ptr %18, align 2, !tbaa !15
  %19 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %8, i32 0, i32 3
  store i8 0, ptr %19, align 1, !tbaa !16
  %20 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %8, i32 0, i32 4
  store i8 0, ptr %20, align 4, !tbaa !17
  %21 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %8, i32 0, i32 5
  store i8 64, ptr %21, align 1, !tbaa !18
  %22 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %8, i32 0, i32 6
  store i8 0, ptr %22, align 2, !tbaa !19
  %23 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %8, i32 0, i32 7
  store i32 0, ptr %23, align 4, !tbaa !20
  %24 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %8, i32 0, i32 8
  store i32 0, ptr %24, align 4, !tbaa !21
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.EFI_MTFTP4_CONFIG_DATA, ptr %25, i32 0, i32 0
  %27 = load i8, ptr %26, align 2, !tbaa !22
  %28 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %8, i32 0, i32 9
  store i8 %27, ptr %28, align 4, !tbaa !24
  %29 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %8, i32 0, i32 10
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.EFI_MTFTP4_CONFIG_DATA, ptr %30, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %29, ptr align 1 %31, i64 4, i1 false), !tbaa.struct !25
  %32 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %8, i32 0, i32 11
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.EFI_MTFTP4_CONFIG_DATA, ptr %33, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %32, ptr align 1 %34, i64 4, i1 false), !tbaa.struct !25
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %35, i32 0, i32 25
  %37 = load i16, ptr %36, align 4, !tbaa !27
  %38 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %8, i32 0, i32 12
  store i16 %37, ptr %38, align 2, !tbaa !33
  %39 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %8, i32 0, i32 14
  store i16 0, ptr %39, align 4, !tbaa !34
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %40, i32 0, i32 14
  %42 = load i32, ptr %41, align 8, !tbaa !35
  %43 = call i32 @SwapBytes32(i32 noundef %42)
  store i32 %43, ptr %11, align 4, !tbaa !36
  %44 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %8, i32 0, i32 13
  %45 = call ptr @CopyMem(ptr noundef %44, ptr noundef %11, i64 noundef 4)
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct._UDP_IO, ptr %46, i32 0, i32 10
  %48 = load ptr, ptr %47, align 8, !tbaa !26
  %49 = getelementptr inbounds %struct._EFI_UDP4_PROTOCOL, ptr %48, i32 0, i32 1
  %50 = load ptr, ptr %49, align 8, !tbaa !37
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct._UDP_IO, ptr %51, i32 0, i32 10
  %53 = load ptr, ptr %52, align 8, !tbaa !26
  %54 = call i64 %50(ptr noundef %53, ptr noundef %8)
  store i64 %54, ptr %10, align 8, !tbaa !39
  %55 = load i64, ptr %10, align 8, !tbaa !39
  %56 = icmp slt i64 %55, 0
  br i1 %56, label %57, label %59

57:                                               ; preds = %2
  %58 = load i64, ptr %10, align 8, !tbaa !39
  store i64 %58, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %110

59:                                               ; preds = %2
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.EFI_MTFTP4_CONFIG_DATA, ptr %60, i32 0, i32 0
  %62 = load i8, ptr %61, align 2, !tbaa !22
  %63 = icmp ne i8 %62, 0
  br i1 %63, label %95, label %64

64:                                               ; preds = %59
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.EFI_MTFTP4_CONFIG_DATA, ptr %65, i32 0, i32 4
  %67 = call i64 @CompareMem(ptr noundef @mZeroIp4Addr, ptr noundef %66, i64 noundef 4)
  %68 = icmp eq i64 %67, 0
  br i1 %68, label %95, label %69

69:                                               ; preds = %64
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._UDP_IO, ptr %70, i32 0, i32 10
  %72 = load ptr, ptr %71, align 8, !tbaa !26
  %73 = getelementptr inbounds %struct._EFI_UDP4_PROTOCOL, ptr %72, i32 0, i32 3
  %74 = load ptr, ptr %73, align 8, !tbaa !40
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._UDP_IO, ptr %75, i32 0, i32 10
  %77 = load ptr, ptr %76, align 8, !tbaa !26
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.EFI_MTFTP4_CONFIG_DATA, ptr %78, i32 0, i32 4
  %80 = call i64 %74(ptr noundef %77, i8 noundef zeroext 0, ptr noundef @mZeroIp4Addr, ptr noundef @mZeroIp4Addr, ptr noundef %79)
  store i64 %80, ptr %10, align 8, !tbaa !39
  %81 = load i64, ptr %10, align 8, !tbaa !39
  %82 = icmp slt i64 %81, 0
  br i1 %82, label %83, label %94

83:                                               ; preds = %69
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._UDP_IO, ptr %84, i32 0, i32 10
  %86 = load ptr, ptr %85, align 8, !tbaa !26
  %87 = getelementptr inbounds %struct._EFI_UDP4_PROTOCOL, ptr %86, i32 0, i32 1
  %88 = load ptr, ptr %87, align 8, !tbaa !37
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct._UDP_IO, ptr %89, i32 0, i32 10
  %91 = load ptr, ptr %90, align 8, !tbaa !26
  %92 = call i64 %88(ptr noundef %91, ptr noundef null)
  %93 = load i64, ptr %10, align 8, !tbaa !39
  store i64 %93, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %110

94:                                               ; preds = %69
  br label %95

95:                                               ; preds = %94, %64, %59
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %96, i32 0, i32 24
  %98 = load i32, ptr %97, align 8, !tbaa !41
  %99 = call i32 @SwapBytes32(i32 noundef %98)
  store i32 %99, ptr %11, align 4, !tbaa !36
  %100 = call ptr @CopyMem(ptr noundef %9, ptr noundef %11, i64 noundef 4)
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._UDP_IO, ptr %101, i32 0, i32 10
  %103 = load ptr, ptr %102, align 8, !tbaa !26
  %104 = getelementptr inbounds %struct._EFI_UDP4_PROTOCOL, ptr %103, i32 0, i32 2
  %105 = load ptr, ptr %104, align 8, !tbaa !42
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._UDP_IO, ptr %106, i32 0, i32 10
  %108 = load ptr, ptr %107, align 8, !tbaa !26
  %109 = call i64 %105(ptr noundef %108, i8 noundef zeroext 1, ptr noundef %9)
  store i64 %109, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %110

110:                                              ; preds = %95, %83, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 36, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %111 = load i64, ptr %3, align 8
  ret i64 %111
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

declare i32 @SwapBytes32(i32 noundef) #1

declare i64 @CompareMem(ptr noundef, ptr noundef, i64 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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, !7, i64 0}
!10 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !11, i64 8, !11, i64 12, !7, i64 16, !12, i64 17, !12, i64 21, !13, i64 26, !12, i64 28, !13, i64 32}
!11 = !{!"int", !7, i64 0}
!12 = !{!"", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !7, i64 1}
!15 = !{!10, !7, i64 2}
!16 = !{!10, !7, i64 3}
!17 = !{!10, !7, i64 4}
!18 = !{!10, !7, i64 5}
!19 = !{!10, !7, i64 6}
!20 = !{!10, !11, i64 8}
!21 = !{!10, !11, i64 12}
!22 = !{!23, !7, i64 0}
!23 = !{!"", !7, i64 0, !12, i64 1, !12, i64 5, !13, i64 10, !12, i64 12, !12, i64 16, !13, i64 20, !13, i64 22, !13, i64 24}
!24 = !{!10, !7, i64 16}
!25 = !{i64 0, i64 4, !26}
!26 = !{!7, !7, i64 0}
!27 = !{!28, !13, i64 260}
!28 = !{!"_MTFTP4_PROTOCOL", !11, i64 0, !29, i64 8, !30, i64 24, !31, i64 88, !7, i64 96, !6, i64 104, !6, i64 112, !23, i64 120, !6, i64 152, !32, i64 160, !13, i64 180, !13, i64 182, !13, i64 184, !29, i64 192, !11, i64 208, !13, i64 212, !13, i64 214, !11, i64 216, !6, i64 224, !6, i64 232, !11, i64 240, !11, i64 244, !11, i64 248, !11, i64 252, !11, i64 256, !13, i64 260, !7, i64 262, !6, i64 264}
!29 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!30 = !{!"_EFI_MTFTP4_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}
!31 = !{!"long long", !7, i64 0}
!32 = !{!"", !13, i64 0, !7, i64 2, !11, i64 4, !11, i64 8, !13, i64 12, !7, i64 14, !11, i64 16}
!33 = !{!10, !13, i64 26}
!34 = !{!10, !13, i64 32}
!35 = !{!28, !11, i64 208}
!36 = !{!11, !11, i64 0}
!37 = !{!38, !6, i64 8}
!38 = !{!"_EFI_UDP4_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}
!39 = !{!31, !31, i64 0}
!40 = !{!38, !6, i64 24}
!41 = !{!28, !11, i64 256}
!42 = !{!38, !6, i64 16}


; 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.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.EFI_UDP4_CONFIG_DATA = type { i8, i8, i8, i8, i8, i8, i8, i32, i32, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, %struct.EFI_IPv4_ADDRESS, i16 }

@mZeroIp4Addr = external global %struct.EFI_IPv4_ADDRESS, align 1

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

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

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i64 @Mtftp4RrqConfigMcastPort(ptr nocapture noundef readonly %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca %struct.EFI_UDP4_CONFIG_DATA, align 4
  %4 = alloca %struct.EFI_IPv4_ADDRESS, align 1
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %6 = getelementptr inbounds i8, ptr %1, i64 120
  %7 = getelementptr inbounds i8, ptr %3, i64 5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(5) %3, i8 0, i64 5, i1 false)
  store i8 64, ptr %7, align 1, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %3, i64 6
  store i8 0, ptr %8, align 2, !tbaa !12
  %9 = getelementptr inbounds i8, ptr %3, i64 8
  store i32 0, ptr %9, align 4, !tbaa !13
  %10 = getelementptr inbounds i8, ptr %3, i64 12
  store i32 0, ptr %10, align 4, !tbaa !14
  %11 = load i8, ptr %6, align 2, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %3, i64 16
  store i8 %11, ptr %12, align 4, !tbaa !17
  %13 = getelementptr inbounds i8, ptr %3, i64 17
  %14 = getelementptr inbounds i8, ptr %1, i64 121
  %15 = load <2 x i32>, ptr %14, align 1, !tbaa !18
  store <2 x i32> %15, ptr %13, align 1, !tbaa !18
  %16 = getelementptr inbounds i8, ptr %1, i64 260
  %17 = load i16, ptr %16, align 4, !tbaa !19
  %18 = getelementptr inbounds i8, ptr %3, i64 26
  store i16 %17, ptr %18, align 2, !tbaa !26
  %19 = getelementptr inbounds i8, ptr %3, i64 32
  store i16 0, ptr %19, align 4, !tbaa !27
  %20 = getelementptr inbounds i8, ptr %1, i64 208
  %21 = load i32, ptr %20, align 8, !tbaa !28
  %22 = tail call i32 @SwapBytes32(i32 noundef %21) #4
  store i32 %22, ptr %5, align 4, !tbaa !29
  %23 = getelementptr inbounds i8, ptr %3, i64 28
  %24 = call ptr @CopyMem(ptr noundef nonnull %23, ptr noundef nonnull %5, i64 noundef 4) #4
  %25 = getelementptr inbounds i8, ptr %0, i64 744
  %26 = load ptr, ptr %25, align 8, !tbaa !18
  %27 = getelementptr inbounds i8, ptr %26, i64 8
  %28 = load ptr, ptr %27, align 8, !tbaa !30
  %29 = call i64 %28(ptr noundef %26, ptr noundef nonnull %3) #4
  %30 = icmp slt i64 %29, 0
  br i1 %30, label %57, label %31

31:                                               ; preds = %2
  %32 = load i8, ptr %6, align 2, !tbaa !15
  %.not = icmp eq i8 %32, 0
  br i1 %.not, label %33, label %48

33:                                               ; preds = %31
  %34 = getelementptr inbounds i8, ptr %1, i64 132
  %35 = call i64 @CompareMem(ptr noundef nonnull @mZeroIp4Addr, ptr noundef nonnull %34, i64 noundef 4) #4
  %36 = icmp eq i64 %35, 0
  br i1 %36, label %48, label %37

37:                                               ; preds = %33
  %38 = load ptr, ptr %25, align 8, !tbaa !18
  %39 = getelementptr inbounds i8, ptr %38, i64 24
  %40 = load ptr, ptr %39, align 8, !tbaa !32
  %41 = call i64 %40(ptr noundef %38, i8 noundef zeroext 0, ptr noundef nonnull @mZeroIp4Addr, ptr noundef nonnull @mZeroIp4Addr, ptr noundef nonnull %34) #4
  %42 = icmp slt i64 %41, 0
  br i1 %42, label %43, label %48

43:                                               ; preds = %37
  %44 = load ptr, ptr %25, align 8, !tbaa !18
  %45 = getelementptr inbounds i8, ptr %44, i64 8
  %46 = load ptr, ptr %45, align 8, !tbaa !30
  %47 = call i64 %46(ptr noundef %44, ptr noundef null) #4
  br label %57

48:                                               ; preds = %37, %33, %31
  %49 = getelementptr inbounds i8, ptr %1, i64 256
  %50 = load i32, ptr %49, align 8, !tbaa !33
  %51 = call i32 @SwapBytes32(i32 noundef %50) #4
  store i32 %51, ptr %5, align 4, !tbaa !29
  %52 = call ptr @CopyMem(ptr noundef nonnull %4, ptr noundef nonnull %5, i64 noundef 4) #4
  %53 = load ptr, ptr %25, align 8, !tbaa !18
  %54 = getelementptr inbounds i8, ptr %53, i64 16
  %55 = load ptr, ptr %54, align 8, !tbaa !34
  %56 = call i64 %55(ptr noundef %53, i8 noundef zeroext 1, ptr noundef nonnull %4) #4
  br label %57

57:                                               ; preds = %2, %48, %43
  %.0 = phi i64 [ %56, %48 ], [ %41, %43 ], [ %29, %2 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %3) #4
  ret i64 %.0
}

declare i32 @SwapBytes32(i32 noundef) local_unnamed_addr #1

declare i64 @CompareMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 5}
!6 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !9, i64 8, !9, i64 12, !7, i64 16, !10, i64 17, !10, i64 21, !11, i64 26, !10, i64 28, !11, i64 32}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"", !7, i64 0}
!11 = !{!"short", !7, i64 0}
!12 = !{!6, !7, i64 6}
!13 = !{!6, !9, i64 8}
!14 = !{!6, !9, i64 12}
!15 = !{!16, !7, i64 0}
!16 = !{!"", !7, i64 0, !10, i64 1, !10, i64 5, !11, i64 10, !10, i64 12, !10, i64 16, !11, i64 20, !11, i64 22, !11, i64 24}
!17 = !{!6, !7, i64 16}
!18 = !{!7, !7, i64 0}
!19 = !{!20, !11, i64 260}
!20 = !{!"_MTFTP4_PROTOCOL", !9, i64 0, !21, i64 8, !23, i64 24, !24, i64 88, !7, i64 96, !22, i64 104, !22, i64 112, !16, i64 120, !22, i64 152, !25, i64 160, !11, i64 180, !11, i64 182, !11, i64 184, !21, i64 192, !9, i64 208, !11, i64 212, !11, i64 214, !9, i64 216, !22, i64 224, !22, i64 232, !9, i64 240, !9, i64 244, !9, i64 248, !9, i64 252, !9, i64 256, !11, i64 260, !7, i64 262, !22, i64 264}
!21 = !{!"_LIST_ENTRY", !22, i64 0, !22, i64 8}
!22 = !{!"any pointer", !7, i64 0}
!23 = !{!"_EFI_MTFTP4_PROTOCOL", !22, i64 0, !22, i64 8, !22, i64 16, !22, i64 24, !22, i64 32, !22, i64 40, !22, i64 48, !22, i64 56}
!24 = !{!"long long", !7, i64 0}
!25 = !{!"", !11, i64 0, !7, i64 2, !9, i64 4, !9, i64 8, !11, i64 12, !7, i64 14, !9, i64 16}
!26 = !{!6, !11, i64 26}
!27 = !{!6, !11, i64 32}
!28 = !{!20, !9, i64 208}
!29 = !{!9, !9, i64 0}
!30 = !{!31, !22, i64 8}
!31 = !{!"_EFI_UDP4_PROTOCOL", !22, i64 0, !22, i64 8, !22, i64 16, !22, i64 24, !22, i64 32, !22, i64 40, !22, i64 48, !22, i64 56}
!32 = !{!31, !22, i64 24}
!33 = !{!20, !9, i64 256}
!34 = !{!31, !22, i64 16}


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