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

; 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._PXEBC_PRIVATE_DATA = type { i32, ptr, ptr, %struct._PXEBC_PRIVATE_PROTOCOL, 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_PXE_BASE_CODE_PROTOCOL, %struct._EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL, ptr, ptr, %struct.EFI_PXE_BASE_CODE_MODE, i32, i32, i32, i64, %struct.EFI_UDP4_CONFIG_DATA, %struct.EFI_UDP6_CONFIG_DATA, %struct.EFI_IP4_CONFIG_DATA, %struct.EFI_IP6_CONFIG_DATA, ptr, ptr, %struct.EFI_IP4_COMPLETION_TOKEN, %struct.EFI_IP6_COMPLETION_TOKEN, i8, i8, i8, i8, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, i16, i32, i32, i32, ptr, i64, i64, %union.PXEBC_DHCP_PACKET_CACHE, %union.PXEBC_DHCP_PACKET_CACHE, %union.PXEBC_DHCP_PACKET_CACHE, ptr, %struct.EFI_DHCP4_PACKET, i32, i32, [16 x %union.PXEBC_DHCP_PACKET_CACHE], i32, [8 x i32], [8 x [16 x i32]] }
%struct._PXEBC_PRIVATE_PROTOCOL = type { i64 }
%struct._EFI_PXE_BASE_CODE_PROTOCOL = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL = type { i64, ptr }
%struct.EFI_PXE_BASE_CODE_MODE = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_PXE_BASE_CODE_PACKET, %union.EFI_PXE_BASE_CODE_PACKET, %union.EFI_PXE_BASE_CODE_PACKET, %union.EFI_PXE_BASE_CODE_PACKET, %union.EFI_PXE_BASE_CODE_PACKET, %union.EFI_PXE_BASE_CODE_PACKET, %struct.EFI_PXE_BASE_CODE_IP_FILTER, i32, [8 x %struct.EFI_PXE_BASE_CODE_ARP_ENTRY], i32, [8 x %struct.EFI_PXE_BASE_CODE_ROUTE_ENTRY], %struct.EFI_PXE_BASE_CODE_ICMP_ERROR, %struct.EFI_PXE_BASE_CODE_TFTP_ERROR }
%union.EFI_PXE_BASE_CODE_PACKET = type { %struct.EFI_PXE_BASE_CODE_DHCPV6_PACKET, [444 x i8] }
%struct.EFI_PXE_BASE_CODE_DHCPV6_PACKET = type { i32, [1024 x i8] }
%struct.EFI_PXE_BASE_CODE_IP_FILTER = type { i8, i8, i16, [8 x %union.EFI_IP_ADDRESS] }
%struct.EFI_PXE_BASE_CODE_ARP_ENTRY = type { %union.EFI_IP_ADDRESS, %struct.EFI_MAC_ADDRESS }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct.EFI_PXE_BASE_CODE_ROUTE_ENTRY = type { %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS }
%struct.EFI_PXE_BASE_CODE_ICMP_ERROR = type { i8, i8, i16, %union.anon, [494 x i8] }
%union.anon = type { i32 }
%struct.EFI_PXE_BASE_CODE_TFTP_ERROR = type { i8, [127 x i8] }
%struct.EFI_UDP4_CONFIG_DATA = type { i8, i8, i8, i8, i8, i8, i8, i32, i32, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, %struct.EFI_IPv4_ADDRESS, i16 }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.EFI_UDP6_CONFIG_DATA = type { i8, i8, i8, i8, i8, i32, i32, %struct.EFI_IPv6_ADDRESS, i16, %struct.EFI_IPv6_ADDRESS, i16 }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }
%struct.EFI_IP4_CONFIG_DATA = type { i8, i8, i8, i8, i8, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i8, i8, i8, i8, i32, i32 }
%struct.EFI_IP6_CONFIG_DATA = type { i8, i8, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS, i8, i8, i32, i32, i32 }
%struct.EFI_IP4_COMPLETION_TOKEN = type { ptr, i64, %union.anon.0 }
%union.anon.0 = type { ptr }
%struct.EFI_IP6_COMPLETION_TOKEN = type { ptr, i64, %union.anon.1 }
%union.anon.1 = type { ptr }
%union.EFI_IP_ADDRESS = type { [4 x i32] }
%union.PXEBC_DHCP_PACKET_CACHE = type { %struct.PXEBC_DHCP4_PACKET_CACHE }
%struct.PXEBC_DHCP4_PACKET_CACHE = type { %union.PXEBC_DHCP4_PACKET, i32, [7 x ptr], %struct.PXEBC_VENDOR_OPTION }
%union.PXEBC_DHCP4_PACKET = type { [1472 x i8] }
%struct.PXEBC_VENDOR_OPTION = type { [8 x i32], %struct.EFI_IPv4_ADDRESS, i16, i16, i8, i8, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, i16, i16, i16, ptr, i8, ptr, i8, ptr, i8, ptr, i8 }
%struct.EFI_DHCP4_PACKET = type <{ i32, i32, %struct.anon.2 }>
%struct.anon.2 = type <{ %struct.EFI_DHCP4_HEADER, i32, [1 x i8] }>
%struct.EFI_DHCP4_HEADER = type { i8, i8, i8, i8, i32, i16, i16, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, [16 x i8], [64 x i8], [128 x i8] }
%struct.EFI_PXE_BASE_CODE_DISCOVER_INFO = type { i8, i8, i8, i8, %union.EFI_IP_ADDRESS, i16, [1 x %struct.EFI_PXE_BASE_CODE_SRVLIST] }
%struct.EFI_PXE_BASE_CODE_SRVLIST = type { i16, i8, i8, %union.EFI_IP_ADDRESS }
%struct.PXEBC_BOOT_SVR_ENTRY = type <{ i16, i8, [1 x %struct.EFI_IPv4_ADDRESS] }>

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

declare zeroext i16 @SwapBytes16(i16 noundef zeroext) #1

; Function Attrs: nounwind uwtable
define dso_local i64 @PxeBcExtractDiscoverInfo(ptr noundef %0, i16 noundef zeroext %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #2 {
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i16, align 2
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i8, align 1
  %17 = alloca ptr, align 8
  %18 = alloca i16, align 2
  %19 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i16 %1, ptr %8, align 2, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  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 1, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %18) #3
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %20, i32 0, i32 31
  %22 = getelementptr inbounds %struct._EFI_PXE_BASE_CODE_PROTOCOL, ptr %21, i32 0, i32 13
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  store ptr %23, ptr %12, align 8, !tbaa !5
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  store ptr %25, ptr %17, align 8, !tbaa !5
  %26 = load ptr, ptr %12, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_MODE, ptr %26, i32 0, i32 3
  %28 = load i8, ptr %27, align 1, !tbaa !31
  %29 = icmp ne i8 %28, 0
  br i1 %29, label %30, label %55

30:                                               ; preds = %5
  %31 = load ptr, ptr %17, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %31, i32 0, i32 5
  store i16 1, ptr %32, align 4, !tbaa !32
  %33 = load ptr, ptr %17, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %33, i32 0, i32 2
  store i8 1, ptr %34, align 2, !tbaa !34
  %35 = load i16, ptr %8, align 2, !tbaa !9
  %36 = load ptr, ptr %17, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %36, i32 0, i32 6
  %38 = getelementptr inbounds [1 x %struct.EFI_PXE_BASE_CODE_SRVLIST], ptr %37, i64 0, i64 0
  %39 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_SRVLIST, ptr %38, i32 0, i32 0
  store i16 %35, ptr %39, align 4, !tbaa !35
  %40 = load ptr, ptr %17, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %40, i32 0, i32 6
  %42 = getelementptr inbounds [1 x %struct.EFI_PXE_BASE_CODE_SRVLIST], ptr %41, i64 0, i64 0
  %43 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_SRVLIST, ptr %42, i32 0, i32 1
  store i8 0, ptr %43, align 2, !tbaa !37
  %44 = load ptr, ptr %17, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %44, i32 0, i32 6
  %46 = getelementptr inbounds [1 x %struct.EFI_PXE_BASE_CODE_SRVLIST], ptr %45, i64 0, i64 0
  %47 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_SRVLIST, ptr %46, i32 0, i32 3
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %48, i32 0, i32 55
  %50 = call ptr @CopyMem(ptr noundef %47, ptr noundef %49, i64 noundef 16)
  %51 = load ptr, ptr %17, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %51, i32 0, i32 6
  %53 = getelementptr inbounds [1 x %struct.EFI_PXE_BASE_CODE_SRVLIST], ptr %52, i64 0, i64 0
  %54 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %53, ptr %54, align 8, !tbaa !5
  br label %278

55:                                               ; preds = %5
  store ptr null, ptr %15, align 8, !tbaa !5
  store i8 0, ptr %16, align 1, !tbaa !38
  %56 = load ptr, ptr %12, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_MODE, ptr %56, i32 0, i32 10
  %58 = load i8, ptr %57, align 2, !tbaa !39
  %59 = zext i8 %58 to i32
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %61, label %64

61:                                               ; preds = %55
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %62, i32 0, i32 63
  br label %67

64:                                               ; preds = %55
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %65, i32 0, i32 64
  br label %67

67:                                               ; preds = %64, %61
  %68 = phi ptr [ %63, %61 ], [ %66, %64 ]
  store ptr %68, ptr %13, align 8, !tbaa !5
  %69 = load ptr, ptr %13, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.PXEBC_DHCP4_PACKET_CACHE, ptr %69, i32 0, i32 3
  store ptr %70, ptr %14, align 8, !tbaa !5
  %71 = load ptr, ptr %12, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_MODE, ptr %71, i32 0, i32 9
  %73 = load i8, ptr %72, align 1, !tbaa !40
  %74 = icmp ne i8 %73, 0
  br i1 %74, label %75, label %82

75:                                               ; preds = %67
  %76 = load ptr, ptr %14, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %76, i32 0, i32 0
  %78 = getelementptr inbounds [8 x i32], ptr %77, i64 0, i64 0
  %79 = load i32, ptr %78, align 8, !tbaa !41
  %80 = and i32 %79, 1984
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %83, label %82

82:                                               ; preds = %75, %67
  store i64 -9223372036854775806, ptr %6, align 8
  store i32 1, ptr %19, align 4
  br label %279

83:                                               ; preds = %75
  %84 = load ptr, ptr %14, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %84, i32 0, i32 6
  %86 = load i8, ptr %85, align 2, !tbaa !42
  %87 = zext i8 %86 to i32
  %88 = and i32 %87, 2
  %89 = icmp eq i32 %88, 2
  %90 = xor i1 %89, true
  %91 = zext i1 %90 to i32
  %92 = trunc i32 %91 to i8
  %93 = load ptr, ptr %17, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %93, i32 0, i32 0
  store i8 %92, ptr %94, align 4, !tbaa !44
  %95 = load ptr, ptr %14, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %95, i32 0, i32 6
  %97 = load i8, ptr %96, align 2, !tbaa !42
  %98 = zext i8 %97 to i32
  %99 = and i32 %98, 1
  %100 = icmp eq i32 %99, 1
  %101 = xor i1 %100, true
  %102 = zext i1 %101 to i32
  %103 = trunc i32 %102 to i8
  %104 = load ptr, ptr %17, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %104, i32 0, i32 1
  store i8 %103, ptr %105, align 1, !tbaa !45
  %106 = load ptr, ptr %14, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %106, i32 0, i32 6
  %108 = load i8, ptr %107, align 2, !tbaa !42
  %109 = zext i8 %108 to i32
  %110 = and i32 %109, 4
  %111 = icmp eq i32 %110, 4
  %112 = zext i1 %111 to i32
  %113 = trunc i32 %112 to i8
  %114 = load ptr, ptr %17, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %114, i32 0, i32 3
  store i8 %113, ptr %115, align 1, !tbaa !46
  %116 = load ptr, ptr %14, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %116, i32 0, i32 0
  %118 = getelementptr inbounds [8 x i32], ptr %117, i64 0, i64 0
  %119 = load i32, ptr %118, align 8, !tbaa !41
  %120 = and i32 %119, 256
  %121 = icmp eq i32 %120, 256
  %122 = zext i1 %121 to i32
  %123 = trunc i32 %122 to i8
  %124 = load ptr, ptr %17, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %124, i32 0, i32 2
  store i8 %123, ptr %125, align 2, !tbaa !34
  %126 = load ptr, ptr %17, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %126, i32 0, i32 0
  %128 = load i8, ptr %127, align 4, !tbaa !44
  %129 = icmp ne i8 %128, 0
  br i1 %129, label %130, label %136

130:                                              ; preds = %83
  %131 = load ptr, ptr %17, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %131, i32 0, i32 4
  %133 = load ptr, ptr %14, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %133, i32 0, i32 7
  %135 = call ptr @CopyMem(ptr noundef %132, ptr noundef %134, i64 noundef 4)
  br label %136

136:                                              ; preds = %130, %83
  %137 = load ptr, ptr %17, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %137, i32 0, i32 5
  store i16 0, ptr %138, align 4, !tbaa !32
  %139 = load ptr, ptr %17, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %139, i32 0, i32 2
  %141 = load i8, ptr %140, align 2, !tbaa !34
  %142 = icmp ne i8 %141, 0
  br i1 %142, label %143, label %271

143:                                              ; preds = %136
  %144 = load ptr, ptr %14, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %144, i32 0, i32 13
  %146 = load ptr, ptr %145, align 8, !tbaa !47
  store ptr %146, ptr %15, align 8, !tbaa !5
  br label %147

147:                                              ; preds = %173, %143
  %148 = load ptr, ptr %15, align 8, !tbaa !5
  %149 = load ptr, ptr %14, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %149, i32 0, i32 13
  %151 = load ptr, ptr %150, align 8, !tbaa !47
  %152 = ptrtoint ptr %148 to i64
  %153 = ptrtoint ptr %151 to i64
  %154 = sub i64 %152, %153
  %155 = sdiv exact i64 %154, 7
  %156 = trunc i64 %155 to i8
  %157 = zext i8 %156 to i32
  %158 = load ptr, ptr %14, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %158, i32 0, i32 14
  %160 = load i8, ptr %159, align 8, !tbaa !48
  %161 = zext i8 %160 to i32
  %162 = icmp slt i32 %157, %161
  br i1 %162, label %163, label %184

163:                                              ; preds = %147
  %164 = load ptr, ptr %15, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.PXEBC_BOOT_SVR_ENTRY, ptr %164, i32 0, i32 0
  %166 = load i16, ptr %165, align 1, !tbaa !49
  %167 = zext i16 %166 to i32
  %168 = load i16, ptr %8, align 2, !tbaa !9
  %169 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %168)
  %170 = zext i16 %169 to i32
  %171 = icmp eq i32 %167, %170
  br i1 %171, label %172, label %173

172:                                              ; preds = %163
  store i8 1, ptr %16, align 1, !tbaa !38
  br label %184

173:                                              ; preds = %163
  %174 = load ptr, ptr %15, align 8, !tbaa !5
  %175 = getelementptr inbounds i8, ptr %174, i64 7
  %176 = load ptr, ptr %15, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.PXEBC_BOOT_SVR_ENTRY, ptr %176, i32 0, i32 1
  %178 = load i8, ptr %177, align 1, !tbaa !51
  %179 = zext i8 %178 to i32
  %180 = sub nsw i32 %179, 1
  %181 = sext i32 %180 to i64
  %182 = mul i64 %181, 4
  %183 = getelementptr inbounds i8, ptr %175, i64 %182
  store ptr %183, ptr %15, align 8, !tbaa !5
  br label %147, !llvm.loop !52

184:                                              ; preds = %172, %147
  %185 = load i8, ptr %16, align 1, !tbaa !38
  %186 = icmp ne i8 %185, 0
  br i1 %186, label %188, label %187

187:                                              ; preds = %184
  store i64 -9223372036854775801, ptr %6, align 8
  store i32 1, ptr %19, align 4
  br label %279

188:                                              ; preds = %184
  %189 = load ptr, ptr %15, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.PXEBC_BOOT_SVR_ENTRY, ptr %189, i32 0, i32 1
  %191 = load i8, ptr %190, align 1, !tbaa !51
  %192 = zext i8 %191 to i16
  %193 = load ptr, ptr %17, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %193, i32 0, i32 5
  store i16 %192, ptr %194, align 4, !tbaa !32
  %195 = load ptr, ptr %17, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %195, i32 0, i32 5
  %197 = load i16, ptr %196, align 4, !tbaa !32
  %198 = zext i16 %197 to i32
  %199 = icmp sge i32 %198, 1
  br i1 %199, label %200, label %222

200:                                              ; preds = %188
  %201 = load ptr, ptr %17, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %201, i32 0, i32 5
  %203 = load i16, ptr %202, align 4, !tbaa !32
  %204 = zext i16 %203 to i32
  %205 = sub nsw i32 %204, 1
  %206 = sext i32 %205 to i64
  %207 = mul i64 %206, 20
  %208 = add i64 44, %207
  %209 = call ptr @AllocatePool(i64 noundef %208)
  %210 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %209, ptr %210, align 8, !tbaa !5
  %211 = load ptr, ptr %9, align 8, !tbaa !5
  %212 = load ptr, ptr %211, align 8, !tbaa !5
  %213 = icmp eq ptr %212, null
  br i1 %213, label %214, label %215

214:                                              ; preds = %200
  store i64 -9223372036854775799, ptr %6, align 8
  store i32 1, ptr %19, align 4
  br label %279

215:                                              ; preds = %200
  %216 = load ptr, ptr %9, align 8, !tbaa !5
  %217 = load ptr, ptr %216, align 8, !tbaa !5
  %218 = load ptr, ptr %17, align 8, !tbaa !5
  %219 = call ptr @CopyMem(ptr noundef %217, ptr noundef %218, i64 noundef 44)
  %220 = load ptr, ptr %9, align 8, !tbaa !5
  %221 = load ptr, ptr %220, align 8, !tbaa !5
  store ptr %221, ptr %17, align 8, !tbaa !5
  br label %222

222:                                              ; preds = %215, %188
  store i16 0, ptr %18, align 2, !tbaa !9
  br label %223

223:                                              ; preds = %267, %222
  %224 = load i16, ptr %18, align 2, !tbaa !9
  %225 = zext i16 %224 to i32
  %226 = load ptr, ptr %17, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %226, i32 0, i32 5
  %228 = load i16, ptr %227, align 4, !tbaa !32
  %229 = zext i16 %228 to i32
  %230 = icmp slt i32 %225, %229
  br i1 %230, label %231, label %270

231:                                              ; preds = %223
  %232 = load ptr, ptr %17, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %232, i32 0, i32 6
  %234 = load i16, ptr %18, align 2, !tbaa !9
  %235 = zext i16 %234 to i64
  %236 = getelementptr inbounds [1 x %struct.EFI_PXE_BASE_CODE_SRVLIST], ptr %233, i64 0, i64 %235
  %237 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_SRVLIST, ptr %236, i32 0, i32 3
  %238 = load ptr, ptr %15, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.PXEBC_BOOT_SVR_ENTRY, ptr %238, i32 0, i32 2
  %240 = load i16, ptr %18, align 2, !tbaa !9
  %241 = zext i16 %240 to i64
  %242 = getelementptr inbounds [1 x %struct.EFI_IPv4_ADDRESS], ptr %239, i64 0, i64 %241
  %243 = call ptr @CopyMem(ptr noundef %237, ptr noundef %242, i64 noundef 4)
  %244 = load ptr, ptr %17, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %244, i32 0, i32 3
  %246 = load i8, ptr %245, align 1, !tbaa !46
  %247 = icmp ne i8 %246, 0
  %248 = xor i1 %247, true
  %249 = zext i1 %248 to i32
  %250 = trunc i32 %249 to i8
  %251 = load ptr, ptr %17, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %251, i32 0, i32 6
  %253 = load i16, ptr %18, align 2, !tbaa !9
  %254 = zext i16 %253 to i64
  %255 = getelementptr inbounds [1 x %struct.EFI_PXE_BASE_CODE_SRVLIST], ptr %252, i64 0, i64 %254
  %256 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_SRVLIST, ptr %255, i32 0, i32 1
  store i8 %250, ptr %256, align 2, !tbaa !37
  %257 = load ptr, ptr %15, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.PXEBC_BOOT_SVR_ENTRY, ptr %257, i32 0, i32 0
  %259 = load i16, ptr %258, align 1, !tbaa !49
  %260 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %259)
  %261 = load ptr, ptr %17, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %261, i32 0, i32 6
  %263 = load i16, ptr %18, align 2, !tbaa !9
  %264 = zext i16 %263 to i64
  %265 = getelementptr inbounds [1 x %struct.EFI_PXE_BASE_CODE_SRVLIST], ptr %262, i64 0, i64 %264
  %266 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_SRVLIST, ptr %265, i32 0, i32 0
  store i16 %260, ptr %266, align 4, !tbaa !35
  br label %267

267:                                              ; preds = %231
  %268 = load i16, ptr %18, align 2, !tbaa !9
  %269 = add i16 %268, 1
  store i16 %269, ptr %18, align 2, !tbaa !9
  br label %223, !llvm.loop !54

270:                                              ; preds = %223
  br label %271

271:                                              ; preds = %270, %136
  %272 = load ptr, ptr %15, align 8, !tbaa !5
  %273 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %272, ptr %273, align 8, !tbaa !5
  %274 = load ptr, ptr %17, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DISCOVER_INFO, ptr %274, i32 0, i32 6
  %276 = getelementptr inbounds [1 x %struct.EFI_PXE_BASE_CODE_SRVLIST], ptr %275, i64 0, i64 0
  %277 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %276, ptr %277, align 8, !tbaa !5
  br label %278

278:                                              ; preds = %271, %30
  store i64 0, ptr %6, align 8
  store i32 1, ptr %19, align 4
  br label %279

279:                                              ; preds = %278, %214, %187, %82
  call void @llvm.lifetime.end.p0(i64 2, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 1, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  %280 = load i64, ptr %6, align 8
  ret i64 %280
}

declare ptr @AllocatePool(i64 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 = !{!"short", !7, i64 0}
!11 = !{!12, !6, i64 352}
!12 = !{!"_PXEBC_PRIVATE_DATA", !13, i64 0, !6, i64 8, !6, i64 16, !14, 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, !16, i64 248, !17, i64 360, !6, i64 376, !6, i64 384, !18, i64 392, !13, i64 10816, !13, i64 10820, !13, i64 10824, !15, i64 10832, !22, i64 10840, !24, i64 10876, !25, i64 10928, !26, i64 10956, !6, i64 11008, !6, i64 11016, !27, i64 11024, !27, i64 11048, !7, i64 11072, !7, i64 11073, !7, i64 11074, !7, i64 11075, !7, i64 11076, !7, i64 11092, !7, i64 11108, !7, i64 11124, !10, i64 11140, !13, i64 11144, !13, i64 11148, !13, i64 11152, !6, i64 11160, !15, i64 11168, !15, i64 11176, !7, i64 11184, !7, i64 12848, !7, i64 14512, !6, i64 16176, !28, i64 16184, !13, i64 16436, !13, i64 16440, !7, i64 16448, !13, i64 43072, !7, i64 43076, !7, i64 43108}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_PXEBC_PRIVATE_PROTOCOL", !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"_EFI_PXE_BASE_CODE_PROTOCOL", !15, i64 0, !6, i64 8, !6, i64 16, !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}
!17 = !{!"_EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL", !15, i64 0, !6, i64 8}
!18 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 20, !7, i64 36, !7, i64 52, !7, i64 1524, !7, i64 2996, !7, i64 4468, !7, i64 5940, !7, i64 7412, !19, i64 8884, !13, i64 9016, !7, i64 9020, !13, i64 9404, !7, i64 9408, !20, i64 9792, !21, i64 10296}
!19 = !{!"", !7, i64 0, !7, i64 1, !10, i64 2, !7, i64 4}
!20 = !{!"", !7, i64 0, !7, i64 1, !10, i64 2, !7, i64 4, !7, i64 8}
!21 = !{!"", !7, i64 0, !7, i64 1}
!22 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !13, i64 8, !13, i64 12, !7, i64 16, !23, i64 17, !23, i64 21, !10, i64 26, !23, i64 28, !10, i64 32}
!23 = !{!"", !7, i64 0}
!24 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !13, i64 8, !13, i64 12, !23, i64 16, !10, i64 32, !23, i64 34, !10, i64 50}
!25 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !23, i64 6, !23, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !13, i64 20, !13, i64 24}
!26 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !23, i64 4, !23, i64 20, !7, i64 36, !7, i64 37, !13, i64 40, !13, i64 44, !13, i64 48}
!27 = !{!"", !6, i64 0, !15, i64 8, !7, i64 16}
!28 = !{!"", !13, i64 0, !13, i64 4, !29, i64 8}
!29 = !{!"", !30, i64 0, !13, i64 236, !7, i64 240}
!30 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !13, i64 4, !10, i64 8, !10, i64 10, !23, i64 12, !23, i64 16, !23, i64 20, !23, i64 24, !7, i64 28, !7, i64 44, !7, i64 108}
!31 = !{!18, !7, i64 3}
!32 = !{!33, !10, i64 20}
!33 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !10, i64 20, !7, i64 24}
!34 = !{!33, !7, i64 2}
!35 = !{!36, !10, i64 0}
!36 = !{!"", !10, i64 0, !7, i64 2, !7, i64 3, !7, i64 4}
!37 = !{!36, !7, i64 2}
!38 = !{!7, !7, i64 0}
!39 = !{!18, !7, i64 10}
!40 = !{!18, !7, i64 9}
!41 = !{!13, !13, i64 0}
!42 = !{!43, !7, i64 42}
!43 = !{!"", !7, i64 0, !23, i64 32, !10, i64 36, !10, i64 38, !7, i64 40, !7, i64 41, !7, i64 42, !23, i64 43, !23, i64 47, !10, i64 52, !10, i64 54, !10, i64 56, !10, i64 58, !6, i64 64, !7, i64 72, !6, i64 80, !7, i64 88, !6, i64 96, !7, i64 104, !6, i64 112, !7, i64 120}
!44 = !{!33, !7, i64 0}
!45 = !{!33, !7, i64 1}
!46 = !{!33, !7, i64 3}
!47 = !{!43, !6, i64 64}
!48 = !{!43, !7, i64 72}
!49 = !{!50, !10, i64 0}
!50 = !{!"", !10, i64 0, !7, i64 2, !7, i64 3}
!51 = !{!50, !7, i64 2}
!52 = distinct !{!52, !53}
!53 = !{!"llvm.loop.mustprogress"}
!54 = distinct !{!54, !53}


; 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.EFI_PXE_BASE_CODE_SRVLIST = type { i16, i8, i8, %union.EFI_IP_ADDRESS }
%union.EFI_IP_ADDRESS = type { [4 x i32] }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }

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

declare zeroext i16 @SwapBytes16(i16 noundef zeroext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775806, 1) i64 @PxeBcExtractDiscoverInfo(ptr noundef %0, i16 noundef zeroext %1, ptr nocapture noundef %2, ptr nocapture noundef writeonly %3, ptr nocapture noundef writeonly %4) local_unnamed_addr #1 {
  %6 = getelementptr inbounds i8, ptr %0, i64 352
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = load ptr, ptr %2, align 8, !tbaa !29
  %9 = getelementptr inbounds i8, ptr %7, i64 3
  %10 = load i8, ptr %9, align 1, !tbaa !30
  %.not = icmp eq i8 %10, 0
  br i1 %.not, label %19, label %11

11:                                               ; preds = %5
  %12 = getelementptr inbounds i8, ptr %8, i64 20
  store i16 1, ptr %12, align 4, !tbaa !31
  %13 = getelementptr inbounds i8, ptr %8, i64 2
  store i8 1, ptr %13, align 2, !tbaa !33
  %14 = getelementptr inbounds i8, ptr %8, i64 24
  store i16 %1, ptr %14, align 4, !tbaa !34
  %15 = getelementptr inbounds i8, ptr %8, i64 26
  store i8 0, ptr %15, align 2, !tbaa !36
  %16 = getelementptr inbounds i8, ptr %8, i64 28
  %17 = getelementptr inbounds i8, ptr %0, i64 11124
  %18 = tail call ptr @CopyMem(ptr noundef nonnull %16, ptr noundef nonnull %17, i64 noundef 16) #2
  br label %105

19:                                               ; preds = %5
  %20 = getelementptr inbounds i8, ptr %7, i64 10
  %21 = load i8, ptr %20, align 2, !tbaa !37
  %.not73 = icmp eq i8 %21, 0
  %.v = select i1 %.not73, i64 12848, i64 11184
  %22 = getelementptr inbounds i8, ptr %0, i64 %.v
  %23 = getelementptr inbounds i8, ptr %7, i64 9
  %24 = load i8, ptr %23, align 1, !tbaa !38
  %.not74 = icmp eq i8 %24, 0
  br i1 %.not74, label %.critedge, label %25

25:                                               ; preds = %19
  %26 = getelementptr inbounds i8, ptr %22, i64 1536
  %27 = load i32, ptr %26, align 8, !tbaa !39
  %28 = and i32 %27, 1984
  %.not75 = icmp eq i32 %28, 0
  br i1 %.not75, label %.critedge, label %29

29:                                               ; preds = %25
  %30 = getelementptr inbounds i8, ptr %22, i64 1578
  %31 = load i8, ptr %30, align 2, !tbaa !40
  %32 = lshr i8 %31, 1
  %.lobit = and i8 %32, 1
  %33 = xor i8 %.lobit, 1
  store i8 %33, ptr %8, align 4, !tbaa !42
  %34 = and i8 %31, 1
  %35 = xor i8 %34, 1
  %36 = getelementptr inbounds i8, ptr %8, i64 1
  store i8 %35, ptr %36, align 1, !tbaa !43
  %37 = lshr i8 %31, 2
  %.lobit78 = and i8 %37, 1
  %38 = getelementptr inbounds i8, ptr %8, i64 3
  store i8 %.lobit78, ptr %38, align 1, !tbaa !44
  %39 = lshr i32 %27, 8
  %40 = trunc i32 %39 to i8
  %41 = and i8 %40, 1
  %42 = getelementptr inbounds i8, ptr %8, i64 2
  store i8 %41, ptr %42, align 2, !tbaa !33
  %.not80.not = icmp eq i8 %.lobit, 0
  br i1 %.not80.not, label %43, label %47

43:                                               ; preds = %29
  %44 = getelementptr inbounds i8, ptr %8, i64 4
  %45 = getelementptr inbounds i8, ptr %22, i64 1579
  %46 = tail call ptr @CopyMem(ptr noundef nonnull %44, ptr noundef nonnull %45, i64 noundef 4) #2
  %.pr = load i8, ptr %42, align 2, !tbaa !33
  br label %47

47:                                               ; preds = %43, %29
  %48 = phi i8 [ %.pr, %43 ], [ %41, %29 ]
  %49 = getelementptr inbounds i8, ptr %8, i64 20
  store i16 0, ptr %49, align 4, !tbaa !31
  %.not81 = icmp eq i8 %48, 0
  br i1 %.not81, label %.loopexit, label %50

50:                                               ; preds = %47
  %51 = getelementptr inbounds i8, ptr %22, i64 1600
  %52 = getelementptr inbounds i8, ptr %22, i64 1608
  %53 = load i8, ptr %52, align 8, !tbaa !45
  %.not8387.not = icmp eq i8 %53, 0
  br i1 %.not8387.not, label %.critedge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %50
  %54 = load ptr, ptr %51, align 8, !tbaa !46
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %60
  %.06888 = phi ptr [ %64, %60 ], [ %54, %.lr.ph.preheader ]
  %55 = load i16, ptr %.06888, align 1, !tbaa !47
  %56 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %1) #2
  %57 = icmp eq i16 %55, %56
  %58 = getelementptr inbounds i8, ptr %.06888, i64 2
  %59 = load i8, ptr %58, align 1, !tbaa !49
  br i1 %57, label %74, label %60

60:                                               ; preds = %.lr.ph
  %61 = zext i8 %59 to i64
  %62 = shl nuw nsw i64 %61, 2
  %63 = getelementptr i8, ptr %.06888, i64 3
  %64 = getelementptr i8, ptr %63, i64 %62
  %65 = load ptr, ptr %51, align 8, !tbaa !46
  %66 = ptrtoint ptr %64 to i64
  %67 = ptrtoint ptr %65 to i64
  %68 = sub i64 %66, %67
  %69 = sdiv exact i64 %68, 7
  %70 = trunc i64 %69 to i32
  %71 = and i32 %70, 255
  %72 = load i8, ptr %52, align 8, !tbaa !45
  %73 = zext i8 %72 to i32
  %.not83 = icmp ult i32 %71, %73
  br i1 %.not83, label %.lr.ph, label %.critedge, !llvm.loop !50

74:                                               ; preds = %.lr.ph
  %75 = zext i8 %59 to i16
  store i16 %75, ptr %49, align 4, !tbaa !31
  %.not84 = icmp eq i8 %59, 0
  br i1 %.not84, label %.loopexit, label %76

76:                                               ; preds = %74
  %77 = zext i8 %59 to i64
  %78 = add nuw nsw i64 %77, 4294967295
  %79 = and i64 %78, 4294967295
  %80 = mul nuw nsw i64 %79, 20
  %81 = add nuw nsw i64 %80, 44
  %82 = tail call ptr @AllocatePool(i64 noundef %81) #2
  store ptr %82, ptr %2, align 8, !tbaa !29
  %83 = icmp eq ptr %82, null
  br i1 %83, label %.critedge, label %84

84:                                               ; preds = %76
  %85 = tail call ptr @CopyMem(ptr noundef nonnull %82, ptr noundef nonnull %8, i64 noundef 44) #2
  %86 = load ptr, ptr %2, align 8, !tbaa !29
  %.phi.trans.insert = getelementptr inbounds i8, ptr %86, i64 20
  %.pre = load i16, ptr %.phi.trans.insert, align 4, !tbaa !31
  %87 = getelementptr inbounds i8, ptr %86, i64 20
  %.not91 = icmp eq i16 %.pre, 0
  br i1 %.not91, label %.loopexit, label %.lr.ph90

.lr.ph90:                                         ; preds = %84
  %88 = getelementptr inbounds i8, ptr %86, i64 24
  %89 = getelementptr inbounds i8, ptr %.06888, i64 3
  %90 = getelementptr inbounds i8, ptr %86, i64 3
  br label %91

91:                                               ; preds = %.lr.ph90, %91
  %indvars.iv = phi i64 [ 0, %.lr.ph90 ], [ %indvars.iv.next, %91 ]
  %92 = getelementptr inbounds [1 x %struct.EFI_PXE_BASE_CODE_SRVLIST], ptr %88, i64 0, i64 %indvars.iv
  %93 = getelementptr inbounds i8, ptr %92, i64 4
  %94 = getelementptr inbounds [1 x %struct.EFI_IPv4_ADDRESS], ptr %89, i64 0, i64 %indvars.iv
  %95 = tail call ptr @CopyMem(ptr noundef nonnull %93, ptr noundef nonnull %94, i64 noundef 4) #2
  %96 = load i8, ptr %90, align 1, !tbaa !44
  %.not85 = icmp eq i8 %96, 0
  %97 = zext i1 %.not85 to i8
  %98 = getelementptr inbounds i8, ptr %92, i64 2
  store i8 %97, ptr %98, align 2, !tbaa !36
  %99 = load i16, ptr %.06888, align 1, !tbaa !47
  %100 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %99) #2
  store i16 %100, ptr %92, align 4, !tbaa !34
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %101 = load i16, ptr %87, align 4, !tbaa !31
  %102 = zext i16 %101 to i64
  %103 = icmp ult i64 %indvars.iv.next, %102
  br i1 %103, label %91, label %.loopexit, !llvm.loop !52

.loopexit:                                        ; preds = %91, %74, %84, %47
  %.169 = phi ptr [ null, %47 ], [ %.06888, %84 ], [ %.06888, %74 ], [ %.06888, %91 ]
  %.1 = phi ptr [ %8, %47 ], [ %86, %84 ], [ %8, %74 ], [ %86, %91 ]
  store ptr %.169, ptr %3, align 8, !tbaa !29
  %104 = getelementptr inbounds i8, ptr %.1, i64 24
  br label %105

105:                                              ; preds = %.loopexit, %11
  %storemerge = phi ptr [ %104, %.loopexit ], [ %14, %11 ]
  store ptr %storemerge, ptr %4, align 8, !tbaa !29
  br label %.critedge

.critedge:                                        ; preds = %60, %50, %76, %19, %25, %105
  %.070 = phi i64 [ 0, %105 ], [ -9223372036854775806, %25 ], [ -9223372036854775806, %19 ], [ -9223372036854775799, %76 ], [ -9223372036854775801, %50 ], [ -9223372036854775801, %60 ]
  ret i64 %.070
}

declare ptr @AllocatePool(i64 noundef) local_unnamed_addr #0

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 = { 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 352}
!6 = !{!"_PXEBC_PRIVATE_DATA", !7, i64 0, !10, i64 8, !10, i64 16, !11, 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, !13, i64 248, !14, i64 360, !10, i64 376, !10, i64 384, !15, i64 392, !7, i64 10816, !7, i64 10820, !7, i64 10824, !12, i64 10832, !20, i64 10840, !22, i64 10876, !23, i64 10928, !24, i64 10956, !10, i64 11008, !10, i64 11016, !25, i64 11024, !25, i64 11048, !8, i64 11072, !8, i64 11073, !8, i64 11074, !8, i64 11075, !8, i64 11076, !8, i64 11092, !8, i64 11108, !8, i64 11124, !17, i64 11140, !7, i64 11144, !7, i64 11148, !7, i64 11152, !10, i64 11160, !12, i64 11168, !12, i64 11176, !8, i64 11184, !8, i64 12848, !8, i64 14512, !10, i64 16176, !26, i64 16184, !7, i64 16436, !7, i64 16440, !8, i64 16448, !7, i64 43072, !8, i64 43076, !8, i64 43108}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_PXEBC_PRIVATE_PROTOCOL", !12, i64 0}
!12 = !{!"long long", !8, i64 0}
!13 = !{!"_EFI_PXE_BASE_CODE_PROTOCOL", !12, i64 0, !10, i64 8, !10, i64 16, !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}
!14 = !{!"_EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL", !12, i64 0, !10, i64 8}
!15 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7, !8, i64 8, !8, i64 9, !8, i64 10, !8, i64 11, !8, i64 12, !8, i64 13, !8, i64 14, !8, i64 15, !8, i64 16, !8, i64 17, !8, i64 18, !8, i64 20, !8, i64 36, !8, i64 52, !8, i64 1524, !8, i64 2996, !8, i64 4468, !8, i64 5940, !8, i64 7412, !16, i64 8884, !7, i64 9016, !8, i64 9020, !7, i64 9404, !8, i64 9408, !18, i64 9792, !19, i64 10296}
!16 = !{!"", !8, i64 0, !8, i64 1, !17, i64 2, !8, i64 4}
!17 = !{!"short", !8, i64 0}
!18 = !{!"", !8, i64 0, !8, i64 1, !17, i64 2, !8, i64 4, !8, i64 8}
!19 = !{!"", !8, i64 0, !8, i64 1}
!20 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 6, !7, i64 8, !7, i64 12, !8, i64 16, !21, i64 17, !21, i64 21, !17, i64 26, !21, i64 28, !17, i64 32}
!21 = !{!"", !8, i64 0}
!22 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !7, i64 8, !7, i64 12, !21, i64 16, !17, i64 32, !21, i64 34, !17, i64 50}
!23 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !21, i64 6, !21, i64 10, !8, i64 14, !8, i64 15, !8, i64 16, !8, i64 17, !7, i64 20, !7, i64 24}
!24 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !21, i64 4, !21, i64 20, !8, i64 36, !8, i64 37, !7, i64 40, !7, i64 44, !7, i64 48}
!25 = !{!"", !10, i64 0, !12, i64 8, !8, i64 16}
!26 = !{!"", !7, i64 0, !7, i64 4, !27, i64 8}
!27 = !{!"", !28, i64 0, !7, i64 236, !8, i64 240}
!28 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !7, i64 4, !17, i64 8, !17, i64 10, !21, i64 12, !21, i64 16, !21, i64 20, !21, i64 24, !8, i64 28, !8, i64 44, !8, i64 108}
!29 = !{!10, !10, i64 0}
!30 = !{!15, !8, i64 3}
!31 = !{!32, !17, i64 20}
!32 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !17, i64 20, !8, i64 24}
!33 = !{!32, !8, i64 2}
!34 = !{!35, !17, i64 0}
!35 = !{!"", !17, i64 0, !8, i64 2, !8, i64 3, !8, i64 4}
!36 = !{!35, !8, i64 2}
!37 = !{!15, !8, i64 10}
!38 = !{!15, !8, i64 9}
!39 = !{!7, !7, i64 0}
!40 = !{!41, !8, i64 42}
!41 = !{!"", !8, i64 0, !21, i64 32, !17, i64 36, !17, i64 38, !8, i64 40, !8, i64 41, !8, i64 42, !21, i64 43, !21, i64 47, !17, i64 52, !17, i64 54, !17, i64 56, !17, i64 58, !10, i64 64, !8, i64 72, !10, i64 80, !8, i64 88, !10, i64 96, !8, i64 104, !10, i64 112, !8, i64 120}
!42 = !{!32, !8, i64 0}
!43 = !{!32, !8, i64 1}
!44 = !{!32, !8, i64 3}
!45 = !{!41, !8, i64 72}
!46 = !{!41, !10, i64 64}
!47 = !{!48, !17, i64 0}
!48 = !{!"", !17, i64 0, !8, i64 2, !8, i64 3}
!49 = !{!48, !8, i64 2}
!50 = distinct !{!50, !51}
!51 = !{!"llvm.loop.mustprogress"}
!52 = distinct !{!52, !51}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass