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

; 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_OPTION = type <{ i16, i16, [1 x i8] }>

@.str.1 = external hidden unnamed_addr constant [137 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [35 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 i64 @AsciiPrint(ptr noundef, ...) #1

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

declare zeroext i8 @DebugAssertEnabled() #1

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

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

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

22:                                               ; preds = %2
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %23, i32 0, i32 65
  store ptr %24, ptr %9, align 8, !tbaa !5
  br label %37

25:                                               ; preds = %2
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_MODE, ptr %26, i32 0, i32 10
  %28 = load i8, ptr %27, align 2, !tbaa !20
  %29 = icmp ne i8 %28, 0
  br i1 %29, label %30, label %33

30:                                               ; preds = %25
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %31, i32 0, i32 63
  store ptr %32, ptr %9, align 8, !tbaa !5
  br label %36

33:                                               ; preds = %25
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %34, i32 0, i32 64
  store ptr %35, ptr %9, align 8, !tbaa !5
  br label %36

36:                                               ; preds = %33, %30
  br label %37

37:                                               ; preds = %36, %22
  br label %38

38:                                               ; preds = %37
  %39 = call zeroext i8 @DebugAssertEnabled()
  %40 = icmp ne i8 %39, 0
  br i1 %40, label %41, label %49

41:                                               ; preds = %38
  %42 = load ptr, ptr %9, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %42, i32 0, i32 2
  %44 = getelementptr inbounds [4 x ptr], ptr %43, i64 0, i64 1
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %46 = icmp ne ptr %45, null
  br i1 %46, label %48, label %47

47:                                               ; preds = %41
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 620, ptr noundef @.str.17)
  br label %48

48:                                               ; preds = %47, %41
  br label %49

49:                                               ; preds = %48, %38
  br label %50

50:                                               ; preds = %49
  br label %51

51:                                               ; preds = %50
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %52, i32 0, i32 60
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %54, i32 0, i32 55
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %56, i32 0, i32 2
  %58 = getelementptr inbounds [4 x ptr], ptr %57, i64 0, i64 1
  %59 = load ptr, ptr %58, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %59, i32 0, i32 2
  %61 = getelementptr inbounds [1 x i8], ptr %60, i64 0, i64 0
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %62, i32 0, i32 2
  %64 = getelementptr inbounds [4 x ptr], ptr %63, i64 0, i64 1
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %65, i32 0, i32 1
  %67 = load i16, ptr %66, align 1, !tbaa !21
  %68 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %67)
  %69 = call i64 @PxeBcExtractBootFileUrl(ptr noundef %53, ptr noundef %55, ptr noundef %61, i16 noundef zeroext %68)
  store i64 %69, ptr %8, align 8, !tbaa !12
  %70 = load i64, ptr %8, align 8, !tbaa !12
  %71 = icmp slt i64 %70, 0
  br i1 %71, label %72, label %74

72:                                               ; preds = %51
  %73 = load i64, ptr %8, align 8, !tbaa !12
  store i64 %73, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %129

74:                                               ; preds = %51
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %75, i32 0, i32 2
  %77 = getelementptr inbounds [4 x ptr], ptr %76, i64 0, i64 2
  %78 = load ptr, ptr %77, align 8, !tbaa !5
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %98

80:                                               ; preds = %74
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %81, i32 0, i32 2
  %83 = getelementptr inbounds [4 x ptr], ptr %82, i64 0, i64 2
  %84 = load ptr, ptr %83, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %84, i32 0, i32 2
  %86 = getelementptr inbounds [1 x i8], ptr %85, i64 0, i64 0
  %87 = call i64 @PxeBcExtractBootFileParam(ptr noundef %86, ptr noundef %10)
  store i64 %87, ptr %8, align 8, !tbaa !12
  %88 = load i64, ptr %8, align 8, !tbaa !12
  %89 = icmp slt i64 %88, 0
  br i1 %89, label %90, label %92

90:                                               ; preds = %80
  %91 = load i64, ptr %8, align 8, !tbaa !12
  store i64 %91, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %129

92:                                               ; preds = %80
  %93 = load i16, ptr %10, align 2, !tbaa !23
  %94 = zext i16 %93 to i32
  %95 = mul nsw i32 512, %94
  %96 = sext i32 %95 to i64
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  store i64 %96, ptr %97, align 8, !tbaa !12
  br label %112

98:                                               ; preds = %74
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct._EFI_PXE_BASE_CODE_PROTOCOL, ptr %99, i32 0, i32 5
  %101 = load ptr, ptr %100, align 8, !tbaa !24
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %104, i32 0, i32 62
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %106, i32 0, i32 55
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %108, i32 0, i32 60
  %110 = load ptr, ptr %109, align 8, !tbaa !25
  %111 = call i64 %101(ptr noundef %102, i32 noundef 1, ptr noundef null, i8 noundef zeroext 0, ptr noundef %103, ptr noundef %105, ptr noundef %107, ptr noundef %110, ptr noundef null, i8 noundef zeroext 0)
  store i64 %111, ptr %8, align 8, !tbaa !12
  br label %112

112:                                              ; preds = %98, %92
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = load i64, ptr %113, align 8, !tbaa !12
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %115, i32 0, i32 61
  store i64 %114, ptr %116, align 8, !tbaa !38
  %117 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.14)
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %118, i32 0, i32 55
  call void @PxeBcShowIp6Addr(ptr noundef %119)
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %120, i32 0, i32 60
  %122 = load ptr, ptr %121, align 8, !tbaa !25
  %123 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.15, ptr noundef %122)
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %124, i32 0, i32 61
  %126 = load i64, ptr %125, align 8, !tbaa !38
  %127 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.16, i64 noundef %126)
  %128 = load i64, ptr %8, align 8, !tbaa !12
  store i64 %128, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %129

129:                                              ; preds = %112, %90, %72
  call void @llvm.lifetime.end.p0(i64 2, 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 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %130 = load i64, ptr %3, align 8
  ret i64 %130
}

declare i64 @PxeBcExtractBootFileUrl(ptr noundef, ptr noundef, ptr noundef, i16 noundef zeroext) #1

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

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


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

@.str.1 = external hidden unnamed_addr constant [137 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [35 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 i64 @AsciiPrint(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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @PxeBcDhcp6BootInfo(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca i16, align 2
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %3) #3
  %4 = getelementptr inbounds i8, ptr %0, i64 248
  %5 = getelementptr inbounds i8, ptr %0, i64 352
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  store i64 0, ptr %1, align 8, !tbaa !11
  %7 = getelementptr inbounds i8, ptr %6, i64 12
  %8 = load i8, ptr %7, align 4, !tbaa !12
  %.not = icmp eq i8 %8, 0
  br i1 %.not, label %9, label %12

9:                                                ; preds = %2
  %10 = getelementptr inbounds i8, ptr %6, i64 10
  %11 = load i8, ptr %10, align 2, !tbaa !19
  %.not37 = icmp eq i8 %11, 0
  %. = select i1 %.not37, i64 12848, i64 11184
  br label %12

12:                                               ; preds = %9, %2
  %.sink = phi i64 [ 14512, %2 ], [ %., %9 ]
  %13 = getelementptr inbounds i8, ptr %0, i64 %.sink
  %14 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not38 = icmp eq i8 %14, 0
  br i1 %.not38, label %19, label %15

15:                                               ; preds = %12
  %16 = getelementptr inbounds i8, ptr %13, i64 1488
  %17 = load ptr, ptr %16, align 8, !tbaa !20
  %.not39 = icmp eq ptr %17, null
  br i1 %.not39, label %18, label %19

18:                                               ; preds = %15
  tail call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 620, ptr noundef nonnull @.str.17) #3
  br label %19

19:                                               ; preds = %15, %18, %12
  %20 = getelementptr inbounds i8, ptr %0, i64 11160
  %21 = getelementptr inbounds i8, ptr %0, i64 11124
  %22 = getelementptr inbounds i8, ptr %13, i64 1488
  %23 = load ptr, ptr %22, align 8, !tbaa !20
  %24 = getelementptr inbounds i8, ptr %23, i64 4
  %25 = getelementptr inbounds i8, ptr %23, i64 2
  %26 = load i16, ptr %25, align 1, !tbaa !21
  %27 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %26) #3
  %28 = tail call i64 @PxeBcExtractBootFileUrl(ptr noundef nonnull %20, ptr noundef nonnull %21, ptr noundef nonnull %24, i16 noundef zeroext %27) #3
  %29 = icmp slt i64 %28, 0
  br i1 %29, label %55, label %30

30:                                               ; preds = %19
  %31 = getelementptr inbounds i8, ptr %13, i64 1496
  %32 = load ptr, ptr %31, align 8, !tbaa !20
  %.not40 = icmp eq ptr %32, null
  br i1 %.not40, label %41, label %33

33:                                               ; preds = %30
  %34 = getelementptr inbounds i8, ptr %32, i64 4
  %35 = call i64 @PxeBcExtractBootFileParam(ptr noundef nonnull %34, ptr noundef nonnull %3) #3
  %36 = icmp slt i64 %35, 0
  br i1 %36, label %55, label %37

37:                                               ; preds = %33
  %38 = load i16, ptr %3, align 2, !tbaa !23
  %39 = zext i16 %38 to i64
  %40 = shl nuw nsw i64 %39, 9
  store i64 %40, ptr %1, align 8, !tbaa !11
  br label %47

41:                                               ; preds = %30
  %42 = getelementptr inbounds i8, ptr %0, i64 288
  %43 = load ptr, ptr %42, align 8, !tbaa !24
  %44 = getelementptr inbounds i8, ptr %0, i64 11176
  %45 = load ptr, ptr %20, align 8, !tbaa !25
  %46 = tail call i64 %43(ptr noundef nonnull %4, i32 noundef 1, ptr noundef null, i8 noundef zeroext 0, ptr noundef nonnull %1, ptr noundef nonnull %44, ptr noundef nonnull %21, ptr noundef %45, ptr noundef null, i8 noundef zeroext 0) #3
  %.pre = load i64, ptr %1, align 8, !tbaa !11
  br label %47

47:                                               ; preds = %41, %37
  %48 = phi i64 [ %40, %37 ], [ %.pre, %41 ]
  %.032 = phi i64 [ %35, %37 ], [ %46, %41 ]
  %49 = getelementptr inbounds i8, ptr %0, i64 11168
  store i64 %48, ptr %49, align 8, !tbaa !38
  %50 = call i64 (ptr, ...) @AsciiPrint(ptr noundef nonnull @.str.14) #3
  call void @PxeBcShowIp6Addr(ptr noundef nonnull %21) #3
  %51 = load ptr, ptr %20, align 8, !tbaa !25
  %52 = call i64 (ptr, ...) @AsciiPrint(ptr noundef nonnull @.str.15, ptr noundef %51) #3
  %53 = load i64, ptr %49, align 8, !tbaa !38
  %54 = call i64 (ptr, ...) @AsciiPrint(ptr noundef nonnull @.str.16, i64 noundef %53) #3
  br label %55

55:                                               ; preds = %33, %19, %47
  %.033 = phi i64 [ %.032, %47 ], [ %28, %19 ], [ %35, %33 ]
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %3) #3
  ret i64 %.033
}

declare i64 @PxeBcExtractBootFileUrl(ptr noundef, ptr noundef, ptr noundef, i16 noundef zeroext) local_unnamed_addr #1

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

declare void @PxeBcShowIp6Addr(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, !10, i64 104}
!6 = !{!"_EFI_PXE_BASE_CODE_PROTOCOL", !7, 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}
!7 = !{!"long long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !8, i64 12}
!13 = !{!"", !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, !14, i64 8884, !16, i64 9016, !8, i64 9020, !16, i64 9404, !8, i64 9408, !17, i64 9792, !18, i64 10296}
!14 = !{!"", !8, i64 0, !8, i64 1, !15, i64 2, !8, i64 4}
!15 = !{!"short", !8, i64 0}
!16 = !{!"int", !8, i64 0}
!17 = !{!"", !8, i64 0, !8, i64 1, !15, i64 2, !8, i64 4, !8, i64 8}
!18 = !{!"", !8, i64 0, !8, i64 1}
!19 = !{!13, !8, i64 10}
!20 = !{!10, !10, i64 0}
!21 = !{!22, !15, i64 2}
!22 = !{!"", !15, i64 0, !15, i64 2, !8, i64 4}
!23 = !{!15, !15, i64 0}
!24 = !{!6, !10, i64 40}
!25 = !{!26, !10, i64 11160}
!26 = !{!"_PXEBC_PRIVATE_DATA", !16, i64 0, !10, i64 8, !10, i64 16, !27, 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, !6, i64 248, !28, i64 360, !10, i64 376, !10, i64 384, !13, i64 392, !16, i64 10816, !16, i64 10820, !16, i64 10824, !7, i64 10832, !29, i64 10840, !31, i64 10876, !32, i64 10928, !33, i64 10956, !10, i64 11008, !10, i64 11016, !34, i64 11024, !34, 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, !15, i64 11140, !16, i64 11144, !16, i64 11148, !16, i64 11152, !10, i64 11160, !7, i64 11168, !7, i64 11176, !8, i64 11184, !8, i64 12848, !8, i64 14512, !10, i64 16176, !35, i64 16184, !16, i64 16436, !16, i64 16440, !8, i64 16448, !16, i64 43072, !8, i64 43076, !8, i64 43108}
!27 = !{!"_PXEBC_PRIVATE_PROTOCOL", !7, i64 0}
!28 = !{!"_EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL", !7, i64 0, !10, i64 8}
!29 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 6, !16, i64 8, !16, i64 12, !8, i64 16, !30, i64 17, !30, i64 21, !15, i64 26, !30, i64 28, !15, i64 32}
!30 = !{!"", !8, i64 0}
!31 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !16, i64 8, !16, i64 12, !30, i64 16, !15, i64 32, !30, i64 34, !15, i64 50}
!32 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !30, i64 6, !30, i64 10, !8, i64 14, !8, i64 15, !8, i64 16, !8, i64 17, !16, i64 20, !16, i64 24}
!33 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !30, i64 4, !30, i64 20, !8, i64 36, !8, i64 37, !16, i64 40, !16, i64 44, !16, i64 48}
!34 = !{!"", !10, i64 0, !7, i64 8, !8, i64 16}
!35 = !{!"", !16, i64 0, !16, i64 4, !36, i64 8}
!36 = !{!"", !37, i64 0, !16, i64 236, !8, i64 240}
!37 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !16, i64 4, !15, i64 8, !15, i64 10, !30, i64 12, !30, i64 16, !30, i64 20, !30, i64 24, !8, i64 28, !8, i64 44, !8, i64 108}
!38 = !{!26, !7, i64 11168}


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