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

; 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.PXEBC_DHCP6_PACKET_CACHE = type { %union.PXEBC_DHCP6_PACKET, i32, [4 x ptr] }
%union.PXEBC_DHCP6_PACKET = type { [1472 x i8] }
%struct.EFI_DHCP6_PACKET = type <{ i32, i32, %struct.anon.3 }>
%struct.anon.3 = type <{ %struct.EFI_DHCP6_HEADER, [1 x i8] }>
%struct.EFI_DHCP6_HEADER = type { i32 }
%struct.EFI_DHCP6_PACKET_OPTION = type <{ i16, i16, [1 x i8] }>
%struct._EFI_UDP6_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @PxeBcDhcp6SeekOption(ptr noundef, i32 noundef, i16 noundef zeroext) #2

; Function Attrs: nounwind uwtable
define dso_local i64 @PxeBcRequestBootService(ptr noundef %0, i32 noundef %1) #2 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i16, align 2
  %7 = alloca i16, align 2
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca i16, align 2
  %19 = alloca i16, align 2
  %20 = alloca i16, align 2
  %21 = alloca i64, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 2, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  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 8, 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
  call void @llvm.lifetime.start.p0(i64 2, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %25, i32 0, i32 31
  store ptr %26, ptr %9, align 8, !tbaa !5
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._EFI_PXE_BASE_CODE_PROTOCOL, ptr %27, i32 0, i32 13
  %29 = load ptr, ptr %28, align 8, !tbaa !11
  store ptr %29, ptr %8, align 8, !tbaa !5
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %30, i32 0, i32 66
  %32 = load ptr, ptr %31, align 8, !tbaa !14
  store ptr %32, ptr %12, align 8, !tbaa !5
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %33, i32 0, i32 70
  %35 = load i32, ptr %5, align 4, !tbaa !9
  %36 = zext i32 %35 to i64
  %37 = getelementptr inbounds [16 x %union.PXEBC_DHCP_PACKET_CACHE], ptr %34, i64 0, i64 %36
  %38 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %37, i32 0, i32 0
  store ptr %38, ptr %22, align 8, !tbaa !5
  store i16 4011, ptr %6, align 2, !tbaa !32
  store i16 4011, ptr %7, align 2, !tbaa !32
  store i16 0, ptr %18, align 2, !tbaa !32
  %39 = load ptr, ptr %12, align 8, !tbaa !5
  %40 = icmp eq ptr %39, null
  br i1 %40, label %41, label %42

41:                                               ; preds = %2
  store i64 -9223372036854775801, ptr %3, align 8
  store i32 1, ptr %24, align 4
  br label %262

42:                                               ; preds = %2
  %43 = call ptr @AllocateZeroPool(i64 noundef 1028)
  store ptr %43, ptr %10, align 8, !tbaa !5
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = icmp eq ptr %44, null
  br i1 %45, label %46, label %47

46:                                               ; preds = %42
  store i64 -9223372036854775799, ptr %3, align 8
  store i32 1, ptr %24, align 4
  br label %262

47:                                               ; preds = %42
  %48 = load ptr, ptr %22, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %48, i32 0, i32 2
  %50 = getelementptr inbounds %struct.anon.3, ptr %49, i32 0, i32 0
  %51 = load i32, ptr %50, align 1
  %52 = lshr i32 %51, 8
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = load i32, ptr %53, align 4
  %55 = and i32 %52, 16777215
  %56 = shl i32 %55, 8
  %57 = and i32 %54, 255
  %58 = or i32 %57, %56
  store i32 %58, ptr %53, align 4
  %59 = load ptr, ptr %12, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %59, i32 0, i32 2
  %61 = getelementptr inbounds %struct.anon.3, ptr %60, i32 0, i32 0
  %62 = load i32, ptr %61, align 1
  %63 = and i32 %62, 255
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  %65 = load i32, ptr %64, align 4
  %66 = and i32 %63, 255
  %67 = and i32 %65, -256
  %68 = or i32 %67, %66
  store i32 %68, ptr %64, align 4
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %69, i32 0, i32 2
  %71 = getelementptr inbounds %struct.anon.3, ptr %70, i32 0, i32 1
  %72 = getelementptr inbounds [1 x i8], ptr %71, i64 0, i64 0
  store ptr %72, ptr %15, align 8, !tbaa !5
  %73 = load ptr, ptr %10, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DHCPV6_PACKET, ptr %73, i32 0, i32 1
  %75 = getelementptr inbounds [1024 x i8], ptr %74, i64 0, i64 0
  store ptr %75, ptr %16, align 8, !tbaa !5
  store i64 4, ptr %11, align 8, !tbaa !33
  %76 = load i64, ptr %11, align 8, !tbaa !33
  store i64 %76, ptr %13, align 8, !tbaa !33
  %77 = load ptr, ptr %22, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %77, i32 0, i32 2
  %79 = getelementptr inbounds %struct.anon.3, ptr %78, i32 0, i32 1
  %80 = getelementptr inbounds [1 x i8], ptr %79, i64 0, i64 0
  %81 = load ptr, ptr %22, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %81, i32 0, i32 1
  %83 = load i32, ptr %82, align 1, !tbaa !34
  %84 = sub i32 %83, 4
  %85 = call ptr @PxeBcDhcp6SeekOption(ptr noundef %80, i32 noundef %84, i16 noundef zeroext 2)
  store ptr %85, ptr %23, align 8, !tbaa !5
  %86 = load ptr, ptr %23, align 8, !tbaa !5
  %87 = icmp eq ptr %86, null
  br i1 %87, label %88, label %89

88:                                               ; preds = %47
  store i64 -9223372036854775794, ptr %3, align 8
  store i32 1, ptr %24, align 4
  br label %262

89:                                               ; preds = %47
  %90 = load ptr, ptr %23, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %90, i32 0, i32 1
  %92 = load i16, ptr %91, align 1, !tbaa !38
  %93 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %92)
  store i16 %93, ptr %20, align 2, !tbaa !32
  %94 = load ptr, ptr %16, align 8, !tbaa !5
  %95 = load ptr, ptr %23, align 8, !tbaa !5
  %96 = load i16, ptr %20, align 2, !tbaa !32
  %97 = zext i16 %96 to i32
  %98 = add nsw i32 %97, 4
  %99 = sext i32 %98 to i64
  %100 = call ptr @CopyMem(ptr noundef %94, ptr noundef %95, i64 noundef %99)
  %101 = load i16, ptr %20, align 2, !tbaa !32
  %102 = zext i16 %101 to i32
  %103 = add nsw i32 %102, 4
  %104 = load ptr, ptr %16, align 8, !tbaa !5
  %105 = sext i32 %103 to i64
  %106 = getelementptr inbounds i8, ptr %104, i64 %105
  store ptr %106, ptr %16, align 8, !tbaa !5
  %107 = load i16, ptr %20, align 2, !tbaa !32
  %108 = zext i16 %107 to i32
  %109 = add nsw i32 %108, 4
  %110 = sext i32 %109 to i64
  %111 = load i64, ptr %11, align 8, !tbaa !33
  %112 = add i64 %111, %110
  store i64 %112, ptr %11, align 8, !tbaa !33
  br label %113

113:                                              ; preds = %160, %89
  %114 = load i64, ptr %13, align 8, !tbaa !33
  %115 = load ptr, ptr %12, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %115, i32 0, i32 1
  %117 = load i32, ptr %116, align 1, !tbaa !34
  %118 = zext i32 %117 to i64
  %119 = icmp ult i64 %114, %118
  br i1 %119, label %120, label %173

120:                                              ; preds = %113
  %121 = load ptr, ptr %15, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %121, i32 0, i32 0
  %123 = load i16, ptr %122, align 1, !tbaa !40
  %124 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %123)
  store i16 %124, ptr %19, align 2, !tbaa !32
  %125 = load ptr, ptr %15, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %125, i32 0, i32 1
  %127 = load i16, ptr %126, align 1, !tbaa !38
  %128 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %127)
  store i16 %128, ptr %20, align 2, !tbaa !32
  %129 = load i16, ptr %19, align 2, !tbaa !32
  %130 = zext i16 %129 to i32
  %131 = icmp ne i32 %130, 3
  br i1 %131, label %132, label %160

132:                                              ; preds = %120
  %133 = load i16, ptr %19, align 2, !tbaa !32
  %134 = zext i16 %133 to i32
  %135 = icmp ne i32 %134, 4
  br i1 %135, label %136, label %160

136:                                              ; preds = %132
  %137 = load i16, ptr %19, align 2, !tbaa !32
  %138 = zext i16 %137 to i32
  %139 = icmp ne i32 %138, 2
  br i1 %139, label %140, label %160

140:                                              ; preds = %136
  %141 = load ptr, ptr %16, align 8, !tbaa !5
  %142 = load ptr, ptr %15, align 8, !tbaa !5
  %143 = load i16, ptr %20, align 2, !tbaa !32
  %144 = zext i16 %143 to i32
  %145 = add nsw i32 %144, 4
  %146 = sext i32 %145 to i64
  %147 = call ptr @CopyMem(ptr noundef %141, ptr noundef %142, i64 noundef %146)
  %148 = load i16, ptr %20, align 2, !tbaa !32
  %149 = zext i16 %148 to i32
  %150 = add nsw i32 %149, 4
  %151 = load ptr, ptr %16, align 8, !tbaa !5
  %152 = sext i32 %150 to i64
  %153 = getelementptr inbounds i8, ptr %151, i64 %152
  store ptr %153, ptr %16, align 8, !tbaa !5
  %154 = load i16, ptr %20, align 2, !tbaa !32
  %155 = zext i16 %154 to i32
  %156 = add nsw i32 %155, 4
  %157 = sext i32 %156 to i64
  %158 = load i64, ptr %11, align 8, !tbaa !33
  %159 = add i64 %158, %157
  store i64 %159, ptr %11, align 8, !tbaa !33
  br label %160

160:                                              ; preds = %140, %136, %132, %120
  %161 = load i16, ptr %20, align 2, !tbaa !32
  %162 = zext i16 %161 to i32
  %163 = add nsw i32 %162, 4
  %164 = load ptr, ptr %15, align 8, !tbaa !5
  %165 = sext i32 %163 to i64
  %166 = getelementptr inbounds i8, ptr %164, i64 %165
  store ptr %166, ptr %15, align 8, !tbaa !5
  %167 = load i16, ptr %20, align 2, !tbaa !32
  %168 = zext i16 %167 to i32
  %169 = add nsw i32 %168, 4
  %170 = sext i32 %169 to i64
  %171 = load i64, ptr %13, align 8, !tbaa !33
  %172 = add i64 %171, %170
  store i64 %172, ptr %13, align 8, !tbaa !33
  br label %113, !llvm.loop !41

173:                                              ; preds = %113
  %174 = load ptr, ptr %10, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_DHCPV6_PACKET, ptr %174, i32 0, i32 1
  %176 = getelementptr inbounds [1024 x i8], ptr %175, i64 0, i64 0
  %177 = load i64, ptr %13, align 8, !tbaa !33
  %178 = sub i64 %177, 4
  %179 = trunc i64 %178 to i32
  %180 = call ptr @PxeBcDhcp6SeekOption(ptr noundef %176, i32 noundef %179, i16 noundef zeroext 8)
  store ptr %180, ptr %23, align 8, !tbaa !5
  %181 = load ptr, ptr %23, align 8, !tbaa !5
  %182 = icmp ne ptr %181, null
  br i1 %182, label %183, label %193

183:                                              ; preds = %173
  %184 = load ptr, ptr %4, align 8, !tbaa !5
  call void @CalcElapsedTime(ptr noundef %184)
  %185 = load ptr, ptr %23, align 8, !tbaa !5
  %186 = getelementptr inbounds i8, ptr %185, i64 4
  %187 = load ptr, ptr %4, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %187, i32 0, i32 39
  %189 = load i64, ptr %188, align 8, !tbaa !43
  %190 = trunc i64 %189 to i16
  %191 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %190)
  %192 = call zeroext i16 @WriteUnaligned16(ptr noundef %186, i16 noundef zeroext %191)
  br label %193

193:                                              ; preds = %183, %173
  %194 = load ptr, ptr %9, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct._EFI_PXE_BASE_CODE_PROTOCOL, ptr %194, i32 0, i32 6
  %196 = load ptr, ptr %195, align 8, !tbaa !44
  %197 = load ptr, ptr %9, align 8, !tbaa !5
  %198 = load i16, ptr %18, align 2, !tbaa !32
  %199 = load ptr, ptr %4, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %199, i32 0, i32 55
  %201 = load ptr, ptr %4, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %201, i32 0, i32 52
  %203 = load ptr, ptr %10, align 8, !tbaa !5
  %204 = call i64 %196(ptr noundef %197, i16 noundef zeroext %198, ptr noundef %200, ptr noundef %7, ptr noundef null, ptr noundef %202, ptr noundef %6, ptr noundef null, ptr noundef null, ptr noundef %11, ptr noundef %203)
  store i64 %204, ptr %21, align 8, !tbaa !33
  %205 = load i64, ptr %21, align 8, !tbaa !33
  %206 = icmp slt i64 %205, 0
  br i1 %206, label %207, label %209

207:                                              ; preds = %193
  %208 = load i64, ptr %21, align 8, !tbaa !33
  store i64 %208, ptr %3, align 8
  store i32 1, ptr %24, align 4
  br label %262

209:                                              ; preds = %193
  %210 = load ptr, ptr %4, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %210, i32 0, i32 63
  %212 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %211, i32 0, i32 0
  store ptr %212, ptr %14, align 8, !tbaa !5
  %213 = load ptr, ptr %14, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %213, i32 0, i32 0
  %215 = load i32, ptr %214, align 1, !tbaa !45
  %216 = zext i32 %215 to i64
  store i64 %216, ptr %17, align 8, !tbaa !33
  %217 = load ptr, ptr %4, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %217, i32 0, i32 28
  %219 = load ptr, ptr %218, align 8, !tbaa !46
  %220 = getelementptr inbounds %struct._EFI_UDP6_PROTOCOL, ptr %219, i32 0, i32 1
  %221 = load ptr, ptr %220, align 8, !tbaa !47
  %222 = load ptr, ptr %4, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %222, i32 0, i32 28
  %224 = load ptr, ptr %223, align 8, !tbaa !46
  %225 = load ptr, ptr %4, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %225, i32 0, i32 41
  %227 = call i64 %221(ptr noundef %224, ptr noundef %226)
  store i64 %227, ptr %21, align 8, !tbaa !33
  %228 = load i64, ptr %21, align 8, !tbaa !33
  %229 = icmp slt i64 %228, 0
  br i1 %229, label %230, label %232

230:                                              ; preds = %209
  %231 = load i64, ptr %21, align 8, !tbaa !33
  store i64 %231, ptr %3, align 8
  store i32 1, ptr %24, align 4
  br label %262

232:                                              ; preds = %209
  %233 = load ptr, ptr %9, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct._EFI_PXE_BASE_CODE_PROTOCOL, ptr %233, i32 0, i32 7
  %235 = load ptr, ptr %234, align 8, !tbaa !49
  %236 = load ptr, ptr %9, align 8, !tbaa !5
  %237 = load ptr, ptr %4, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %237, i32 0, i32 52
  %239 = load ptr, ptr %4, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %239, i32 0, i32 55
  %241 = load ptr, ptr %14, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %241, i32 0, i32 2
  %243 = call i64 %235(ptr noundef %236, i16 noundef zeroext 1, ptr noundef %238, ptr noundef %6, ptr noundef %240, ptr noundef %7, ptr noundef null, ptr noundef null, ptr noundef %17, ptr noundef %242)
  store i64 %243, ptr %21, align 8, !tbaa !33
  %244 = load ptr, ptr %4, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %244, i32 0, i32 28
  %246 = load ptr, ptr %245, align 8, !tbaa !46
  %247 = getelementptr inbounds %struct._EFI_UDP6_PROTOCOL, ptr %246, i32 0, i32 1
  %248 = load ptr, ptr %247, align 8, !tbaa !47
  %249 = load ptr, ptr %4, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %249, i32 0, i32 28
  %251 = load ptr, ptr %250, align 8, !tbaa !46
  %252 = call i64 %248(ptr noundef %251, ptr noundef null)
  %253 = load i64, ptr %21, align 8, !tbaa !33
  %254 = icmp slt i64 %253, 0
  br i1 %254, label %255, label %257

255:                                              ; preds = %232
  %256 = load i64, ptr %21, align 8, !tbaa !33
  store i64 %256, ptr %3, align 8
  store i32 1, ptr %24, align 4
  br label %262

257:                                              ; preds = %232
  %258 = load i64, ptr %17, align 8, !tbaa !33
  %259 = trunc i64 %258 to i32
  %260 = load ptr, ptr %14, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %260, i32 0, i32 1
  store i32 %259, ptr %261, align 1, !tbaa !34
  store i64 0, ptr %3, align 8
  store i32 1, ptr %24, align 4
  br label %262

262:                                              ; preds = %257, %255, %230, %207, %88, %46, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %19) #3
  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 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %6) #3
  %263 = load i64, ptr %3, align 8
  ret i64 %263
}

declare void @CalcElapsedTime(ptr noundef) #1

declare zeroext i16 @WriteUnaligned16(ptr noundef, i16 noundef zeroext) #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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 104}
!12 = !{!"_EFI_PXE_BASE_CODE_PROTOCOL", !13, 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}
!13 = !{!"long long", !7, i64 0}
!14 = !{!15, !6, i64 16176}
!15 = !{!"_PXEBC_PRIVATE_DATA", !10, i64 0, !6, i64 8, !6, i64 16, !16, 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, !12, i64 248, !17, i64 360, !6, i64 376, !6, i64 384, !18, i64 392, !10, i64 10816, !10, i64 10820, !10, i64 10824, !13, i64 10832, !23, i64 10840, !25, i64 10876, !26, i64 10928, !27, i64 10956, !6, i64 11008, !6, i64 11016, !28, i64 11024, !28, 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, !20, i64 11140, !10, i64 11144, !10, i64 11148, !10, i64 11152, !6, i64 11160, !13, i64 11168, !13, i64 11176, !7, i64 11184, !7, i64 12848, !7, i64 14512, !6, i64 16176, !29, i64 16184, !10, i64 16436, !10, i64 16440, !7, i64 16448, !10, i64 43072, !7, i64 43076, !7, i64 43108}
!16 = !{!"_PXEBC_PRIVATE_PROTOCOL", !13, i64 0}
!17 = !{!"_EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL", !13, 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, !10, i64 9016, !7, i64 9020, !10, i64 9404, !7, i64 9408, !21, i64 9792, !22, i64 10296}
!19 = !{!"", !7, i64 0, !7, i64 1, !20, i64 2, !7, i64 4}
!20 = !{!"short", !7, i64 0}
!21 = !{!"", !7, i64 0, !7, i64 1, !20, i64 2, !7, i64 4, !7, i64 8}
!22 = !{!"", !7, i64 0, !7, i64 1}
!23 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !10, i64 8, !10, i64 12, !7, i64 16, !24, i64 17, !24, i64 21, !20, i64 26, !24, i64 28, !20, i64 32}
!24 = !{!"", !7, i64 0}
!25 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !10, i64 8, !10, i64 12, !24, i64 16, !20, i64 32, !24, i64 34, !20, i64 50}
!26 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !24, i64 6, !24, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !10, i64 20, !10, i64 24}
!27 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !24, i64 4, !24, i64 20, !7, i64 36, !7, i64 37, !10, i64 40, !10, i64 44, !10, i64 48}
!28 = !{!"", !6, i64 0, !13, i64 8, !7, i64 16}
!29 = !{!"", !10, i64 0, !10, i64 4, !30, i64 8}
!30 = !{!"", !31, i64 0, !10, i64 236, !7, i64 240}
!31 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !10, i64 4, !20, i64 8, !20, i64 10, !24, i64 12, !24, i64 16, !24, i64 20, !24, i64 24, !7, i64 28, !7, i64 44, !7, i64 108}
!32 = !{!20, !20, i64 0}
!33 = !{!13, !13, i64 0}
!34 = !{!35, !10, i64 4}
!35 = !{!"", !10, i64 0, !10, i64 4, !36, i64 8}
!36 = !{!"", !37, i64 0, !7, i64 4}
!37 = !{!"", !10, i64 0, !10, i64 1}
!38 = !{!39, !20, i64 2}
!39 = !{!"", !20, i64 0, !20, i64 2, !7, i64 4}
!40 = !{!39, !20, i64 0}
!41 = distinct !{!41, !42}
!42 = !{!"llvm.loop.mustprogress"}
!43 = !{!15, !13, i64 10832}
!44 = !{!12, !6, i64 48}
!45 = !{!35, !10, i64 0}
!46 = !{!15, !6, i64 224}
!47 = !{!48, !6, i64 8}
!48 = !{!"_EFI_UDP6_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!49 = !{!12, !6, i64 56}


; 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"

%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_IPv4_ADDRESS = type { [4 x i8] }

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

declare zeroext i16 @SwapBytes16(i16 noundef zeroext) 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

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

declare ptr @AllocateZeroPool(i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @PxeBcDhcp6SeekOption(ptr noundef, i32 noundef, i16 noundef zeroext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775808, 1) i64 @PxeBcRequestBootService(ptr noundef %0, i32 noundef %1) local_unnamed_addr #2 {
  %3 = alloca i16, align 2
  %4 = alloca i16, align 2
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  %7 = getelementptr inbounds i8, ptr %0, i64 248
  %8 = getelementptr inbounds i8, ptr %0, i64 16176
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 16448
  %11 = zext i32 %1 to i64
  %12 = getelementptr inbounds [16 x %union.PXEBC_DHCP_PACKET_CACHE], ptr %10, i64 0, i64 %11
  store i16 4011, ptr %3, align 2, !tbaa !29
  store i16 4011, ptr %4, align 2, !tbaa !29
  %13 = icmp eq ptr %9, null
  br i1 %13, label %109, label %14

14:                                               ; preds = %2
  %15 = tail call ptr @AllocateZeroPool(i64 noundef 1028) #3
  %16 = icmp eq ptr %15, null
  br i1 %16, label %109, label %17

17:                                               ; preds = %14
  %18 = getelementptr inbounds i8, ptr %12, i64 8
  %19 = load i32, ptr %18, align 1
  %20 = and i32 %19, -256
  %21 = load i32, ptr %15, align 4
  %22 = and i32 %21, 255
  %23 = or disjoint i32 %22, %20
  store i32 %23, ptr %15, align 4
  %24 = getelementptr inbounds i8, ptr %9, i64 8
  %25 = load i32, ptr %24, align 1
  %26 = and i32 %25, 255
  %27 = or disjoint i32 %26, %20
  store i32 %27, ptr %15, align 4
  %28 = getelementptr inbounds i8, ptr %15, i64 4
  %29 = getelementptr inbounds i8, ptr %12, i64 12
  %30 = getelementptr inbounds i8, ptr %12, i64 4
  %31 = load i32, ptr %30, align 1, !tbaa !30
  %32 = add i32 %31, -4
  %33 = tail call ptr @PxeBcDhcp6SeekOption(ptr noundef nonnull %29, i32 noundef %32, i16 noundef zeroext 2)
  %34 = icmp eq ptr %33, null
  br i1 %34, label %109, label %35

35:                                               ; preds = %17
  %36 = getelementptr inbounds i8, ptr %33, i64 2
  %37 = load i16, ptr %36, align 1, !tbaa !34
  %38 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %37) #3
  %39 = zext i16 %38 to i64
  %40 = add nuw nsw i64 %39, 4
  %41 = tail call ptr @CopyMem(ptr noundef nonnull %28, ptr noundef nonnull %33, i64 noundef %40) #3
  %42 = add nuw nsw i64 %39, 8
  %43 = getelementptr inbounds i8, ptr %9, i64 4
  %44 = load i32, ptr %43, align 1, !tbaa !30
  %45 = icmp ugt i32 %44, 4
  br i1 %45, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %35
  %46 = getelementptr inbounds i8, ptr %28, i64 %40
  %47 = getelementptr inbounds i8, ptr %9, i64 12
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph._crit_edge
  %.07688 = phi i64 [ %63, %.lr.ph._crit_edge ], [ 4, %.lr.ph.preheader ]
  %.07787 = phi ptr [ %62, %.lr.ph._crit_edge ], [ %47, %.lr.ph.preheader ]
  %.07886 = phi ptr [ %.1, %.lr.ph._crit_edge ], [ %46, %.lr.ph.preheader ]
  %48 = phi i64 [ %61, %.lr.ph._crit_edge ], [ %42, %.lr.ph.preheader ]
  %49 = load i16, ptr %.07787, align 1, !tbaa !36
  %50 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %49) #3
  %51 = getelementptr inbounds i8, ptr %.07787, i64 2
  %52 = load i16, ptr %51, align 1, !tbaa !34
  %53 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %52) #3
  %54 = add i16 %50, -5
  %or.cond5 = icmp ult i16 %54, -3
  %55 = zext i16 %53 to i64
  %56 = add nuw nsw i64 %55, 4
  br i1 %or.cond5, label %57, label %.lr.ph._crit_edge

57:                                               ; preds = %.lr.ph
  %58 = tail call ptr @CopyMem(ptr noundef %.07886, ptr noundef nonnull %.07787, i64 noundef %56) #3
  %59 = getelementptr inbounds i8, ptr %.07886, i64 %56
  %60 = add i64 %48, %56
  br label %.lr.ph._crit_edge

.lr.ph._crit_edge:                                ; preds = %.lr.ph, %57
  %61 = phi i64 [ %60, %57 ], [ %48, %.lr.ph ]
  %.1 = phi ptr [ %59, %57 ], [ %.07886, %.lr.ph ]
  %62 = getelementptr inbounds i8, ptr %.07787, i64 %56
  %63 = add nuw nsw i64 %56, %.07688
  %64 = load i32, ptr %43, align 1, !tbaa !30
  %65 = zext i32 %64 to i64
  %66 = icmp ult i64 %63, %65
  br i1 %66, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !37

._crit_edge.loopexit:                             ; preds = %.lr.ph._crit_edge
  %67 = trunc i64 %63 to i32
  %68 = add i32 %67, -4
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %35
  %.lcssa = phi i64 [ %42, %35 ], [ %61, %._crit_edge.loopexit ]
  %.076.lcssa = phi i32 [ 0, %35 ], [ %68, %._crit_edge.loopexit ]
  store i64 %.lcssa, ptr %5, align 8, !tbaa !39
  %69 = tail call ptr @PxeBcDhcp6SeekOption(ptr noundef nonnull %28, i32 noundef %.076.lcssa, i16 noundef zeroext 8)
  %.not = icmp eq ptr %69, null
  br i1 %.not, label %77, label %70

70:                                               ; preds = %._crit_edge
  tail call void @CalcElapsedTime(ptr noundef %0) #3
  %71 = getelementptr inbounds i8, ptr %69, i64 4
  %72 = getelementptr inbounds i8, ptr %0, i64 10832
  %73 = load i64, ptr %72, align 8, !tbaa !40
  %74 = trunc i64 %73 to i16
  %75 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %74) #3
  %76 = tail call zeroext i16 @WriteUnaligned16(ptr noundef nonnull %71, i16 noundef zeroext %75) #3
  br label %77

77:                                               ; preds = %70, %._crit_edge
  %78 = getelementptr inbounds i8, ptr %0, i64 296
  %79 = load ptr, ptr %78, align 8, !tbaa !41
  %80 = getelementptr inbounds i8, ptr %0, i64 11124
  %81 = getelementptr inbounds i8, ptr %0, i64 11076
  %82 = call i64 %79(ptr noundef nonnull %7, i16 noundef zeroext 0, ptr noundef nonnull %80, ptr noundef nonnull %4, ptr noundef null, ptr noundef nonnull %81, ptr noundef nonnull %3, ptr noundef null, ptr noundef null, ptr noundef nonnull %5, ptr noundef nonnull %15) #3
  %83 = icmp slt i64 %82, 0
  br i1 %83, label %109, label %84

84:                                               ; preds = %77
  %85 = getelementptr inbounds i8, ptr %0, i64 11184
  %86 = load i32, ptr %85, align 1, !tbaa !42
  %87 = zext i32 %86 to i64
  store i64 %87, ptr %6, align 8, !tbaa !39
  %88 = getelementptr inbounds i8, ptr %0, i64 224
  %89 = load ptr, ptr %88, align 8, !tbaa !43
  %90 = getelementptr inbounds i8, ptr %89, i64 8
  %91 = load ptr, ptr %90, align 8, !tbaa !44
  %92 = getelementptr inbounds i8, ptr %0, i64 10876
  %93 = call i64 %91(ptr noundef %89, ptr noundef nonnull %92) #3
  %94 = icmp slt i64 %93, 0
  br i1 %94, label %109, label %95

95:                                               ; preds = %84
  %96 = getelementptr inbounds i8, ptr %0, i64 304
  %97 = load ptr, ptr %96, align 8, !tbaa !46
  %98 = getelementptr inbounds i8, ptr %0, i64 11192
  %99 = call i64 %97(ptr noundef nonnull %7, i16 noundef zeroext 1, ptr noundef nonnull %81, ptr noundef nonnull %3, ptr noundef nonnull %80, ptr noundef nonnull %4, ptr noundef null, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %98) #3
  %100 = load ptr, ptr %88, align 8, !tbaa !43
  %101 = getelementptr inbounds i8, ptr %100, i64 8
  %102 = load ptr, ptr %101, align 8, !tbaa !44
  %103 = call i64 %102(ptr noundef %100, ptr noundef null) #3
  %104 = icmp slt i64 %99, 0
  br i1 %104, label %109, label %105

105:                                              ; preds = %95
  %106 = load i64, ptr %6, align 8, !tbaa !39
  %107 = trunc i64 %106 to i32
  %108 = getelementptr inbounds i8, ptr %0, i64 11188
  store i32 %107, ptr %108, align 1, !tbaa !30
  br label %109

109:                                              ; preds = %95, %84, %77, %17, %14, %2, %105
  %.0 = phi i64 [ 0, %105 ], [ -9223372036854775801, %2 ], [ -9223372036854775799, %14 ], [ -9223372036854775794, %17 ], [ %82, %77 ], [ %93, %84 ], [ %99, %95 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %3) #3
  ret i64 %.0
}

declare void @CalcElapsedTime(ptr noundef) local_unnamed_addr #1

declare zeroext i16 @WriteUnaligned16(ptr noundef, i16 noundef zeroext) 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, !10, i64 16176}
!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 = !{!17, !17, i64 0}
!30 = !{!31, !7, i64 4}
!31 = !{!"", !7, i64 0, !7, i64 4, !32, i64 8}
!32 = !{!"", !33, i64 0, !8, i64 4}
!33 = !{!"", !7, i64 0, !7, i64 1}
!34 = !{!35, !17, i64 2}
!35 = !{!"", !17, i64 0, !17, i64 2, !8, i64 4}
!36 = !{!35, !17, i64 0}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!12, !12, i64 0}
!40 = !{!6, !12, i64 10832}
!41 = !{!13, !10, i64 48}
!42 = !{!31, !7, i64 0}
!43 = !{!6, !10, i64 224}
!44 = !{!45, !10, i64 8}
!45 = !{!"_EFI_UDP6_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48}
!46 = !{!13, !10, i64 56}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass