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

; 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.NET_ARP_ADDRESS = type { i16, i8, ptr, %union.NET_ARP_ADDRESS_UNION }
%union.NET_ARP_ADDRESS_UNION = type { [32 x i8] }
%struct.ARP_INSTANCE_DATA = type { i32, ptr, ptr, %struct._EFI_ARP_PROTOCOL, %struct._LIST_ENTRY, %struct.EFI_ARP_CONFIG_DATA, i8, i8 }
%struct._EFI_ARP_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.EFI_ARP_CONFIG_DATA = type { i16, i8, ptr, i32, i32, i32 }
%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.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.ARP_CACHE_ENTRY = type { %struct._LIST_ENTRY, i32, i32, i32, i32, [2 x %struct.NET_ARP_ADDRESS], %struct._LIST_ENTRY }

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

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

declare zeroext i8 @DebugAssertEnabled() #1

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

; 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 @ArpAdd(ptr noundef %0, i8 noundef zeroext %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i8 noundef zeroext %5) #2 {
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i8, align 1
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca [2 x %struct.NET_ARP_ADDRESS], align 16
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i8 %1, ptr %9, align 1, !tbaa !9
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store i32 %4, ptr %12, align 4, !tbaa !10
  store i8 %5, ptr %13, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 96, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %25

24:                                               ; preds = %6
  store i64 -9223372036854775806, ptr %7, align 8
  store i32 1, ptr %21, align 4
  br label %210

25:                                               ; preds = %6
  %26 = load i8, ptr %9, align 1, !tbaa !9
  %27 = icmp ne i8 %26, 0
  br i1 %27, label %34, label %28

28:                                               ; preds = %25
  %29 = load ptr, ptr %11, align 8, !tbaa !5
  %30 = icmp eq ptr %29, null
  br i1 %30, label %50, label %31

31:                                               ; preds = %28
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  %33 = icmp eq ptr %32, null
  br i1 %33, label %50, label %34

34:                                               ; preds = %31, %25
  %35 = load i8, ptr %9, align 1, !tbaa !9
  %36 = zext i8 %35 to i32
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %44

38:                                               ; preds = %34
  %39 = load ptr, ptr %11, align 8, !tbaa !5
  %40 = icmp ne ptr %39, null
  br i1 %40, label %41, label %44

41:                                               ; preds = %38
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = icmp ne ptr %42, null
  br i1 %43, label %50, label %44

44:                                               ; preds = %41, %38, %34
  %45 = load ptr, ptr %11, align 8, !tbaa !5
  %46 = icmp eq ptr %45, null
  br i1 %46, label %47, label %51

47:                                               ; preds = %44
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = icmp eq ptr %48, null
  br i1 %49, label %50, label %51

50:                                               ; preds = %47, %41, %31, %28
  store i64 -9223372036854775806, ptr %7, align 8
  store i32 1, ptr %21, align 4
  br label %210

51:                                               ; preds = %47, %44
  %52 = call zeroext i8 @DebugAssertEnabled()
  %53 = zext i8 %52 to i32
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %65

55:                                               ; preds = %51
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = ptrtoint ptr %56 to i64
  %58 = sub i64 %57, ptrtoint (ptr getelementptr inbounds (%struct.ARP_INSTANCE_DATA, ptr null, i32 0, i32 3) to i64)
  %59 = inttoptr i64 %58 to ptr
  %60 = getelementptr inbounds %struct.ARP_INSTANCE_DATA, ptr %59, i32 0, i32 0
  %61 = load i32, ptr %60, align 8, !tbaa !12
  %62 = icmp ne i32 %61, 1230000705
  br i1 %62, label %63, label %65

63:                                               ; preds = %55
  call void @DebugAssert(ptr noundef @.str, i64 noundef 157, ptr noundef @.str.1)
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  br label %70

65:                                               ; preds = %55, %51
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = ptrtoint ptr %66 to i64
  %68 = sub i64 %67, ptrtoint (ptr getelementptr inbounds (%struct.ARP_INSTANCE_DATA, ptr null, i32 0, i32 3) to i64)
  %69 = inttoptr i64 %68 to ptr
  br label %70

70:                                               ; preds = %65, %63
  %71 = phi ptr [ %64, %63 ], [ %69, %65 ]
  store ptr %71, ptr %15, align 8, !tbaa !5
  %72 = load ptr, ptr %15, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.ARP_INSTANCE_DATA, ptr %72, i32 0, i32 6
  %74 = load i8, ptr %73, align 8, !tbaa !18
  %75 = icmp ne i8 %74, 0
  br i1 %75, label %77, label %76

76:                                               ; preds = %70
  store i64 -9223372036854775789, ptr %7, align 8
  store i32 1, ptr %21, align 4
  br label %210

77:                                               ; preds = %70
  store i64 0, ptr %14, align 8, !tbaa !19
  %78 = load ptr, ptr %15, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.ARP_INSTANCE_DATA, ptr %78, i32 0, i32 1
  %80 = load ptr, ptr %79, align 8, !tbaa !21
  store ptr %80, ptr %16, align 8, !tbaa !5
  %81 = load ptr, ptr %15, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.ARP_INSTANCE_DATA, ptr %81, i32 0, i32 1
  %83 = load ptr, ptr %82, align 8, !tbaa !21
  %84 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %83, i32 0, i32 8
  store ptr %84, ptr %18, align 8, !tbaa !5
  %85 = load ptr, ptr %18, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %85, i32 0, i32 14
  %87 = load i8, ptr %86, align 4, !tbaa !22
  %88 = zext i8 %87 to i16
  %89 = getelementptr inbounds [2 x %struct.NET_ARP_ADDRESS], ptr %19, i64 0, i64 0
  %90 = getelementptr inbounds %struct.NET_ARP_ADDRESS, ptr %89, i32 0, i32 0
  store i16 %88, ptr %90, align 16, !tbaa !25
  %91 = load ptr, ptr %18, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %91, i32 0, i32 1
  %93 = load i32, ptr %92, align 4, !tbaa !27
  %94 = trunc i32 %93 to i8
  %95 = getelementptr inbounds [2 x %struct.NET_ARP_ADDRESS], ptr %19, i64 0, i64 0
  %96 = getelementptr inbounds %struct.NET_ARP_ADDRESS, ptr %95, i32 0, i32 1
  store i8 %94, ptr %96, align 2, !tbaa !28
  %97 = load ptr, ptr %11, align 8, !tbaa !5
  %98 = getelementptr inbounds [2 x %struct.NET_ARP_ADDRESS], ptr %19, i64 0, i64 0
  %99 = getelementptr inbounds %struct.NET_ARP_ADDRESS, ptr %98, i32 0, i32 2
  store ptr %97, ptr %99, align 8, !tbaa !29
  %100 = load ptr, ptr %15, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.ARP_INSTANCE_DATA, ptr %100, i32 0, i32 5
  %102 = getelementptr inbounds %struct.EFI_ARP_CONFIG_DATA, ptr %101, i32 0, i32 0
  %103 = load i16, ptr %102, align 8, !tbaa !30
  %104 = getelementptr inbounds [2 x %struct.NET_ARP_ADDRESS], ptr %19, i64 0, i64 1
  %105 = getelementptr inbounds %struct.NET_ARP_ADDRESS, ptr %104, i32 0, i32 0
  store i16 %103, ptr %105, align 16, !tbaa !25
  %106 = load ptr, ptr %15, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.ARP_INSTANCE_DATA, ptr %106, i32 0, i32 5
  %108 = getelementptr inbounds %struct.EFI_ARP_CONFIG_DATA, ptr %107, i32 0, i32 1
  %109 = load i8, ptr %108, align 2, !tbaa !31
  %110 = getelementptr inbounds [2 x %struct.NET_ARP_ADDRESS], ptr %19, i64 0, i64 1
  %111 = getelementptr inbounds %struct.NET_ARP_ADDRESS, ptr %110, i32 0, i32 1
  store i8 %109, ptr %111, align 2, !tbaa !28
  %112 = load ptr, ptr %10, align 8, !tbaa !5
  %113 = getelementptr inbounds [2 x %struct.NET_ARP_ADDRESS], ptr %19, i64 0, i64 1
  %114 = getelementptr inbounds %struct.NET_ARP_ADDRESS, ptr %113, i32 0, i32 2
  store ptr %112, ptr %114, align 8, !tbaa !29
  %115 = load ptr, ptr @gBS, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %115, i32 0, i32 1
  %117 = load ptr, ptr %116, align 8, !tbaa !32
  %118 = call i64 %117(i64 noundef 8)
  store i64 %118, ptr %20, align 8, !tbaa !19
  %119 = load ptr, ptr %16, align 8, !tbaa !5
  %120 = getelementptr inbounds [2 x %struct.NET_ARP_ADDRESS], ptr %19, i64 0, i64 1
  %121 = getelementptr inbounds [2 x %struct.NET_ARP_ADDRESS], ptr %19, i64 0, i64 0
  %122 = call ptr @ArpFindDeniedCacheEntry(ptr noundef %119, ptr noundef %120, ptr noundef %121)
  store ptr %122, ptr %17, align 8, !tbaa !5
  %123 = load ptr, ptr %17, align 8, !tbaa !5
  %124 = icmp eq ptr %123, null
  br i1 %124, label %125, label %131

125:                                              ; preds = %77
  %126 = load ptr, ptr %16, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %126, i32 0, i32 13
  %128 = getelementptr inbounds [2 x %struct.NET_ARP_ADDRESS], ptr %19, i64 0, i64 1
  %129 = getelementptr inbounds [2 x %struct.NET_ARP_ADDRESS], ptr %19, i64 0, i64 0
  %130 = call ptr @ArpFindNextCacheEntryInTable(ptr noundef %127, ptr noundef null, i32 noundef 3, ptr noundef %128, ptr noundef %129)
  store ptr %130, ptr %17, align 8, !tbaa !5
  br label %131

131:                                              ; preds = %125, %77
  %132 = load ptr, ptr %17, align 8, !tbaa !5
  %133 = icmp ne ptr %132, null
  br i1 %133, label %134, label %138

134:                                              ; preds = %131
  %135 = load i8, ptr %13, align 1, !tbaa !9
  %136 = icmp ne i8 %135, 0
  br i1 %136, label %138, label %137

137:                                              ; preds = %134
  store i64 -9223372036854775793, ptr %14, align 8, !tbaa !19
  br label %204

138:                                              ; preds = %134, %131
  %139 = load ptr, ptr %17, align 8, !tbaa !5
  %140 = icmp eq ptr %139, null
  br i1 %140, label %141, label %149

141:                                              ; preds = %138
  %142 = load ptr, ptr %10, align 8, !tbaa !5
  %143 = icmp ne ptr %142, null
  br i1 %143, label %144, label %149

144:                                              ; preds = %141
  %145 = load ptr, ptr %16, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %145, i32 0, i32 11
  %147 = getelementptr inbounds [2 x %struct.NET_ARP_ADDRESS], ptr %19, i64 0, i64 1
  %148 = call ptr @ArpFindNextCacheEntryInTable(ptr noundef %146, ptr noundef null, i32 noundef 1, ptr noundef %147, ptr noundef null)
  store ptr %148, ptr %17, align 8, !tbaa !5
  br label %149

149:                                              ; preds = %144, %141, %138
  %150 = load ptr, ptr %17, align 8, !tbaa !5
  %151 = icmp ne ptr %150, null
  br i1 %151, label %152, label %156

152:                                              ; preds = %149
  %153 = load ptr, ptr %17, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.ARP_CACHE_ENTRY, ptr %153, i32 0, i32 0
  %155 = call ptr @RemoveEntryList(ptr noundef %154)
  br label %177

156:                                              ; preds = %149
  %157 = load ptr, ptr %15, align 8, !tbaa !5
  %158 = call ptr @ArpAllocCacheEntry(ptr noundef %157)
  store ptr %158, ptr %17, align 8, !tbaa !5
  %159 = load ptr, ptr %17, align 8, !tbaa !5
  %160 = icmp eq ptr %159, null
  br i1 %160, label %161, label %176

161:                                              ; preds = %156
  br label %162

162:                                              ; preds = %161
  %163 = call zeroext i8 @DebugPrintEnabled()
  %164 = icmp ne i8 %163, 0
  br i1 %164, label %165, label %173

165:                                              ; preds = %162
  br label %166

166:                                              ; preds = %165
  %167 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %168 = icmp ne i8 %167, 0
  br i1 %168, label %169, label %170

169:                                              ; preds = %166
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.2)
  br label %170

170:                                              ; preds = %169, %166
  br label %171

171:                                              ; preds = %170
  br label %172

172:                                              ; preds = %171
  br label %173

173:                                              ; preds = %172, %162
  br label %174

174:                                              ; preds = %173
  br label %175

175:                                              ; preds = %174
  store i64 -9223372036854775799, ptr %14, align 8, !tbaa !19
  br label %204

176:                                              ; preds = %156
  br label %177

177:                                              ; preds = %176, %152
  %178 = load i32, ptr %12, align 4, !tbaa !10
  %179 = load ptr, ptr %17, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.ARP_CACHE_ENTRY, ptr %179, i32 0, i32 2
  store i32 %178, ptr %180, align 4, !tbaa !35
  %181 = load i32, ptr %12, align 4, !tbaa !10
  %182 = load ptr, ptr %17, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.ARP_CACHE_ENTRY, ptr %182, i32 0, i32 3
  store i32 %181, ptr %183, align 8, !tbaa !37
  %184 = load ptr, ptr %17, align 8, !tbaa !5
  %185 = getelementptr inbounds [2 x %struct.NET_ARP_ADDRESS], ptr %19, i64 0, i64 0
  %186 = getelementptr inbounds [2 x %struct.NET_ARP_ADDRESS], ptr %19, i64 0, i64 1
  call void @ArpFillAddressInCacheEntry(ptr noundef %184, ptr noundef %185, ptr noundef %186)
  %187 = load ptr, ptr %17, align 8, !tbaa !5
  %188 = call i64 @ArpAddressResolved(ptr noundef %187, ptr noundef null, ptr noundef null)
  %189 = load i8, ptr %9, align 1, !tbaa !9
  %190 = icmp ne i8 %189, 0
  br i1 %190, label %191, label %197

191:                                              ; preds = %177
  %192 = load ptr, ptr %16, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %192, i32 0, i32 12
  %194 = load ptr, ptr %17, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.ARP_CACHE_ENTRY, ptr %194, i32 0, i32 0
  %196 = call ptr @InsertHeadList(ptr noundef %193, ptr noundef %195)
  br label %203

197:                                              ; preds = %177
  %198 = load ptr, ptr %16, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %198, i32 0, i32 13
  %200 = load ptr, ptr %17, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.ARP_CACHE_ENTRY, ptr %200, i32 0, i32 0
  %202 = call ptr @InsertHeadList(ptr noundef %199, ptr noundef %201)
  br label %203

203:                                              ; preds = %197, %191
  br label %204

204:                                              ; preds = %203, %175, %137
  %205 = load ptr, ptr @gBS, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %205, i32 0, i32 2
  %207 = load ptr, ptr %206, align 8, !tbaa !38
  %208 = load i64, ptr %20, align 8, !tbaa !19
  call void %207(i64 noundef %208)
  %209 = load i64, ptr %14, align 8, !tbaa !19
  store i64 %209, ptr %7, align 8
  store i32 1, ptr %21, align 4
  br label %210

210:                                              ; preds = %204, %76, %50, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 96, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  %211 = load i64, ptr %7, align 8
  ret i64 %211
}

declare ptr @ArpFindDeniedCacheEntry(ptr noundef, ptr noundef, ptr noundef) #1

declare ptr @ArpFindNextCacheEntryInTable(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #1

declare ptr @RemoveEntryList(ptr noundef) #1

declare ptr @ArpAllocCacheEntry(ptr noundef) #1

declare zeroext i8 @DebugPrintEnabled() #1

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #1

declare void @DebugPrint(i64 noundef, ptr noundef, ...) #1

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

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

declare ptr @InsertHeadList(ptr noundef, 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 0}
!13 = !{!"", !11, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !15, i64 80, !16, i64 96, !7, i64 128, !7, i64 129}
!14 = !{!"_EFI_ARP_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!15 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!16 = !{!"", !17, i64 0, !7, i64 2, !6, i64 8, !11, i64 16, !11, i64 20, !11, i64 24}
!17 = !{!"short", !7, i64 0}
!18 = !{!13, !7, i64 128}
!19 = !{!20, !20, i64 0}
!20 = !{!"long long", !7, i64 0}
!21 = !{!13, !6, i64 8}
!22 = !{!23, !7, i64 648}
!23 = !{!"", !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, !24, i64 552, !24, i64 584, !24, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!24 = !{!"", !7, i64 0}
!25 = !{!26, !17, i64 0}
!26 = !{!"", !17, i64 0, !7, i64 2, !6, i64 8, !7, i64 16}
!27 = !{!23, !11, i64 4}
!28 = !{!26, !7, i64 2}
!29 = !{!26, !6, i64 8}
!30 = !{!13, !17, i64 96}
!31 = !{!13, !7, i64 98}
!32 = !{!33, !6, i64 24}
!33 = !{!"", !34, 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}
!34 = !{!"", !20, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!35 = !{!36, !11, i64 20}
!36 = !{!"", !15, i64 0, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !7, i64 32, !15, i64 128}
!37 = !{!36, !11, i64 24}
!38 = !{!33, !6, i64 32}


; 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.NET_ARP_ADDRESS = type { i16, i8, ptr, %union.NET_ARP_ADDRESS_UNION }
%union.NET_ARP_ADDRESS_UNION = type { [32 x i8] }

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

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

; Function Attrs: mustprogress 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 range(i64 -9223372036854775806, 1) i64 @ArpAdd(ptr noundef %0, i8 noundef zeroext %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i8 noundef zeroext %5) local_unnamed_addr #2 {
  %7 = alloca [2 x %struct.NET_ARP_ADDRESS], align 16
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %7) #3
  %8 = icmp eq ptr %0, null
  br i1 %8, label %86, label %9

9:                                                ; preds = %6
  %.not = icmp eq i8 %1, 0
  br i1 %.not, label %10, label %13

10:                                               ; preds = %9
  %11 = icmp eq ptr %3, null
  %12 = icmp eq ptr %2, null
  %or.cond = or i1 %12, %11
  br i1 %or.cond, label %86, label %.thread70

13:                                               ; preds = %9
  %14 = icmp ne ptr %3, null
  %15 = icmp ne ptr %2, null
  %or.cond5 = and i1 %15, %14
  br i1 %or.cond5, label %86, label %16

16:                                               ; preds = %13
  %17 = icmp eq ptr %3, null
  %18 = icmp eq ptr %2, null
  %or.cond7 = and i1 %18, %17
  br i1 %or.cond7, label %86, label %.thread70

.thread70:                                        ; preds = %10, %16
  %19 = phi i1 [ %15, %16 ], [ true, %10 ]
  %20 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not62 = icmp eq i8 %20, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre72 = add i64 %.pre, -24
  %.pre74 = inttoptr i64 %.pre72 to ptr
  br i1 %.not62, label %.thread70._crit_edge, label %21

21:                                               ; preds = %.thread70
  %22 = load i32, ptr %.pre74, align 8, !tbaa !5
  %.not63 = icmp eq i32 %22, 1230000705
  br i1 %.not63, label %.thread70._crit_edge, label %23

23:                                               ; preds = %21
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 157, ptr noundef nonnull @.str.1) #3
  br label %.thread70._crit_edge

.thread70._crit_edge:                             ; preds = %.thread70, %21, %23
  %24 = phi ptr [ %0, %23 ], [ %.pre74, %21 ], [ %.pre74, %.thread70 ]
  %25 = getelementptr inbounds i8, ptr %24, i64 128
  %26 = load i8, ptr %25, align 8, !tbaa !15
  %.not64 = icmp eq i8 %26, 0
  br i1 %.not64, label %86, label %27

27:                                               ; preds = %.thread70._crit_edge
  %28 = getelementptr inbounds i8, ptr %24, i64 8
  %29 = load ptr, ptr %28, align 8, !tbaa !16
  %30 = getelementptr inbounds i8, ptr %29, i64 752
  %31 = load i8, ptr %30, align 4, !tbaa !17
  %32 = zext i8 %31 to i16
  store i16 %32, ptr %7, align 16, !tbaa !20
  %33 = getelementptr inbounds i8, ptr %29, i64 108
  %34 = load i32, ptr %33, align 4, !tbaa !22
  %35 = trunc i32 %34 to i8
  %36 = getelementptr inbounds i8, ptr %7, i64 2
  store i8 %35, ptr %36, align 2, !tbaa !23
  %37 = getelementptr inbounds i8, ptr %7, i64 8
  store ptr %3, ptr %37, align 8, !tbaa !24
  %38 = getelementptr inbounds i8, ptr %24, i64 96
  %39 = load i16, ptr %38, align 8, !tbaa !25
  %40 = getelementptr inbounds i8, ptr %7, i64 48
  store i16 %39, ptr %40, align 16, !tbaa !20
  %41 = getelementptr inbounds i8, ptr %24, i64 98
  %42 = load i8, ptr %41, align 2, !tbaa !26
  %43 = getelementptr inbounds i8, ptr %7, i64 50
  store i8 %42, ptr %43, align 2, !tbaa !23
  %44 = getelementptr inbounds i8, ptr %7, i64 56
  store ptr %2, ptr %44, align 8, !tbaa !24
  %45 = load ptr, ptr @gBS, align 8, !tbaa !27
  %46 = getelementptr inbounds i8, ptr %45, i64 24
  %47 = load ptr, ptr %46, align 8, !tbaa !28
  %48 = tail call i64 %47(i64 noundef 8) #3
  %49 = call ptr @ArpFindDeniedCacheEntry(ptr noundef %29, ptr noundef nonnull %40, ptr noundef nonnull %7) #3
  %50 = icmp eq ptr %49, null
  br i1 %50, label %51, label %54

51:                                               ; preds = %27
  %52 = getelementptr inbounds i8, ptr %29, i64 816
  %53 = call ptr @ArpFindNextCacheEntryInTable(ptr noundef nonnull %52, ptr noundef null, i32 noundef 3, ptr noundef nonnull %40, ptr noundef nonnull %7) #3
  br label %54

54:                                               ; preds = %51, %27
  %.058 = phi ptr [ %53, %51 ], [ %49, %27 ]
  %55 = icmp eq ptr %.058, null
  %56 = icmp ne i8 %5, 0
  %or.cond9 = or i1 %56, %55
  br i1 %or.cond9, label %57, label %82

57:                                               ; preds = %54
  %or.cond11 = and i1 %19, %55
  br i1 %or.cond11, label %58, label %61

58:                                               ; preds = %57
  %59 = getelementptr inbounds i8, ptr %29, i64 784
  %60 = call ptr @ArpFindNextCacheEntryInTable(ptr noundef nonnull %59, ptr noundef null, i32 noundef 1, ptr noundef nonnull %40, ptr noundef null) #3
  br label %61

61:                                               ; preds = %58, %57
  %.1 = phi ptr [ %60, %58 ], [ %.058, %57 ]
  %.not65 = icmp eq ptr %.1, null
  br i1 %.not65, label %64, label %62

62:                                               ; preds = %61
  %63 = call ptr @RemoveEntryList(ptr noundef nonnull %.1) #3
  br label %72

64:                                               ; preds = %61
  %65 = call ptr @ArpAllocCacheEntry(ptr noundef nonnull %24) #3
  %66 = icmp eq ptr %65, null
  br i1 %66, label %67, label %72

67:                                               ; preds = %64
  %68 = call zeroext i8 @DebugPrintEnabled() #3
  %.not66 = icmp eq i8 %68, 0
  br i1 %.not66, label %82, label %69

69:                                               ; preds = %67
  %70 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not67 = icmp eq i8 %70, 0
  br i1 %.not67, label %82, label %71

71:                                               ; preds = %69
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.2) #3
  br label %82

72:                                               ; preds = %64, %62
  %.2 = phi ptr [ %.1, %62 ], [ %65, %64 ]
  %73 = getelementptr inbounds i8, ptr %.2, i64 20
  store i32 %4, ptr %73, align 4, !tbaa !32
  %74 = getelementptr inbounds i8, ptr %.2, i64 24
  store i32 %4, ptr %74, align 8, !tbaa !34
  call void @ArpFillAddressInCacheEntry(ptr noundef nonnull %.2, ptr noundef nonnull %7, ptr noundef nonnull %40) #3
  %75 = call i64 @ArpAddressResolved(ptr noundef nonnull %.2, ptr noundef null, ptr noundef null) #3
  br i1 %.not, label %79, label %76

76:                                               ; preds = %72
  %77 = getelementptr inbounds i8, ptr %29, i64 800
  %78 = call ptr @InsertHeadList(ptr noundef nonnull %77, ptr noundef nonnull %.2) #3
  br label %82

79:                                               ; preds = %72
  %80 = getelementptr inbounds i8, ptr %29, i64 816
  %81 = call ptr @InsertHeadList(ptr noundef nonnull %80, ptr noundef nonnull %.2) #3
  br label %82

82:                                               ; preds = %67, %71, %69, %54, %76, %79
  %.057 = phi i64 [ 0, %76 ], [ 0, %79 ], [ -9223372036854775793, %54 ], [ -9223372036854775799, %69 ], [ -9223372036854775799, %71 ], [ -9223372036854775799, %67 ]
  %83 = load ptr, ptr @gBS, align 8, !tbaa !27
  %84 = getelementptr inbounds i8, ptr %83, i64 32
  %85 = load ptr, ptr %84, align 8, !tbaa !35
  call void %85(i64 noundef %48) #3
  br label %86

86:                                               ; preds = %.thread70._crit_edge, %10, %13, %16, %6, %82
  %.0 = phi i64 [ %.057, %82 ], [ -9223372036854775806, %6 ], [ -9223372036854775806, %16 ], [ -9223372036854775806, %13 ], [ -9223372036854775806, %10 ], [ -9223372036854775789, %.thread70._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %7) #3
  ret i64 %.0
}

declare ptr @ArpFindDeniedCacheEntry(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @ArpFindNextCacheEntryInTable(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @RemoveEntryList(ptr noundef) local_unnamed_addr #1

declare ptr @ArpAllocCacheEntry(ptr noundef) local_unnamed_addr #1

declare zeroext i8 @DebugPrintEnabled() local_unnamed_addr #1

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) local_unnamed_addr #1

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

declare void @ArpFillAddressInCacheEntry(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

declare ptr @InsertHeadList(ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = !{!"", !7, i64 0, !10, i64 8, !10, i64 16, !11, i64 24, !12, i64 80, !13, i64 96, !8, i64 128, !8, i64 129}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_EFI_ARP_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48}
!12 = !{!"_LIST_ENTRY", !10, i64 0, !10, i64 8}
!13 = !{!"", !14, i64 0, !8, i64 2, !10, i64 8, !7, i64 16, !7, i64 20, !7, i64 24}
!14 = !{!"short", !8, i64 0}
!15 = !{!6, !8, i64 128}
!16 = !{!6, !10, i64 8}
!17 = !{!18, !8, i64 648}
!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, !19, i64 552, !19, i64 584, !19, i64 616, !8, i64 648, !8, i64 649, !8, i64 650, !8, i64 651, !8, i64 652}
!19 = !{!"", !8, i64 0}
!20 = !{!21, !14, i64 0}
!21 = !{!"", !14, i64 0, !8, i64 2, !10, i64 8, !8, i64 16}
!22 = !{!18, !7, i64 4}
!23 = !{!21, !8, i64 2}
!24 = !{!21, !10, i64 8}
!25 = !{!6, !14, i64 96}
!26 = !{!6, !8, i64 98}
!27 = !{!10, !10, i64 0}
!28 = !{!29, !10, i64 24}
!29 = !{!"", !30, 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}
!30 = !{!"", !31, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!31 = !{!"long long", !8, i64 0}
!32 = !{!33, !7, i64 20}
!33 = !{!"", !12, i64 0, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !8, i64 32, !12, i64 128}
!34 = !{!33, !7, i64 24}
!35 = !{!29, !10, i64 32}


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