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

; 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._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.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.MTFTP4_OPTION = type { i16, i8, i32, i32, i16, i8, i32 }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.EFI_BOOT_SERVICES = type { %struct.EFI_TABLE_HEADER, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, i32, i32 }

@gBS = external global ptr, align 8
@.str = external hidden unnamed_addr constant [155 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @Mtftp4CleanOperation(ptr noundef, i64 noundef) #0

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

declare zeroext i8 @DebugAssertEnabled() #2

declare void @DebugAssert(ptr noundef, i64 noundef, ptr noundef) #2

declare ptr @ZeroMem(ptr noundef, i64 noundef) #2

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

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

declare zeroext i8 @NetIp4IsUnicast(i32 noundef, i32 noundef) #2

declare i32 @SwapBytes32(i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i64 @EfiMtftp4Configure(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %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) #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
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = icmp eq ptr %13, null
  br i1 %14, label %15, label %16

15:                                               ; preds = %2
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %143

16:                                               ; preds = %2
  %17 = call zeroext i8 @DebugAssertEnabled()
  %18 = zext i8 %17 to i32
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %20, label %30

20:                                               ; preds = %16
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = ptrtoint ptr %21 to i64
  %23 = sub i64 %22, ptrtoint (ptr getelementptr inbounds (%struct._MTFTP4_PROTOCOL, ptr null, i32 0, i32 2) to i64)
  %24 = inttoptr i64 %23 to ptr
  %25 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %24, i32 0, i32 0
  %26 = load i32, ptr %25, align 8, !tbaa !9
  %27 = icmp ne i32 %26, 1886676596
  br i1 %27, label %28, label %30

28:                                               ; preds = %20
  call void @DebugAssert(ptr noundef @.str, i64 noundef 641, ptr noundef @.str.5)
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  br label %35

30:                                               ; preds = %20, %16
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = ptrtoint ptr %31 to i64
  %33 = sub i64 %32, ptrtoint (ptr getelementptr inbounds (%struct._MTFTP4_PROTOCOL, ptr null, i32 0, i32 2) to i64)
  %34 = inttoptr i64 %33 to ptr
  br label %35

35:                                               ; preds = %30, %28
  %36 = phi ptr [ %29, %28 ], [ %34, %30 ]
  store ptr %36, ptr %6, align 8, !tbaa !5
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = icmp eq ptr %37, null
  br i1 %38, label %39, label %54

39:                                               ; preds = %35
  %40 = load ptr, ptr @gBS, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %40, i32 0, i32 1
  %42 = load ptr, ptr %41, align 8, !tbaa !19
  %43 = call i64 %42(i64 noundef 8)
  store i64 %43, ptr %7, align 8, !tbaa !22
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  call void @Mtftp4CleanOperation(ptr noundef %44, i64 noundef -9223372036854775787)
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %45, i32 0, i32 7
  %47 = call ptr @ZeroMem(ptr noundef %46, i64 noundef 26)
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %48, i32 0, i32 3
  store i64 0, ptr %49, align 8, !tbaa !23
  %50 = load ptr, ptr @gBS, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %50, i32 0, i32 2
  %52 = load ptr, ptr %51, align 8, !tbaa !24
  %53 = load i64, ptr %7, align 8, !tbaa !22
  call void %52(i64 noundef %53)
  br label %142

54:                                               ; preds = %35
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.EFI_MTFTP4_CONFIG_DATA, ptr %55, i32 0, i32 1
  %57 = call ptr @CopyMem(ptr noundef %8, ptr noundef %56, i64 noundef 4)
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.EFI_MTFTP4_CONFIG_DATA, ptr %58, i32 0, i32 2
  %60 = call ptr @CopyMem(ptr noundef %9, ptr noundef %59, i64 noundef 4)
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.EFI_MTFTP4_CONFIG_DATA, ptr %61, i32 0, i32 4
  %63 = call ptr @CopyMem(ptr noundef %10, ptr noundef %62, i64 noundef 4)
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.EFI_MTFTP4_CONFIG_DATA, ptr %64, i32 0, i32 5
  %66 = call ptr @CopyMem(ptr noundef %11, ptr noundef %65, i64 noundef 4)
  %67 = load i32, ptr %8, align 4, !tbaa !25
  %68 = call i32 @SwapBytes32(i32 noundef %67)
  store i32 %68, ptr %8, align 4, !tbaa !25
  %69 = load i32, ptr %9, align 4, !tbaa !25
  %70 = call i32 @SwapBytes32(i32 noundef %69)
  store i32 %70, ptr %9, align 4, !tbaa !25
  %71 = load i32, ptr %10, align 4, !tbaa !25
  %72 = call i32 @SwapBytes32(i32 noundef %71)
  store i32 %72, ptr %10, align 4, !tbaa !25
  %73 = load i32, ptr %11, align 4, !tbaa !25
  %74 = call i32 @SwapBytes32(i32 noundef %73)
  store i32 %74, ptr %11, align 4, !tbaa !25
  %75 = load i32, ptr %11, align 4, !tbaa !25
  %76 = call zeroext i8 @NetIp4IsUnicast(i32 noundef %75, i32 noundef 0)
  %77 = icmp ne i8 %76, 0
  br i1 %77, label %79, label %78

78:                                               ; preds = %54
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %143

79:                                               ; preds = %54
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.EFI_MTFTP4_CONFIG_DATA, ptr %80, i32 0, i32 0
  %82 = load i8, ptr %81, align 2, !tbaa !26
  %83 = icmp ne i8 %82, 0
  br i1 %83, label %94, label %84

84:                                               ; preds = %79
  %85 = load i32, ptr %9, align 4, !tbaa !25
  %86 = call i64 @NetGetMaskLength(i32 noundef %85)
  %87 = icmp ne i64 %86, 33
  br i1 %87, label %88, label %93

88:                                               ; preds = %84
  %89 = load i32, ptr %8, align 4, !tbaa !25
  %90 = load i32, ptr %9, align 4, !tbaa !25
  %91 = call zeroext i8 @NetIp4IsUnicast(i32 noundef %89, i32 noundef %90)
  %92 = icmp ne i8 %91, 0
  br i1 %92, label %94, label %93

93:                                               ; preds = %88, %84
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %143

94:                                               ; preds = %88, %79
  %95 = load i32, ptr %10, align 4, !tbaa !25
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %111

97:                                               ; preds = %94
  %98 = load i32, ptr %10, align 4, !tbaa !25
  %99 = load i32, ptr %9, align 4, !tbaa !25
  %100 = and i32 %98, %99
  %101 = load i32, ptr %8, align 4, !tbaa !25
  %102 = load i32, ptr %9, align 4, !tbaa !25
  %103 = and i32 %101, %102
  %104 = icmp eq i32 %100, %103
  br i1 %104, label %105, label %110

105:                                              ; preds = %97
  %106 = load i32, ptr %10, align 4, !tbaa !25
  %107 = load i32, ptr %9, align 4, !tbaa !25
  %108 = call zeroext i8 @NetIp4IsUnicast(i32 noundef %106, i32 noundef %107)
  %109 = icmp ne i8 %108, 0
  br i1 %109, label %111, label %110

110:                                              ; preds = %105, %97
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %143

111:                                              ; preds = %105, %94
  %112 = load ptr, ptr @gBS, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %112, i32 0, i32 1
  %114 = load ptr, ptr %113, align 8, !tbaa !19
  %115 = call i64 %114(i64 noundef 8)
  store i64 %115, ptr %7, align 8, !tbaa !22
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %116, i32 0, i32 3
  %118 = load i64, ptr %117, align 8, !tbaa !23
  %119 = icmp eq i64 %118, 1
  br i1 %119, label %120, label %131

120:                                              ; preds = %111
  %121 = load ptr, ptr %6, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %121, i32 0, i32 10
  %123 = load i16, ptr %122, align 4, !tbaa !27
  %124 = zext i16 %123 to i32
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %131

126:                                              ; preds = %120
  %127 = load ptr, ptr @gBS, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %127, i32 0, i32 2
  %129 = load ptr, ptr %128, align 8, !tbaa !24
  %130 = load i64, ptr %7, align 8, !tbaa !22
  call void %129(i64 noundef %130)
  store i64 -9223372036854775793, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %143

131:                                              ; preds = %120, %111
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %132, i32 0, i32 7
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = call ptr @CopyMem(ptr noundef %133, ptr noundef %134, i64 noundef 26)
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %136, i32 0, i32 3
  store i64 1, ptr %137, align 8, !tbaa !23
  %138 = load ptr, ptr @gBS, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %138, i32 0, i32 2
  %140 = load ptr, ptr %139, align 8, !tbaa !24
  %141 = load i64, ptr %7, align 8, !tbaa !22
  call void %140(i64 noundef %141)
  br label %142

142:                                              ; preds = %131, %39
  store i64 0, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %143

143:                                              ; preds = %142, %126, %110, %93, %78, %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  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
  %144 = load i64, ptr %3, align 8
  ret i64 %144
}

declare i64 @NetGetMaskLength(i32 noundef) #2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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, !11, i64 0}
!10 = !{!"_MTFTP4_PROTOCOL", !11, i64 0, !12, i64 8, !13, i64 24, !14, i64 88, !7, i64 96, !6, i64 104, !6, i64 112, !15, i64 120, !6, i64 152, !18, i64 160, !17, i64 180, !17, i64 182, !17, i64 184, !12, i64 192, !11, i64 208, !17, i64 212, !17, 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, !17, i64 260, !7, i64 262, !6, i64 264}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!13 = !{!"_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}
!14 = !{!"long long", !7, i64 0}
!15 = !{!"", !7, i64 0, !16, i64 1, !16, i64 5, !17, i64 10, !16, i64 12, !16, i64 16, !17, i64 20, !17, i64 22, !17, i64 24}
!16 = !{!"", !7, i64 0}
!17 = !{!"short", !7, i64 0}
!18 = !{!"", !17, i64 0, !7, i64 2, !11, i64 4, !11, i64 8, !17, i64 12, !7, i64 14, !11, i64 16}
!19 = !{!20, !6, i64 24}
!20 = !{!"", !21, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368}
!21 = !{!"", !14, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!22 = !{!14, !14, i64 0}
!23 = !{!10, !14, i64 88}
!24 = !{!20, !6, i64 32}
!25 = !{!11, !11, i64 0}
!26 = !{!15, !7, i64 0}
!27 = !{!10, !17, i64 180}


; 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"

@gBS = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [155 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @Mtftp4CleanOperation(ptr noundef, i64 noundef) local_unnamed_addr #0

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #2

declare void @DebugAssert(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

declare ptr @ZeroMem(ptr noundef, i64 noundef) local_unnamed_addr #2

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

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

declare zeroext i8 @NetIp4IsUnicast(i32 noundef, i32 noundef) local_unnamed_addr #2

declare i32 @SwapBytes32(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775806, 1) i64 @EfiMtftp4Configure(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #3
  %7 = icmp eq ptr %0, null
  br i1 %7, label %84, label %8

8:                                                ; preds = %2
  %9 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %9, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre32 = add i64 %.pre, -24
  %.pre34 = inttoptr i64 %.pre32 to ptr
  br i1 %.not, label %._crit_edge, label %10

10:                                               ; preds = %8
  %11 = load i32, ptr %.pre34, align 8, !tbaa !5
  %.not24 = icmp eq i32 %11, 1886676596
  br i1 %.not24, label %._crit_edge, label %12

12:                                               ; preds = %10
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 641, ptr noundef nonnull @.str.5) #3
  br label %._crit_edge

._crit_edge:                                      ; preds = %8, %10, %12
  %13 = phi ptr [ %0, %12 ], [ %.pre34, %10 ], [ %.pre34, %8 ]
  %14 = icmp eq ptr %1, null
  br i1 %14, label %15, label %26

15:                                               ; preds = %._crit_edge
  %16 = load ptr, ptr @gBS, align 8, !tbaa !18
  %17 = getelementptr inbounds i8, ptr %16, i64 24
  %18 = load ptr, ptr %17, align 8, !tbaa !19
  %19 = tail call i64 %18(i64 noundef 8) #3
  tail call void @Mtftp4CleanOperation(ptr noundef %13, i64 noundef -9223372036854775787)
  %20 = getelementptr inbounds i8, ptr %13, i64 120
  %21 = tail call ptr @ZeroMem(ptr noundef nonnull %20, i64 noundef 26) #3
  %22 = getelementptr inbounds i8, ptr %13, i64 88
  store i64 0, ptr %22, align 8, !tbaa !22
  %23 = load ptr, ptr @gBS, align 8, !tbaa !18
  %24 = getelementptr inbounds i8, ptr %23, i64 32
  %25 = load ptr, ptr %24, align 8, !tbaa !23
  tail call void %25(i64 noundef %19) #3
  br label %84

26:                                               ; preds = %._crit_edge
  %27 = getelementptr inbounds i8, ptr %1, i64 1
  %28 = call ptr @CopyMem(ptr noundef nonnull %3, ptr noundef nonnull %27, i64 noundef 4) #3
  %29 = getelementptr inbounds i8, ptr %1, i64 5
  %30 = call ptr @CopyMem(ptr noundef nonnull %4, ptr noundef nonnull %29, i64 noundef 4) #3
  %31 = getelementptr inbounds i8, ptr %1, i64 12
  %32 = call ptr @CopyMem(ptr noundef nonnull %5, ptr noundef nonnull %31, i64 noundef 4) #3
  %33 = getelementptr inbounds i8, ptr %1, i64 16
  %34 = call ptr @CopyMem(ptr noundef nonnull %6, ptr noundef nonnull %33, i64 noundef 4) #3
  %35 = load i32, ptr %3, align 4, !tbaa !24
  %36 = call i32 @SwapBytes32(i32 noundef %35) #3
  store i32 %36, ptr %3, align 4, !tbaa !24
  %37 = load i32, ptr %4, align 4, !tbaa !24
  %38 = call i32 @SwapBytes32(i32 noundef %37) #3
  store i32 %38, ptr %4, align 4, !tbaa !24
  %39 = load i32, ptr %5, align 4, !tbaa !24
  %40 = call i32 @SwapBytes32(i32 noundef %39) #3
  store i32 %40, ptr %5, align 4, !tbaa !24
  %41 = load i32, ptr %6, align 4, !tbaa !24
  %42 = call i32 @SwapBytes32(i32 noundef %41) #3
  store i32 %42, ptr %6, align 4, !tbaa !24
  %43 = call zeroext i8 @NetIp4IsUnicast(i32 noundef %42, i32 noundef 0) #3
  %.not25 = icmp eq i8 %43, 0
  br i1 %.not25, label %84, label %44

44:                                               ; preds = %26
  %45 = load i8, ptr %1, align 2, !tbaa !25
  %.not26 = icmp eq i8 %45, 0
  br i1 %.not26, label %46, label %53

46:                                               ; preds = %44
  %47 = load i32, ptr %4, align 4, !tbaa !24
  %48 = call i64 @NetGetMaskLength(i32 noundef %47) #3
  %.not27 = icmp eq i64 %48, 33
  br i1 %.not27, label %84, label %49

49:                                               ; preds = %46
  %50 = load i32, ptr %3, align 4, !tbaa !24
  %51 = load i32, ptr %4, align 4, !tbaa !24
  %52 = call zeroext i8 @NetIp4IsUnicast(i32 noundef %50, i32 noundef %51) #3
  %.not28 = icmp eq i8 %52, 0
  br i1 %.not28, label %84, label %53

53:                                               ; preds = %49, %44
  %54 = load i32, ptr %5, align 4, !tbaa !24
  %.not29 = icmp eq i32 %54, 0
  br i1 %.not29, label %63, label %55

55:                                               ; preds = %53
  %56 = load i32, ptr %4, align 4, !tbaa !24
  %57 = load i32, ptr %3, align 4, !tbaa !24
  %58 = xor i32 %57, %54
  %59 = and i32 %58, %56
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %61, label %84

61:                                               ; preds = %55
  %62 = call zeroext i8 @NetIp4IsUnicast(i32 noundef %54, i32 noundef %56) #3
  %.not30 = icmp eq i8 %62, 0
  br i1 %.not30, label %84, label %63

63:                                               ; preds = %61, %53
  %64 = load ptr, ptr @gBS, align 8, !tbaa !18
  %65 = getelementptr inbounds i8, ptr %64, i64 24
  %66 = load ptr, ptr %65, align 8, !tbaa !19
  %67 = call i64 %66(i64 noundef 8) #3
  %68 = getelementptr inbounds i8, ptr %13, i64 88
  %69 = load i64, ptr %68, align 8, !tbaa !22
  %70 = icmp eq i64 %69, 1
  br i1 %70, label %71, label %78

71:                                               ; preds = %63
  %72 = getelementptr inbounds i8, ptr %13, i64 180
  %73 = load i16, ptr %72, align 4, !tbaa !26
  %.not31 = icmp eq i16 %73, 0
  br i1 %.not31, label %78, label %74

74:                                               ; preds = %71
  %75 = load ptr, ptr @gBS, align 8, !tbaa !18
  %76 = getelementptr inbounds i8, ptr %75, i64 32
  %77 = load ptr, ptr %76, align 8, !tbaa !23
  call void %77(i64 noundef %67) #3
  br label %84

78:                                               ; preds = %71, %63
  %79 = getelementptr inbounds i8, ptr %13, i64 120
  %80 = call ptr @CopyMem(ptr noundef nonnull %79, ptr noundef nonnull %1, i64 noundef 26) #3
  store i64 1, ptr %68, align 8, !tbaa !22
  %81 = load ptr, ptr @gBS, align 8, !tbaa !18
  %82 = getelementptr inbounds i8, ptr %81, i64 32
  %83 = load ptr, ptr %82, align 8, !tbaa !23
  call void %83(i64 noundef %67) #3
  br label %84

84:                                               ; preds = %15, %78, %55, %61, %46, %49, %26, %2, %74
  %.0 = phi i64 [ -9223372036854775793, %74 ], [ -9223372036854775806, %2 ], [ -9223372036854775806, %26 ], [ -9223372036854775806, %49 ], [ -9223372036854775806, %46 ], [ -9223372036854775806, %61 ], [ -9223372036854775806, %55 ], [ 0, %78 ], [ 0, %15 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  ret i64 %.0
}

declare i64 @NetGetMaskLength(i32 noundef) local_unnamed_addr #2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 0}
!6 = !{!"_MTFTP4_PROTOCOL", !7, i64 0, !10, i64 8, !12, i64 24, !13, i64 88, !8, i64 96, !11, i64 104, !11, i64 112, !14, i64 120, !11, i64 152, !17, i64 160, !16, i64 180, !16, i64 182, !16, i64 184, !10, i64 192, !7, i64 208, !16, i64 212, !16, i64 214, !7, i64 216, !11, i64 224, !11, i64 232, !7, i64 240, !7, i64 244, !7, i64 248, !7, i64 252, !7, i64 256, !16, i64 260, !8, i64 262, !11, i64 264}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_LIST_ENTRY", !11, i64 0, !11, i64 8}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_EFI_MTFTP4_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}
!13 = !{!"long long", !8, i64 0}
!14 = !{!"", !8, i64 0, !15, i64 1, !15, i64 5, !16, i64 10, !15, i64 12, !15, i64 16, !16, i64 20, !16, i64 22, !16, i64 24}
!15 = !{!"", !8, i64 0}
!16 = !{!"short", !8, i64 0}
!17 = !{!"", !16, i64 0, !8, i64 2, !7, i64 4, !7, i64 8, !16, i64 12, !8, i64 14, !7, i64 16}
!18 = !{!11, !11, i64 0}
!19 = !{!20, !11, i64 24}
!20 = !{!"", !21, i64 0, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !11, i64 120, !11, i64 128, !11, i64 136, !11, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !11, i64 176, !11, i64 184, !11, i64 192, !11, i64 200, !11, i64 208, !11, i64 216, !11, i64 224, !11, i64 232, !11, i64 240, !11, i64 248, !11, i64 256, !11, i64 264, !11, i64 272, !11, i64 280, !11, i64 288, !11, i64 296, !11, i64 304, !11, i64 312, !11, i64 320, !11, i64 328, !11, i64 336, !11, i64 344, !11, i64 352, !11, i64 360, !11, i64 368}
!21 = !{!"", !13, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!22 = !{!6, !13, i64 88}
!23 = !{!20, !11, i64 32}
!24 = !{!7, !7, i64 0}
!25 = !{!14, !8, i64 0}
!26 = !{!6, !16, i64 180}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass