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

; 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._IP4_SERVICE = type { i32, %struct._EFI_SERVICE_BINDING_PROTOCOL, i64, i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, ptr, %struct.IP4_ASSEMBLE_TABLE, %struct.IGMP_SERVICE_DATA, ptr, ptr, ptr, ptr, %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, %struct.EFI_SIMPLE_NETWORK_MODE, ptr, ptr, ptr, ptr, ptr, i32, i32 }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.IP4_ASSEMBLE_TABLE = type { [31 x %struct._LIST_ENTRY] }
%struct.IGMP_SERVICE_DATA = type { i64, %struct._LIST_ENTRY }
%struct.EFI_MANAGED_NETWORK_CONFIG_DATA = type { i32, i32, i16, i8, i8, i8, i8, i8, i8, i8 }
%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] }
%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._EFI_IP4_CONFIG_PROTOCOL = type { ptr, ptr, ptr }

@gBS = external global ptr, align 8
@gEfiManagedNetworkServiceBindingProtocolGuid = external global %struct.GUID, align 4
@gEfiManagedNetworkProtocolGuid = external global %struct.GUID, align 4
@gEfiIp4ConfigProtocolGuid = 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

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip4CleanService(ptr noundef %0) #1 {
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  %6 = load ptr, ptr %3, align 8, !tbaa !5
  %7 = getelementptr inbounds %struct._IP4_SERVICE, ptr %6, i32 0, i32 6
  %8 = load ptr, ptr %7, align 8, !tbaa !9
  %9 = icmp ne ptr %8, null
  br i1 %9, label %10, label %22

10:                                               ; preds = %1
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct._IP4_SERVICE, ptr %11, i32 0, i32 6
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  %14 = call i64 @Ip4FreeInterface(ptr noundef %13, ptr noundef null)
  store i64 %14, ptr %4, align 8, !tbaa !20
  %15 = load i64, ptr %4, align 8, !tbaa !20
  %16 = icmp slt i64 %15, 0
  br i1 %16, label %17, label %19

17:                                               ; preds = %10
  %18 = load i64, ptr %4, align 8, !tbaa !20
  store i64 %18, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %143

19:                                               ; preds = %10
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct._IP4_SERVICE, ptr %20, i32 0, i32 6
  store ptr null, ptr %21, align 8, !tbaa !9
  br label %22

22:                                               ; preds = %19, %1
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct._IP4_SERVICE, ptr %23, i32 0, i32 7
  %25 = load ptr, ptr %24, align 8, !tbaa !21
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %33

27:                                               ; preds = %22
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct._IP4_SERVICE, ptr %28, i32 0, i32 7
  %30 = load ptr, ptr %29, align 8, !tbaa !21
  call void @Ip4FreeRouteTable(ptr noundef %30)
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct._IP4_SERVICE, ptr %31, i32 0, i32 7
  store ptr null, ptr %32, align 8, !tbaa !21
  br label %33

33:                                               ; preds = %27, %22
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._IP4_SERVICE, ptr %34, i32 0, i32 8
  call void @Ip4CleanAssembleTable(ptr noundef %35)
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._IP4_SERVICE, ptr %36, i32 0, i32 12
  %38 = load ptr, ptr %37, align 8, !tbaa !22
  %39 = icmp ne ptr %38, null
  br i1 %39, label %40, label %74

40:                                               ; preds = %33
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._IP4_SERVICE, ptr %41, i32 0, i32 13
  %43 = load ptr, ptr %42, align 8, !tbaa !23
  %44 = icmp ne ptr %43, null
  br i1 %44, label %45, label %61

45:                                               ; preds = %40
  %46 = load ptr, ptr @gBS, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %46, i32 0, i32 34
  %48 = load ptr, ptr %47, align 8, !tbaa !24
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._IP4_SERVICE, ptr %49, i32 0, i32 12
  %51 = load ptr, ptr %50, align 8, !tbaa !22
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._IP4_SERVICE, ptr %52, i32 0, i32 10
  %54 = load ptr, ptr %53, align 8, !tbaa !27
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct._IP4_SERVICE, ptr %55, i32 0, i32 11
  %57 = load ptr, ptr %56, align 8, !tbaa !28
  %58 = call i64 %48(ptr noundef %51, ptr noundef @gEfiManagedNetworkProtocolGuid, ptr noundef %54, ptr noundef %57)
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._IP4_SERVICE, ptr %59, i32 0, i32 13
  store ptr null, ptr %60, align 8, !tbaa !23
  br label %61

61:                                               ; preds = %45, %40
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._IP4_SERVICE, ptr %62, i32 0, i32 11
  %64 = load ptr, ptr %63, align 8, !tbaa !28
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._IP4_SERVICE, ptr %65, i32 0, i32 10
  %67 = load ptr, ptr %66, align 8, !tbaa !27
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._IP4_SERVICE, ptr %68, i32 0, i32 12
  %70 = load ptr, ptr %69, align 8, !tbaa !22
  %71 = call i64 @NetLibDestroyServiceChild(ptr noundef %64, ptr noundef %67, ptr noundef @gEfiManagedNetworkServiceBindingProtocolGuid, ptr noundef %70)
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct._IP4_SERVICE, ptr %72, i32 0, i32 12
  store ptr null, ptr %73, align 8, !tbaa !22
  br label %74

74:                                               ; preds = %61, %33
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._IP4_SERVICE, ptr %75, i32 0, i32 16
  %77 = load ptr, ptr %76, align 8, !tbaa !29
  %78 = icmp ne ptr %77, null
  br i1 %78, label %79, label %96

79:                                               ; preds = %74
  %80 = load ptr, ptr @gBS, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %80, i32 0, i32 9
  %82 = load ptr, ptr %81, align 8, !tbaa !30
  %83 = load ptr, ptr %3, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct._IP4_SERVICE, ptr %83, i32 0, i32 16
  %85 = load ptr, ptr %84, align 8, !tbaa !29
  %86 = call i64 %82(ptr noundef %85, i32 noundef 0, i64 noundef 0)
  %87 = load ptr, ptr @gBS, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %87, i32 0, i32 12
  %89 = load ptr, ptr %88, align 8, !tbaa !31
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._IP4_SERVICE, ptr %90, i32 0, i32 16
  %92 = load ptr, ptr %91, align 8, !tbaa !29
  %93 = call i64 %89(ptr noundef %92)
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct._IP4_SERVICE, ptr %94, i32 0, i32 16
  store ptr null, ptr %95, align 8, !tbaa !29
  br label %96

96:                                               ; preds = %79, %74
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct._IP4_SERVICE, ptr %97, i32 0, i32 17
  %99 = load ptr, ptr %98, align 8, !tbaa !32
  %100 = icmp ne ptr %99, null
  br i1 %100, label %101, label %142

101:                                              ; preds = %96
  %102 = load ptr, ptr %3, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct._IP4_SERVICE, ptr %102, i32 0, i32 17
  %104 = load ptr, ptr %103, align 8, !tbaa !32
  %105 = getelementptr inbounds %struct._EFI_IP4_CONFIG_PROTOCOL, ptr %104, i32 0, i32 1
  %106 = load ptr, ptr %105, align 8, !tbaa !33
  %107 = load ptr, ptr %3, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct._IP4_SERVICE, ptr %107, i32 0, i32 17
  %109 = load ptr, ptr %108, align 8, !tbaa !32
  %110 = call i64 %106(ptr noundef %109)
  %111 = load ptr, ptr @gBS, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %111, i32 0, i32 34
  %113 = load ptr, ptr %112, align 8, !tbaa !24
  %114 = load ptr, ptr %3, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._IP4_SERVICE, ptr %114, i32 0, i32 11
  %116 = load ptr, ptr %115, align 8, !tbaa !28
  %117 = load ptr, ptr %3, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._IP4_SERVICE, ptr %117, i32 0, i32 10
  %119 = load ptr, ptr %118, align 8, !tbaa !27
  %120 = load ptr, ptr %3, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct._IP4_SERVICE, ptr %120, i32 0, i32 11
  %122 = load ptr, ptr %121, align 8, !tbaa !28
  %123 = call i64 %113(ptr noundef %116, ptr noundef @gEfiIp4ConfigProtocolGuid, ptr noundef %119, ptr noundef %122)
  %124 = load ptr, ptr @gBS, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %124, i32 0, i32 12
  %126 = load ptr, ptr %125, align 8, !tbaa !31
  %127 = load ptr, ptr %3, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct._IP4_SERVICE, ptr %127, i32 0, i32 18
  %129 = load ptr, ptr %128, align 8, !tbaa !35
  %130 = call i64 %126(ptr noundef %129)
  %131 = load ptr, ptr @gBS, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %131, i32 0, i32 12
  %133 = load ptr, ptr %132, align 8, !tbaa !31
  %134 = load ptr, ptr %3, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct._IP4_SERVICE, ptr %134, i32 0, i32 19
  %136 = load ptr, ptr %135, align 8, !tbaa !36
  %137 = call i64 %133(ptr noundef %136)
  %138 = load ptr, ptr %3, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct._IP4_SERVICE, ptr %138, i32 0, i32 20
  store ptr null, ptr %139, align 8, !tbaa !37
  %140 = load ptr, ptr %3, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct._IP4_SERVICE, ptr %140, i32 0, i32 17
  store ptr null, ptr %141, align 8, !tbaa !32
  br label %142

142:                                              ; preds = %101, %96
  store i64 0, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %143

143:                                              ; preds = %142, %17
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %144 = load i64, ptr %2, align 8
  ret i64 %144
}

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

declare void @Ip4FreeRouteTable(ptr noundef) #2

declare void @Ip4CleanAssembleTable(ptr noundef) #2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 72}
!10 = !{!"_IP4_SERVICE", !11, i64 0, !12, i64 8, !13, i64 24, !13, i64 32, !14, i64 40, !14, i64 56, !6, i64 72, !6, i64 80, !15, i64 88, !16, i64 584, !6, i64 608, !6, i64 616, !6, i64 624, !6, i64 632, !17, i64 640, !19, i64 660, !6, i64 1320, !6, i64 1328, !6, i64 1336, !6, i64 1344, !6, i64 1352, !11, i64 1360, !11, i64 1364}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!15 = !{!"", !7, i64 0}
!16 = !{!"", !13, i64 0, !14, i64 8}
!17 = !{!"", !11, i64 0, !11, i64 4, !18, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!18 = !{!"short", !7, i64 0}
!19 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !7, i64 40, !15, i64 552, !15, i64 584, !15, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!20 = !{!13, !13, i64 0}
!21 = !{!10, !6, i64 80}
!22 = !{!10, !6, i64 624}
!23 = !{!10, !6, i64 632}
!24 = !{!25, !6, i64 288}
!25 = !{!"", !26, 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}
!26 = !{!"", !13, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!27 = !{!10, !6, i64 608}
!28 = !{!10, !6, i64 616}
!29 = !{!10, !6, i64 1320}
!30 = !{!25, !6, i64 88}
!31 = !{!25, !6, i64 112}
!32 = !{!10, !6, i64 1328}
!33 = !{!34, !6, i64 8}
!34 = !{!"_EFI_IP4_CONFIG_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!35 = !{!10, !6, i64 1336}
!36 = !{!10, !6, i64 1344}
!37 = !{!10, !6, i64 1352}


; 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
@gEfiManagedNetworkServiceBindingProtocolGuid = external global %struct.GUID, align 4
@gEfiManagedNetworkProtocolGuid = external global %struct.GUID, align 4
@gEfiIp4ConfigProtocolGuid = external global %struct.GUID, align 4

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

4:                                                ; preds = %1
  %5 = tail call i64 @Ip4FreeInterface(ptr noundef nonnull %3, ptr noundef null) #2
  %6 = icmp slt i64 %5, 0
  br i1 %6, label %76, label %7

7:                                                ; preds = %4
  store ptr null, ptr %2, align 8, !tbaa !5
  br label %8

8:                                                ; preds = %7, %1
  %9 = getelementptr inbounds i8, ptr %0, i64 80
  %10 = load ptr, ptr %9, align 8, !tbaa !19
  %.not39 = icmp eq ptr %10, null
  br i1 %.not39, label %12, label %11

11:                                               ; preds = %8
  tail call void @Ip4FreeRouteTable(ptr noundef nonnull %10) #2
  store ptr null, ptr %9, align 8, !tbaa !19
  br label %12

12:                                               ; preds = %11, %8
  %13 = getelementptr inbounds i8, ptr %0, i64 88
  tail call void @Ip4CleanAssembleTable(ptr noundef nonnull %13) #2
  %14 = getelementptr inbounds i8, ptr %0, i64 624
  %15 = load ptr, ptr %14, align 8, !tbaa !20
  %.not40 = icmp eq ptr %15, null
  br i1 %.not40, label %35, label %16

16:                                               ; preds = %12
  %17 = getelementptr inbounds i8, ptr %0, i64 632
  %18 = load ptr, ptr %17, align 8, !tbaa !21
  %.not41 = icmp eq ptr %18, null
  br i1 %.not41, label %28, label %19

19:                                               ; preds = %16
  %20 = load ptr, ptr @gBS, align 8, !tbaa !22
  %21 = getelementptr inbounds i8, ptr %20, i64 288
  %22 = load ptr, ptr %21, align 8, !tbaa !23
  %23 = getelementptr inbounds i8, ptr %0, i64 608
  %24 = load ptr, ptr %23, align 8, !tbaa !26
  %25 = getelementptr inbounds i8, ptr %0, i64 616
  %26 = load ptr, ptr %25, align 8, !tbaa !27
  %27 = tail call i64 %22(ptr noundef nonnull %15, ptr noundef nonnull @gEfiManagedNetworkProtocolGuid, ptr noundef %24, ptr noundef %26) #2
  store ptr null, ptr %17, align 8, !tbaa !21
  %.pre = load ptr, ptr %14, align 8, !tbaa !20
  br label %28

28:                                               ; preds = %19, %16
  %29 = phi ptr [ %.pre, %19 ], [ %15, %16 ]
  %30 = getelementptr inbounds i8, ptr %0, i64 616
  %31 = load ptr, ptr %30, align 8, !tbaa !27
  %32 = getelementptr inbounds i8, ptr %0, i64 608
  %33 = load ptr, ptr %32, align 8, !tbaa !26
  %34 = tail call i64 @NetLibDestroyServiceChild(ptr noundef %31, ptr noundef %33, ptr noundef nonnull @gEfiManagedNetworkServiceBindingProtocolGuid, ptr noundef %29) #2
  store ptr null, ptr %14, align 8, !tbaa !20
  br label %35

35:                                               ; preds = %28, %12
  %36 = getelementptr inbounds i8, ptr %0, i64 1320
  %37 = load ptr, ptr %36, align 8, !tbaa !28
  %.not42 = icmp eq ptr %37, null
  br i1 %.not42, label %48, label %38

38:                                               ; preds = %35
  %39 = load ptr, ptr @gBS, align 8, !tbaa !22
  %40 = getelementptr inbounds i8, ptr %39, i64 88
  %41 = load ptr, ptr %40, align 8, !tbaa !29
  %42 = tail call i64 %41(ptr noundef nonnull %37, i32 noundef 0, i64 noundef 0) #2
  %43 = load ptr, ptr @gBS, align 8, !tbaa !22
  %44 = getelementptr inbounds i8, ptr %43, i64 112
  %45 = load ptr, ptr %44, align 8, !tbaa !30
  %46 = load ptr, ptr %36, align 8, !tbaa !28
  %47 = tail call i64 %45(ptr noundef %46) #2
  store ptr null, ptr %36, align 8, !tbaa !28
  br label %48

48:                                               ; preds = %38, %35
  %49 = getelementptr inbounds i8, ptr %0, i64 1328
  %50 = load ptr, ptr %49, align 8, !tbaa !31
  %.not43 = icmp eq ptr %50, null
  br i1 %.not43, label %76, label %51

51:                                               ; preds = %48
  %52 = getelementptr inbounds i8, ptr %50, i64 8
  %53 = load ptr, ptr %52, align 8, !tbaa !32
  %54 = tail call i64 %53(ptr noundef nonnull %50) #2
  %55 = load ptr, ptr @gBS, align 8, !tbaa !22
  %56 = getelementptr inbounds i8, ptr %55, i64 288
  %57 = load ptr, ptr %56, align 8, !tbaa !23
  %58 = getelementptr inbounds i8, ptr %0, i64 616
  %59 = load ptr, ptr %58, align 8, !tbaa !27
  %60 = getelementptr inbounds i8, ptr %0, i64 608
  %61 = load ptr, ptr %60, align 8, !tbaa !26
  %62 = tail call i64 %57(ptr noundef %59, ptr noundef nonnull @gEfiIp4ConfigProtocolGuid, ptr noundef %61, ptr noundef %59) #2
  %63 = load ptr, ptr @gBS, align 8, !tbaa !22
  %64 = getelementptr inbounds i8, ptr %63, i64 112
  %65 = load ptr, ptr %64, align 8, !tbaa !30
  %66 = getelementptr inbounds i8, ptr %0, i64 1336
  %67 = load ptr, ptr %66, align 8, !tbaa !34
  %68 = tail call i64 %65(ptr noundef %67) #2
  %69 = load ptr, ptr @gBS, align 8, !tbaa !22
  %70 = getelementptr inbounds i8, ptr %69, i64 112
  %71 = load ptr, ptr %70, align 8, !tbaa !30
  %72 = getelementptr inbounds i8, ptr %0, i64 1344
  %73 = load ptr, ptr %72, align 8, !tbaa !35
  %74 = tail call i64 %71(ptr noundef %73) #2
  %75 = getelementptr inbounds i8, ptr %0, i64 1352
  store ptr null, ptr %75, align 8, !tbaa !36
  store ptr null, ptr %49, align 8, !tbaa !31
  br label %76

76:                                               ; preds = %48, %51, %4
  %.0 = phi i64 [ %5, %4 ], [ 0, %51 ], [ 0, %48 ]
  ret i64 %.0
}

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

declare void @Ip4FreeRouteTable(ptr noundef) local_unnamed_addr #1

declare void @Ip4CleanAssembleTable(ptr noundef) local_unnamed_addr #1

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

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 = { "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 72}
!6 = !{!"_IP4_SERVICE", !7, i64 0, !10, i64 8, !12, i64 24, !12, i64 32, !13, i64 40, !13, i64 56, !11, i64 72, !11, i64 80, !14, i64 88, !15, i64 584, !11, i64 608, !11, i64 616, !11, i64 624, !11, i64 632, !16, i64 640, !18, i64 660, !11, i64 1320, !11, i64 1328, !11, i64 1336, !11, i64 1344, !11, i64 1352, !7, i64 1360, !7, i64 1364}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !11, i64 0, !11, i64 8}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"long long", !8, i64 0}
!13 = !{!"_LIST_ENTRY", !11, i64 0, !11, i64 8}
!14 = !{!"", !8, i64 0}
!15 = !{!"", !12, i64 0, !13, i64 8}
!16 = !{!"", !7, i64 0, !7, i64 4, !17, i64 8, !8, i64 10, !8, i64 11, !8, i64 12, !8, i64 13, !8, i64 14, !8, i64 15, !8, i64 16}
!17 = !{!"short", !8, i64 0}
!18 = !{!"", !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, !14, i64 552, !14, i64 584, !14, i64 616, !8, i64 648, !8, i64 649, !8, i64 650, !8, i64 651, !8, i64 652}
!19 = !{!6, !11, i64 80}
!20 = !{!6, !11, i64 624}
!21 = !{!6, !11, i64 632}
!22 = !{!11, !11, i64 0}
!23 = !{!24, !11, i64 288}
!24 = !{!"", !25, 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}
!25 = !{!"", !12, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!26 = !{!6, !11, i64 608}
!27 = !{!6, !11, i64 616}
!28 = !{!6, !11, i64 1320}
!29 = !{!24, !11, i64 88}
!30 = !{!24, !11, i64 112}
!31 = !{!6, !11, i64 1328}
!32 = !{!33, !11, i64 8}
!33 = !{!"_EFI_IP4_CONFIG_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16}
!34 = !{!6, !11, i64 1336}
!35 = !{!6, !11, i64 1344}
!36 = !{!6, !11, i64 1352}


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