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

; 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._ARP_SERVICE_DATA = type { i32, %struct._EFI_SERVICE_BINDING_PROTOCOL, ptr, ptr, ptr, ptr, %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, %struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN, %struct.EFI_SIMPLE_NETWORK_MODE, i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct.EFI_MANAGED_NETWORK_CONFIG_DATA = type { i32, i32, i16, i8, i8, i8, i8, i8, i8, i8 }
%struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN = type { ptr, i64, %union.anon }
%union.anon = type { ptr }
%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._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 }
%struct._EFI_MANAGED_NETWORK_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [151 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [27 x i8], align 1
@gEfiManagedNetworkServiceBindingProtocolGuid = external global %struct.GUID, align 4
@gBS = external global ptr, align 8
@gEfiManagedNetworkProtocolGuid = external global %struct.GUID, align 4

; Function Attrs: nounwind uwtable
define dso_local i64 @ArpCreateService(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  br label %10

10:                                               ; preds = %3
  %11 = call zeroext i8 @DebugAssertEnabled()
  %12 = icmp ne i8 %11, 0
  br i1 %12, label %13, label %18

13:                                               ; preds = %10
  %14 = load ptr, ptr %7, align 8, !tbaa !5
  %15 = icmp ne ptr %14, null
  br i1 %15, label %17, label %16

16:                                               ; preds = %13
  call void @DebugAssert(ptr noundef @.str, i64 noundef 53, ptr noundef @.str.1)
  br label %17

17:                                               ; preds = %16, %13
  br label %18

18:                                               ; preds = %17, %10
  br label %19

19:                                               ; preds = %18
  br label %20

20:                                               ; preds = %19
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %21, i32 0, i32 0
  store i32 1397772865, ptr %22, align 8, !tbaa !9
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %23, i32 0, i32 10
  %25 = call ptr @InitializeListHead(ptr noundef %24)
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %26, i32 0, i32 11
  %28 = call ptr @InitializeListHead(ptr noundef %27)
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %29, i32 0, i32 12
  %31 = call ptr @InitializeListHead(ptr noundef %30)
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %32, i32 0, i32 13
  %34 = call ptr @InitializeListHead(ptr noundef %33)
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %35, i32 0, i32 1
  %37 = getelementptr inbounds %struct._EFI_SERVICE_BINDING_PROTOCOL, ptr %36, i32 0, i32 0
  store ptr @ArpServiceBindingCreateChild, ptr %37, align 8, !tbaa !20
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %38, i32 0, i32 1
  %40 = getelementptr inbounds %struct._EFI_SERVICE_BINDING_PROTOCOL, ptr %39, i32 0, i32 1
  store ptr @ArpServiceBindingDestroyChild, ptr %40, align 8, !tbaa !21
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %42, i32 0, i32 3
  store ptr %41, ptr %43, align 8, !tbaa !22
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %45, i32 0, i32 4
  store ptr %44, ptr %46, align 8, !tbaa !23
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %49, i32 0, i32 2
  %51 = call i64 @NetLibCreateServiceChild(ptr noundef %47, ptr noundef %48, ptr noundef @gEfiManagedNetworkServiceBindingProtocolGuid, ptr noundef %50)
  store i64 %51, ptr %8, align 8, !tbaa !24
  %52 = load i64, ptr %8, align 8, !tbaa !24
  %53 = icmp slt i64 %52, 0
  br i1 %53, label %54, label %56

54:                                               ; preds = %20
  %55 = load i64, ptr %8, align 8, !tbaa !24
  store i64 %55, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %175

56:                                               ; preds = %20
  %57 = load ptr, ptr @gBS, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %57, i32 0, i32 33
  %59 = load ptr, ptr %58, align 8, !tbaa !25
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %60, i32 0, i32 2
  %62 = load ptr, ptr %61, align 8, !tbaa !28
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %63, i32 0, i32 5
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = call i64 %59(ptr noundef %62, ptr noundef @gEfiManagedNetworkProtocolGuid, ptr noundef %64, ptr noundef %65, ptr noundef %66, i32 noundef 16)
  store i64 %67, ptr %8, align 8, !tbaa !24
  %68 = load i64, ptr %8, align 8, !tbaa !24
  %69 = icmp slt i64 %68, 0
  br i1 %69, label %70, label %71

70:                                               ; preds = %56
  br label %173

71:                                               ; preds = %56
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %72, i32 0, i32 5
  %74 = load ptr, ptr %73, align 8, !tbaa !29
  %75 = getelementptr inbounds %struct._EFI_MANAGED_NETWORK_PROTOCOL, ptr %74, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8, !tbaa !30
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %77, i32 0, i32 5
  %79 = load ptr, ptr %78, align 8, !tbaa !29
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %80, i32 0, i32 8
  %82 = call i64 %76(ptr noundef %79, ptr noundef null, ptr noundef %81)
  store i64 %82, ptr %8, align 8, !tbaa !24
  %83 = load i64, ptr %8, align 8, !tbaa !24
  %84 = icmp ne i64 %83, -9223372036854775789
  br i1 %84, label %85, label %89

85:                                               ; preds = %71
  %86 = load i64, ptr %8, align 8, !tbaa !24
  %87 = icmp slt i64 %86, 0
  br i1 %87, label %88, label %89

88:                                               ; preds = %85
  br label %173

89:                                               ; preds = %85, %71
  %90 = load ptr, ptr %7, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %90, i32 0, i32 8
  %92 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %91, i32 0, i32 14
  %93 = load i8, ptr %92, align 8, !tbaa !32
  %94 = zext i8 %93 to i32
  %95 = icmp ne i32 %94, 1
  br i1 %95, label %96, label %97

96:                                               ; preds = %89
  store i64 -9223372036854775805, ptr %8, align 8, !tbaa !24
  br label %173

97:                                               ; preds = %89
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %98, i32 0, i32 6
  %100 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, ptr %99, i32 0, i32 0
  store i32 0, ptr %100, align 8, !tbaa !33
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %101, i32 0, i32 6
  %103 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, ptr %102, i32 0, i32 1
  store i32 0, ptr %103, align 4, !tbaa !34
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %104, i32 0, i32 6
  %106 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, ptr %105, i32 0, i32 2
  store i16 2054, ptr %106, align 8, !tbaa !35
  %107 = load ptr, ptr %7, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %107, i32 0, i32 6
  %109 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, ptr %108, i32 0, i32 3
  store i8 1, ptr %109, align 2, !tbaa !36
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %110, i32 0, i32 6
  %112 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, ptr %111, i32 0, i32 4
  store i8 0, ptr %112, align 1, !tbaa !37
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %113, i32 0, i32 6
  %115 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, ptr %114, i32 0, i32 5
  store i8 1, ptr %115, align 4, !tbaa !38
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %116, i32 0, i32 6
  %118 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, ptr %117, i32 0, i32 6
  store i8 0, ptr %118, align 1, !tbaa !39
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %119, i32 0, i32 6
  %121 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, ptr %120, i32 0, i32 7
  store i8 1, ptr %121, align 2, !tbaa !40
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %122, i32 0, i32 6
  %124 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, ptr %123, i32 0, i32 8
  store i8 0, ptr %124, align 1, !tbaa !41
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %125, i32 0, i32 6
  %127 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, ptr %126, i32 0, i32 9
  store i8 0, ptr %127, align 8, !tbaa !42
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %128, i32 0, i32 5
  %130 = load ptr, ptr %129, align 8, !tbaa !29
  %131 = getelementptr inbounds %struct._EFI_MANAGED_NETWORK_PROTOCOL, ptr %130, i32 0, i32 1
  %132 = load ptr, ptr %131, align 8, !tbaa !43
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %133, i32 0, i32 5
  %135 = load ptr, ptr %134, align 8, !tbaa !29
  %136 = load ptr, ptr %7, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %136, i32 0, i32 6
  %138 = call i64 %132(ptr noundef %135, ptr noundef %137)
  store i64 %138, ptr %8, align 8, !tbaa !24
  %139 = load i64, ptr %8, align 8, !tbaa !24
  %140 = icmp slt i64 %139, 0
  br i1 %140, label %141, label %142

141:                                              ; preds = %97
  br label %173

142:                                              ; preds = %97
  %143 = load ptr, ptr @gBS, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %143, i32 0, i32 8
  %145 = load ptr, ptr %144, align 8, !tbaa !44
  %146 = load ptr, ptr %7, align 8, !tbaa !5
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %147, i32 0, i32 7
  %149 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN, ptr %148, i32 0, i32 0
  %150 = call i64 %145(i32 noundef 512, i64 noundef 16, ptr noundef @ArpOnFrameRcvd, ptr noundef %146, ptr noundef %149)
  store i64 %150, ptr %8, align 8, !tbaa !24
  %151 = load i64, ptr %8, align 8, !tbaa !24
  %152 = icmp slt i64 %151, 0
  br i1 %152, label %153, label %154

153:                                              ; preds = %142
  br label %173

154:                                              ; preds = %142
  %155 = load ptr, ptr @gBS, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %155, i32 0, i32 8
  %157 = load ptr, ptr %156, align 8, !tbaa !44
  %158 = load ptr, ptr %7, align 8, !tbaa !5
  %159 = load ptr, ptr %7, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %159, i32 0, i32 14
  %161 = call i64 %157(i32 noundef -2147483136, i64 noundef 8, ptr noundef @ArpTimerHandler, ptr noundef %158, ptr noundef %160)
  store i64 %161, ptr %8, align 8, !tbaa !24
  %162 = load i64, ptr %8, align 8, !tbaa !24
  %163 = icmp slt i64 %162, 0
  br i1 %163, label %164, label %165

164:                                              ; preds = %154
  br label %173

165:                                              ; preds = %154
  %166 = load ptr, ptr @gBS, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %166, i32 0, i32 9
  %168 = load ptr, ptr %167, align 8, !tbaa !45
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %169, i32 0, i32 14
  %171 = load ptr, ptr %170, align 8, !tbaa !46
  %172 = call i64 %168(ptr noundef %171, i32 noundef 1, i64 noundef 5000000)
  store i64 %172, ptr %8, align 8, !tbaa !24
  br label %173

173:                                              ; preds = %165, %164, %153, %141, %96, %88, %70
  %174 = load i64, ptr %8, align 8, !tbaa !24
  store i64 %174, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %175

175:                                              ; preds = %173, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %176 = load i64, ptr %4, align 8
  ret i64 %176
}

; 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 @InitializeListHead(ptr noundef) #2

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

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

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

declare void @ArpOnFrameRcvd(ptr noundef, ptr noundef) #2

declare void @ArpTimerHandler(ptr noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { 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 = !{!"_ARP_SERVICE_DATA", !11, i64 0, !12, i64 8, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !13, i64 56, !15, i64 80, !17, i64 104, !16, i64 760, !19, i64 768, !19, i64 784, !19, i64 800, !19, i64 816, !6, i64 832}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!13 = !{!"", !11, i64 0, !11, i64 4, !14, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!14 = !{!"short", !7, i64 0}
!15 = !{!"", !6, i64 0, !16, i64 8, !7, i64 16}
!16 = !{!"long long", !7, i64 0}
!17 = !{!"", !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, !18, i64 552, !18, i64 584, !18, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!18 = !{!"", !7, i64 0}
!19 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!20 = !{!10, !6, i64 8}
!21 = !{!10, !6, i64 16}
!22 = !{!10, !6, i64 32}
!23 = !{!10, !6, i64 40}
!24 = !{!16, !16, i64 0}
!25 = !{!26, !6, i64 280}
!26 = !{!"", !27, 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}
!27 = !{!"", !16, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!28 = !{!10, !6, i64 24}
!29 = !{!10, !6, i64 48}
!30 = !{!31, !6, i64 0}
!31 = !{!"_EFI_MANAGED_NETWORK_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}
!32 = !{!10, !7, i64 752}
!33 = !{!10, !11, i64 56}
!34 = !{!10, !11, i64 60}
!35 = !{!10, !14, i64 64}
!36 = !{!10, !7, i64 66}
!37 = !{!10, !7, i64 67}
!38 = !{!10, !7, i64 68}
!39 = !{!10, !7, i64 69}
!40 = !{!10, !7, i64 70}
!41 = !{!10, !7, i64 71}
!42 = !{!10, !7, i64 72}
!43 = !{!31, !6, i64 8}
!44 = !{!26, !6, i64 80}
!45 = !{!26, !6, i64 88}
!46 = !{!10, !6, i64 832}


; 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] }

@.str = external hidden unnamed_addr constant [151 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [27 x i8], align 1
@gEfiManagedNetworkServiceBindingProtocolGuid = external global %struct.GUID, align 4
@gBS = external local_unnamed_addr global ptr, align 8
@gEfiManagedNetworkProtocolGuid = external global %struct.GUID, align 4

; Function Attrs: nounwind uwtable
define dso_local i64 @ArpCreateService(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = tail call zeroext i8 @DebugAssertEnabled() #2
  %5 = icmp eq i8 %4, 0
  %6 = icmp ne ptr %2, null
  %or.cond3 = or i1 %6, %5
  br i1 %or.cond3, label %8, label %7

7:                                                ; preds = %3
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 53, ptr noundef nonnull @.str.1) #2
  br label %8

8:                                                ; preds = %7, %3
  store i32 1397772865, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %2, i64 768
  %10 = tail call ptr @InitializeListHead(ptr noundef nonnull %9) #2
  %11 = getelementptr inbounds i8, ptr %2, i64 784
  %12 = tail call ptr @InitializeListHead(ptr noundef nonnull %11) #2
  %13 = getelementptr inbounds i8, ptr %2, i64 800
  %14 = tail call ptr @InitializeListHead(ptr noundef nonnull %13) #2
  %15 = getelementptr inbounds i8, ptr %2, i64 816
  %16 = tail call ptr @InitializeListHead(ptr noundef nonnull %15) #2
  %17 = getelementptr inbounds i8, ptr %2, i64 8
  store ptr @ArpServiceBindingCreateChild, ptr %17, align 8, !tbaa !19
  %18 = getelementptr inbounds i8, ptr %2, i64 16
  store ptr @ArpServiceBindingDestroyChild, ptr %18, align 8, !tbaa !20
  %19 = getelementptr inbounds i8, ptr %2, i64 32
  store ptr %0, ptr %19, align 8, !tbaa !21
  %20 = getelementptr inbounds i8, ptr %2, i64 40
  store ptr %1, ptr %20, align 8, !tbaa !22
  %21 = getelementptr inbounds i8, ptr %2, i64 24
  %22 = tail call i64 @NetLibCreateServiceChild(ptr noundef %1, ptr noundef %0, ptr noundef nonnull @gEfiManagedNetworkServiceBindingProtocolGuid, ptr noundef nonnull %21) #2
  %23 = icmp slt i64 %22, 0
  br i1 %23, label %75, label %24

24:                                               ; preds = %8
  %25 = load ptr, ptr @gBS, align 8, !tbaa !23
  %26 = getelementptr inbounds i8, ptr %25, i64 280
  %27 = load ptr, ptr %26, align 8, !tbaa !24
  %28 = load ptr, ptr %21, align 8, !tbaa !27
  %29 = getelementptr inbounds i8, ptr %2, i64 48
  %30 = tail call i64 %27(ptr noundef %28, ptr noundef nonnull @gEfiManagedNetworkProtocolGuid, ptr noundef nonnull %29, ptr noundef %0, ptr noundef %1, i32 noundef 16) #2
  %31 = icmp slt i64 %30, 0
  br i1 %31, label %75, label %32

32:                                               ; preds = %24
  %33 = load ptr, ptr %29, align 8, !tbaa !28
  %34 = load ptr, ptr %33, align 8, !tbaa !29
  %35 = getelementptr inbounds i8, ptr %2, i64 104
  %36 = tail call i64 %34(ptr noundef nonnull %33, ptr noundef null, ptr noundef nonnull %35) #2
  %37 = icmp ne i64 %36, -9223372036854775789
  %38 = icmp slt i64 %36, 0
  %or.cond = and i1 %37, %38
  br i1 %or.cond, label %75, label %39

39:                                               ; preds = %32
  %40 = getelementptr inbounds i8, ptr %2, i64 752
  %41 = load i8, ptr %40, align 8, !tbaa !31
  %.not = icmp eq i8 %41, 1
  br i1 %.not, label %42, label %75

42:                                               ; preds = %39
  %43 = getelementptr inbounds i8, ptr %2, i64 56
  store i32 0, ptr %43, align 8, !tbaa !32
  %44 = getelementptr inbounds i8, ptr %2, i64 60
  store i32 0, ptr %44, align 4, !tbaa !33
  %45 = getelementptr inbounds i8, ptr %2, i64 64
  store i16 2054, ptr %45, align 8, !tbaa !34
  %46 = getelementptr inbounds i8, ptr %2, i64 66
  store <4 x i8> <i8 1, i8 0, i8 1, i8 0>, ptr %46, align 2, !tbaa !35
  %47 = getelementptr inbounds i8, ptr %2, i64 70
  store i8 1, ptr %47, align 2, !tbaa !36
  %48 = getelementptr inbounds i8, ptr %2, i64 71
  store i8 0, ptr %48, align 1, !tbaa !37
  %49 = getelementptr inbounds i8, ptr %2, i64 72
  store i8 0, ptr %49, align 8, !tbaa !38
  %50 = load ptr, ptr %29, align 8, !tbaa !28
  %51 = getelementptr inbounds i8, ptr %50, i64 8
  %52 = load ptr, ptr %51, align 8, !tbaa !39
  %53 = tail call i64 %52(ptr noundef %50, ptr noundef nonnull %43) #2
  %54 = icmp slt i64 %53, 0
  br i1 %54, label %75, label %55

55:                                               ; preds = %42
  %56 = load ptr, ptr @gBS, align 8, !tbaa !23
  %57 = getelementptr inbounds i8, ptr %56, i64 80
  %58 = load ptr, ptr %57, align 8, !tbaa !40
  %59 = getelementptr inbounds i8, ptr %2, i64 80
  %60 = tail call i64 %58(i32 noundef 512, i64 noundef 16, ptr noundef nonnull @ArpOnFrameRcvd, ptr noundef nonnull %2, ptr noundef nonnull %59) #2
  %61 = icmp slt i64 %60, 0
  br i1 %61, label %75, label %62

62:                                               ; preds = %55
  %63 = load ptr, ptr @gBS, align 8, !tbaa !23
  %64 = getelementptr inbounds i8, ptr %63, i64 80
  %65 = load ptr, ptr %64, align 8, !tbaa !40
  %66 = getelementptr inbounds i8, ptr %2, i64 832
  %67 = tail call i64 %65(i32 noundef -2147483136, i64 noundef 8, ptr noundef nonnull @ArpTimerHandler, ptr noundef nonnull %2, ptr noundef nonnull %66) #2
  %68 = icmp slt i64 %67, 0
  br i1 %68, label %75, label %69

69:                                               ; preds = %62
  %70 = load ptr, ptr @gBS, align 8, !tbaa !23
  %71 = getelementptr inbounds i8, ptr %70, i64 88
  %72 = load ptr, ptr %71, align 8, !tbaa !41
  %73 = load ptr, ptr %66, align 8, !tbaa !42
  %74 = tail call i64 %72(ptr noundef %73, i32 noundef 1, i64 noundef 5000000) #2
  br label %75

75:                                               ; preds = %69, %24, %32, %42, %55, %62, %39, %8
  %.053 = phi i64 [ %22, %8 ], [ %30, %24 ], [ %36, %32 ], [ %53, %42 ], [ %60, %55 ], [ %67, %62 ], [ %74, %69 ], [ -9223372036854775805, %39 ]
  ret i64 %.053
}

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

declare ptr @InitializeListHead(ptr noundef) local_unnamed_addr #1

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

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

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

declare void @ArpOnFrameRcvd(ptr noundef, ptr noundef) #1

declare void @ArpTimerHandler(ptr noundef, ptr noundef) #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, !7, i64 0}
!6 = !{!"_ARP_SERVICE_DATA", !7, i64 0, !10, i64 8, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !12, i64 56, !14, i64 80, !16, i64 104, !15, i64 760, !18, i64 768, !18, i64 784, !18, i64 800, !18, i64 816, !11, i64 832}
!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 = !{!"", !7, i64 0, !7, i64 4, !13, i64 8, !8, i64 10, !8, i64 11, !8, i64 12, !8, i64 13, !8, i64 14, !8, i64 15, !8, i64 16}
!13 = !{!"short", !8, i64 0}
!14 = !{!"", !11, i64 0, !15, i64 8, !8, i64 16}
!15 = !{!"long long", !8, i64 0}
!16 = !{!"", !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, !17, i64 552, !17, i64 584, !17, i64 616, !8, i64 648, !8, i64 649, !8, i64 650, !8, i64 651, !8, i64 652}
!17 = !{!"", !8, i64 0}
!18 = !{!"_LIST_ENTRY", !11, i64 0, !11, i64 8}
!19 = !{!6, !11, i64 8}
!20 = !{!6, !11, i64 16}
!21 = !{!6, !11, i64 32}
!22 = !{!6, !11, i64 40}
!23 = !{!11, !11, i64 0}
!24 = !{!25, !11, i64 280}
!25 = !{!"", !26, 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}
!26 = !{!"", !15, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!27 = !{!6, !11, i64 24}
!28 = !{!6, !11, i64 48}
!29 = !{!30, !11, i64 0}
!30 = !{!"_EFI_MANAGED_NETWORK_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}
!31 = !{!6, !8, i64 752}
!32 = !{!6, !7, i64 56}
!33 = !{!6, !7, i64 60}
!34 = !{!6, !13, i64 64}
!35 = !{!8, !8, i64 0}
!36 = !{!6, !8, i64 70}
!37 = !{!6, !8, i64 71}
!38 = !{!6, !8, i64 72}
!39 = !{!30, !11, i64 8}
!40 = !{!25, !11, i64 80}
!41 = !{!25, !11, i64 88}
!42 = !{!6, !11, i64 832}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass