; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/NetworkPkg/Mtftp6Dxe (Mtftp6OperationClean)

; 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.GUID = type { i32, i16, i16, [8 x i8] }
%struct._MTFTP6_INSTANCE = type { i32, ptr, %struct._LIST_ENTRY, %struct._EFI_MTFTP6_PROTOCOL, ptr, ptr, ptr, %struct.MTFTP6_EXT_OPTION_INFO, i16, i16, %struct._LIST_ENTRY, %struct.EFI_IPv6_ADDRESS, i16, i16, ptr, %struct.EFI_IPv6_ADDRESS, i16, ptr, ptr, i32, i32, i32, i32, i64, i8, i8, i8 }
%struct._EFI_MTFTP6_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.MTFTP6_EXT_OPTION_INFO = type { i16, i8, i32, %struct.EFI_IPv6_ADDRESS, i16, i8, i32 }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }
%struct._EFI_MTFTP6_TOKEN = type { i64, ptr, ptr, ptr, ptr, i32, ptr, i64, ptr, ptr, ptr, 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 }
%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 }

@gBS = external global ptr, align 8
@gEfiUdp6ProtocolGuid = external global %struct.GUID, align 4

; 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 @RemoveEntryList(ptr noundef) #1

declare void @FreePool(ptr noundef) #1

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

declare void @NetbufFree(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @Mtftp6OperationClean(ptr noundef %0, i64 noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  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
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %8, i32 0, i32 6
  %10 = load ptr, ptr %9, align 8, !tbaa !11
  %11 = icmp ne ptr %10, null
  br i1 %11, label %12, label %37

12:                                               ; preds = %2
  %13 = load i64, ptr %4, align 8, !tbaa !9
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %14, i32 0, i32 6
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %16, i32 0, i32 0
  store i64 %13, ptr %17, align 8, !tbaa !19
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %18, i32 0, i32 6
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  %21 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %20, i32 0, i32 1
  %22 = load ptr, ptr %21, align 8, !tbaa !21
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %34

24:                                               ; preds = %12
  %25 = load ptr, ptr @gBS, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %25, i32 0, i32 11
  %27 = load ptr, ptr %26, align 8, !tbaa !22
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %28, i32 0, i32 6
  %30 = load ptr, ptr %29, align 8, !tbaa !11
  %31 = getelementptr inbounds %struct._EFI_MTFTP6_TOKEN, ptr %30, i32 0, i32 1
  %32 = load ptr, ptr %31, align 8, !tbaa !21
  %33 = call i64 %27(ptr noundef %32)
  br label %34

34:                                               ; preds = %24, %12
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %35, i32 0, i32 6
  store ptr null, ptr %36, align 8, !tbaa !11
  br label %37

37:                                               ; preds = %34, %2
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %38, i32 0, i32 14
  %40 = load ptr, ptr %39, align 8, !tbaa !25
  %41 = icmp ne ptr %40, null
  br i1 %41, label %42, label %46

42:                                               ; preds = %37
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %43, i32 0, i32 14
  %45 = load ptr, ptr %44, align 8, !tbaa !25
  call void @UdpIoCleanIo(ptr noundef %45)
  br label %46

46:                                               ; preds = %42, %37
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %47, i32 0, i32 17
  %49 = load ptr, ptr %48, align 8, !tbaa !26
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %75

51:                                               ; preds = %46
  %52 = load ptr, ptr @gBS, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %52, i32 0, i32 34
  %54 = load ptr, ptr %53, align 8, !tbaa !27
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %55, i32 0, i32 17
  %57 = load ptr, ptr %56, align 8, !tbaa !26
  %58 = getelementptr inbounds %struct._UDP_IO, ptr %57, i32 0, i32 6
  %59 = load ptr, ptr %58, align 8, !tbaa !28
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %60, i32 0, i32 17
  %62 = load ptr, ptr %61, align 8, !tbaa !26
  %63 = getelementptr inbounds %struct._UDP_IO, ptr %62, i32 0, i32 5
  %64 = load ptr, ptr %63, align 8, !tbaa !31
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %65, i32 0, i32 1
  %67 = load ptr, ptr %66, align 8, !tbaa !32
  %68 = call i64 %54(ptr noundef %59, ptr noundef @gEfiUdp6ProtocolGuid, ptr noundef %64, ptr noundef %67)
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %69, i32 0, i32 17
  %71 = load ptr, ptr %70, align 8, !tbaa !26
  %72 = call i64 @UdpIoFreeIo(ptr noundef %71)
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %73, i32 0, i32 17
  store ptr null, ptr %74, align 8, !tbaa !26
  br label %75

75:                                               ; preds = %51, %46
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %76, i32 0, i32 18
  %78 = load ptr, ptr %77, align 8, !tbaa !33
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %86

80:                                               ; preds = %75
  %81 = load ptr, ptr %3, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %81, i32 0, i32 18
  %83 = load ptr, ptr %82, align 8, !tbaa !33
  call void @NetbufFree(ptr noundef %83)
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %84, i32 0, i32 18
  store ptr null, ptr %85, align 8, !tbaa !33
  br label %86

86:                                               ; preds = %80, %75
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %87, i32 0, i32 10
  %89 = getelementptr inbounds %struct._LIST_ENTRY, ptr %88, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8, !tbaa !34
  store ptr %90, ptr %5, align 8, !tbaa !5
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct._LIST_ENTRY, ptr %91, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8, !tbaa !35
  store ptr %93, ptr %6, align 8, !tbaa !5
  br label %94

94:                                               ; preds = %107, %86
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = load ptr, ptr %3, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %96, i32 0, i32 10
  %98 = icmp ne ptr %95, %97
  br i1 %98, label %99, label %112

99:                                               ; preds = %94
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = ptrtoint ptr %100 to i64
  %102 = sub i64 %101, 0
  %103 = inttoptr i64 %102 to ptr
  store ptr %103, ptr %7, align 8, !tbaa !5
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = call ptr @RemoveEntryList(ptr noundef %104)
  %106 = load ptr, ptr %7, align 8, !tbaa !5
  call void @FreePool(ptr noundef %106)
  br label %107

107:                                              ; preds = %99
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %108, ptr %5, align 8, !tbaa !5
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct._LIST_ENTRY, ptr %109, i32 0, i32 0
  %111 = load ptr, ptr %110, align 8, !tbaa !35
  store ptr %111, ptr %6, align 8, !tbaa !5
  br label %94, !llvm.loop !36

112:                                              ; preds = %94
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %113, i32 0, i32 7
  %115 = call ptr @ZeroMem(ptr noundef %114, i64 noundef 32)
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %116, i32 0, i32 11
  %118 = call ptr @ZeroMem(ptr noundef %117, i64 noundef 16)
  %119 = load ptr, ptr %3, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %119, i32 0, i32 15
  %121 = call ptr @ZeroMem(ptr noundef %120, i64 noundef 16)
  %122 = load ptr, ptr %3, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %122, i32 0, i32 12
  store i16 0, ptr %123, align 8, !tbaa !38
  %124 = load ptr, ptr %3, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %124, i32 0, i32 13
  store i16 0, ptr %125, align 2, !tbaa !39
  %126 = load ptr, ptr %3, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %126, i32 0, i32 16
  store i16 0, ptr %127, align 8, !tbaa !40
  %128 = load ptr, ptr %3, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %128, i32 0, i32 8
  store i16 0, ptr %129, align 8, !tbaa !41
  %130 = load ptr, ptr %3, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %130, i32 0, i32 9
  store i16 0, ptr %131, align 2, !tbaa !42
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %132, i32 0, i32 21
  store i32 0, ptr %133, align 8, !tbaa !43
  %134 = load ptr, ptr %3, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %134, i32 0, i32 20
  store i32 0, ptr %135, align 4, !tbaa !44
  %136 = load ptr, ptr %3, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %136, i32 0, i32 19
  store i32 0, ptr %137, align 8, !tbaa !45
  %138 = load ptr, ptr %3, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %138, i32 0, i32 22
  store i32 0, ptr %139, align 4, !tbaa !46
  %140 = load ptr, ptr %3, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct._MTFTP6_INSTANCE, ptr %140, i32 0, i32 25
  store i8 1, ptr %141, align 1, !tbaa !47
  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
  ret void
}

declare void @UdpIoCleanIo(ptr noundef) #1

declare i64 @UdpIoFreeIo(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !6, i64 112}
!12 = !{!"_MTFTP6_INSTANCE", !13, i64 0, !6, i64 8, !14, i64 16, !15, i64 32, !6, i64 96, !6, i64 104, !6, i64 112, !16, i64 120, !17, i64 152, !17, i64 154, !14, i64 160, !18, i64 176, !17, i64 192, !17, i64 194, !6, i64 200, !18, i64 208, !17, i64 224, !6, i64 232, !6, i64 240, !13, i64 248, !13, i64 252, !13, i64 256, !13, i64 260, !10, i64 264, !7, i64 272, !7, i64 273, !7, i64 274}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!15 = !{!"_EFI_MTFTP6_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}
!16 = !{!"", !17, i64 0, !7, i64 2, !13, i64 4, !18, i64 8, !17, i64 24, !7, i64 26, !13, i64 28}
!17 = !{!"short", !7, i64 0}
!18 = !{!"", !7, i64 0}
!19 = !{!20, !10, i64 0}
!20 = !{!"_EFI_MTFTP6_TOKEN", !10, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !13, i64 40, !6, i64 48, !10, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96}
!21 = !{!20, !6, i64 8}
!22 = !{!23, !6, i64 104}
!23 = !{!"", !24, 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}
!24 = !{!"", !10, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!25 = !{!12, !6, i64 200}
!26 = !{!12, !6, i64 232}
!27 = !{!23, !6, i64 288}
!28 = !{!29, !6, i64 56}
!29 = !{!"_UDP_IO", !13, i64 0, !14, i64 8, !10, i64 24, !7, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !30, i64 64, !14, i64 720, !6, i64 736, !7, i64 744, !7, i64 752}
!30 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !7, i64 40, !18, i64 552, !18, i64 584, !18, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!31 = !{!29, !6, i64 48}
!32 = !{!12, !6, i64 8}
!33 = !{!12, !6, i64 240}
!34 = !{!12, !6, i64 160}
!35 = !{!14, !6, i64 0}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = !{!12, !17, i64 192}
!39 = !{!12, !17, i64 194}
!40 = !{!12, !17, i64 224}
!41 = !{!12, !17, i64 152}
!42 = !{!12, !17, i64 154}
!43 = !{!12, !13, i64 256}
!44 = !{!12, !13, i64 252}
!45 = !{!12, !13, i64 248}
!46 = !{!12, !13, i64 260}
!47 = !{!12, !7, i64 273}


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

@gBS = external local_unnamed_addr global ptr, align 8
@gEfiUdp6ProtocolGuid = external global %struct.GUID, align 4

declare ptr @RemoveEntryList(ptr noundef) local_unnamed_addr #0

declare void @FreePool(ptr noundef) local_unnamed_addr #0

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

declare void @NetbufFree(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @Mtftp6OperationClean(ptr noundef %0, i64 noundef %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %0, i64 112
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %14, label %5

5:                                                ; preds = %2
  store i64 %1, ptr %4, align 8, !tbaa !17
  %6 = getelementptr inbounds i8, ptr %4, i64 8
  %7 = load ptr, ptr %6, align 8, !tbaa !19
  %.not44 = icmp eq ptr %7, null
  br i1 %.not44, label %13, label %8

8:                                                ; preds = %5
  %9 = load ptr, ptr @gBS, align 8, !tbaa !20
  %10 = getelementptr inbounds i8, ptr %9, i64 104
  %11 = load ptr, ptr %10, align 8, !tbaa !21
  %12 = tail call i64 %11(ptr noundef nonnull %7) #3
  br label %13

13:                                               ; preds = %8, %5
  store ptr null, ptr %3, align 8, !tbaa !5
  br label %14

14:                                               ; preds = %13, %2
  %15 = getelementptr inbounds i8, ptr %0, i64 200
  %16 = load ptr, ptr %15, align 8, !tbaa !24
  %.not45 = icmp eq ptr %16, null
  br i1 %.not45, label %18, label %17

17:                                               ; preds = %14
  tail call void @UdpIoCleanIo(ptr noundef nonnull %16) #3
  br label %18

18:                                               ; preds = %17, %14
  %19 = getelementptr inbounds i8, ptr %0, i64 232
  %20 = load ptr, ptr %19, align 8, !tbaa !25
  %.not46 = icmp eq ptr %20, null
  br i1 %.not46, label %34, label %21

21:                                               ; preds = %18
  %22 = load ptr, ptr @gBS, align 8, !tbaa !20
  %23 = getelementptr inbounds i8, ptr %22, i64 288
  %24 = load ptr, ptr %23, align 8, !tbaa !26
  %25 = getelementptr inbounds i8, ptr %20, i64 56
  %26 = load ptr, ptr %25, align 8, !tbaa !27
  %27 = getelementptr inbounds i8, ptr %20, i64 48
  %28 = load ptr, ptr %27, align 8, !tbaa !30
  %29 = getelementptr inbounds i8, ptr %0, i64 8
  %30 = load ptr, ptr %29, align 8, !tbaa !31
  %31 = tail call i64 %24(ptr noundef %26, ptr noundef nonnull @gEfiUdp6ProtocolGuid, ptr noundef %28, ptr noundef %30) #3
  %32 = load ptr, ptr %19, align 8, !tbaa !25
  %33 = tail call i64 @UdpIoFreeIo(ptr noundef %32) #3
  store ptr null, ptr %19, align 8, !tbaa !25
  br label %34

34:                                               ; preds = %21, %18
  %35 = getelementptr inbounds i8, ptr %0, i64 240
  %36 = load ptr, ptr %35, align 8, !tbaa !32
  %.not47 = icmp eq ptr %36, null
  br i1 %.not47, label %38, label %37

37:                                               ; preds = %34
  tail call void @NetbufFree(ptr noundef nonnull %36) #3
  store ptr null, ptr %35, align 8, !tbaa !32
  br label %38

38:                                               ; preds = %37, %34
  %39 = getelementptr inbounds i8, ptr %0, i64 160
  %40 = load ptr, ptr %39, align 8, !tbaa !33
  %.not4849 = icmp eq ptr %40, %39
  br i1 %.not4849, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %38, %.lr.ph
  %.050 = phi ptr [ %.038, %.lr.ph ], [ %40, %38 ]
  %.038 = load ptr, ptr %.050, align 8, !tbaa !34
  %41 = tail call ptr @RemoveEntryList(ptr noundef nonnull %.050) #3
  tail call void @FreePool(ptr noundef nonnull %.050) #3
  %.not48 = icmp eq ptr %.038, %39
  br i1 %.not48, label %._crit_edge, label %.lr.ph, !llvm.loop !35

._crit_edge:                                      ; preds = %.lr.ph, %38
  %42 = getelementptr inbounds i8, ptr %0, i64 120
  %43 = tail call ptr @ZeroMem(ptr noundef nonnull %42, i64 noundef 32) #3
  %44 = getelementptr inbounds i8, ptr %0, i64 176
  %45 = tail call ptr @ZeroMem(ptr noundef nonnull %44, i64 noundef 16) #3
  %46 = getelementptr inbounds i8, ptr %0, i64 208
  %47 = tail call ptr @ZeroMem(ptr noundef nonnull %46, i64 noundef 16) #3
  %48 = getelementptr inbounds i8, ptr %0, i64 192
  store i16 0, ptr %48, align 8, !tbaa !37
  %49 = getelementptr inbounds i8, ptr %0, i64 194
  store i16 0, ptr %49, align 2, !tbaa !38
  %50 = getelementptr inbounds i8, ptr %0, i64 224
  store i16 0, ptr %50, align 8, !tbaa !39
  %51 = getelementptr inbounds i8, ptr %0, i64 152
  store i16 0, ptr %51, align 8, !tbaa !40
  %52 = getelementptr inbounds i8, ptr %0, i64 154
  store i16 0, ptr %52, align 2, !tbaa !41
  %53 = getelementptr inbounds i8, ptr %0, i64 248
  %54 = getelementptr inbounds i8, ptr %0, i64 273
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %53, i8 0, i64 16, i1 false)
  store i8 1, ptr %54, align 1, !tbaa !42
  ret void
}

declare void @UdpIoCleanIo(ptr noundef) local_unnamed_addr #0

declare i64 @UdpIoFreeIo(ptr noundef) local_unnamed_addr #0

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

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !10, i64 112}
!6 = !{!"_MTFTP6_INSTANCE", !7, i64 0, !10, i64 8, !11, i64 16, !12, i64 32, !10, i64 96, !10, i64 104, !10, i64 112, !13, i64 120, !14, i64 152, !14, i64 154, !11, i64 160, !15, i64 176, !14, i64 192, !14, i64 194, !10, i64 200, !15, i64 208, !14, i64 224, !10, i64 232, !10, i64 240, !7, i64 248, !7, i64 252, !7, i64 256, !7, i64 260, !16, i64 264, !8, i64 272, !8, i64 273, !8, i64 274}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_LIST_ENTRY", !10, i64 0, !10, i64 8}
!12 = !{!"_EFI_MTFTP6_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56}
!13 = !{!"", !14, i64 0, !8, i64 2, !7, i64 4, !15, i64 8, !14, i64 24, !8, i64 26, !7, i64 28}
!14 = !{!"short", !8, i64 0}
!15 = !{!"", !8, i64 0}
!16 = !{!"long long", !8, i64 0}
!17 = !{!18, !16, i64 0}
!18 = !{!"_EFI_MTFTP6_TOKEN", !16, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !7, i64 40, !10, i64 48, !16, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96}
!19 = !{!18, !10, i64 8}
!20 = !{!10, !10, i64 0}
!21 = !{!22, !10, i64 104}
!22 = !{!"", !23, i64 0, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !10, i64 312, !10, i64 320, !10, i64 328, !10, i64 336, !10, i64 344, !10, i64 352, !10, i64 360, !10, i64 368}
!23 = !{!"", !16, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!24 = !{!6, !10, i64 200}
!25 = !{!6, !10, i64 232}
!26 = !{!22, !10, i64 288}
!27 = !{!28, !10, i64 56}
!28 = !{!"_UDP_IO", !7, i64 0, !11, i64 8, !16, i64 24, !8, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !29, i64 64, !11, i64 720, !10, i64 736, !8, i64 744, !8, i64 752}
!29 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !8, i64 40, !15, i64 552, !15, i64 584, !15, i64 616, !8, i64 648, !8, i64 649, !8, i64 650, !8, i64 651, !8, i64 652}
!30 = !{!28, !10, i64 48}
!31 = !{!6, !10, i64 8}
!32 = !{!6, !10, i64 240}
!33 = !{!6, !10, i64 160}
!34 = !{!11, !10, i64 0}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = !{!6, !14, i64 192}
!38 = !{!6, !14, i64 194}
!39 = !{!6, !14, i64 224}
!40 = !{!6, !14, i64 152}
!41 = !{!6, !14, i64 154}
!42 = !{!6, !8, i64 273}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,SROAPass,SimplifyCFGPass,TailCallElimPass