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

; 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.EFI_IPv4_ADDRESS = type { [4 x i8] }
%union.EFI_IP_ADDRESS = type { [4 x i32] }
%struct._PXEBC_PRIVATE_DATA = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct._EFI_PXE_BASE_CODE_PROTOCOL, %struct._EFI_LOAD_FILE_PROTOCOL, %struct._EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL, ptr, ptr, ptr, ptr, %struct.EFI_IP4_CONFIG_DATA, ptr, ptr, ptr, i16, %struct.EFI_UDP4_CONFIG_DATA, %struct.EFI_PXE_BASE_CODE_MODE, i32, ptr, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, i8, i32, i64, i64, [312 x i8], %struct.EFI_DHCP4_PACKET, %struct.EFI_MAC_ADDRESS, i8, i8, i8, i32, i32, i32, %struct.PXEBC_CACHED_DHCP4_PACKET, %struct.PXEBC_CACHED_DHCP4_PACKET, %struct.PXEBC_CACHED_DHCP4_PACKET, [16 x %struct.PXEBC_CACHED_DHCP4_PACKET], [5 x i32], [5 x [16 x i32]], i32, [5 x i32], [16 x i32], ptr, %struct.EFI_IP4_COMPLETION_TOKEN }
%struct._EFI_PXE_BASE_CODE_PROTOCOL = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._EFI_LOAD_FILE_PROTOCOL = type { ptr }
%struct._EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL = type { i64, ptr }
%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_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_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_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_DHCP4_PACKET = type <{ i32, i32, %struct.anon }>
%struct.anon = 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_MAC_ADDRESS = type { [32 x i8] }
%struct.PXEBC_CACHED_DHCP4_PACKET = type { %union.PXEBC_DHCP4_PACKET, i8, i8, [7 x ptr], %struct.PXEBC_VENDOR_OPTION }
%union.PXEBC_DHCP4_PACKET = type { [1480 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_IP4_COMPLETION_TOKEN = type { ptr, i64, %union.anon.1 }
%union.anon.1 = type { ptr }
%struct.EFI_DHCP4_PACKET_OPTION = type { i8, i8, [1 x i8] }

@.str = external hidden unnamed_addr constant [157 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [43 x i8], align 1
@mZeroIp4Addr = external global %struct.EFI_IPv4_ADDRESS, align 1

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

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @PxeBcParseCachedDhcpPacket(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i8 @PxeBcTryBinl(ptr noundef %0, i32 noundef %1) #2 {
  %3 = alloca i8, align 1
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca %union.EFI_IP_ADDRESS, align 4
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = 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 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 16, 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
  br label %12

12:                                               ; preds = %2
  %13 = call zeroext i8 @DebugAssertEnabled()
  %14 = icmp ne i8 %13, 0
  br i1 %14, label %15, label %20

15:                                               ; preds = %12
  %16 = load i32, ptr %5, align 4, !tbaa !9
  %17 = icmp ult i32 %16, 16
  br i1 %17, label %19, label %18

18:                                               ; preds = %15
  call void @DebugAssert(ptr noundef @.str, i64 noundef 305, ptr noundef @.str.5)
  br label %19

19:                                               ; preds = %18, %15
  br label %20

20:                                               ; preds = %19, %12
  br label %21

21:                                               ; preds = %20
  br label %22

22:                                               ; preds = %21
  br label %23

23:                                               ; preds = %22
  %24 = call zeroext i8 @DebugAssertEnabled()
  %25 = icmp ne i8 %24, 0
  br i1 %25, label %26, label %38

26:                                               ; preds = %23
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %27, i32 0, i32 46
  %29 = load i32, ptr %5, align 4, !tbaa !9
  %30 = zext i32 %29 to i64
  %31 = getelementptr inbounds [16 x %struct.PXEBC_CACHED_DHCP4_PACKET], ptr %28, i64 0, i64 %30
  %32 = getelementptr inbounds %struct.PXEBC_CACHED_DHCP4_PACKET, ptr %31, i32 0, i32 2
  %33 = load i8, ptr %32, align 1, !tbaa !11
  %34 = zext i8 %33 to i32
  %35 = icmp eq i32 %34, 2
  br i1 %35, label %37, label %36

36:                                               ; preds = %26
  call void @DebugAssert(ptr noundef @.str, i64 noundef 306, ptr noundef @.str.6)
  br label %37

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

38:                                               ; preds = %37, %23
  br label %39

39:                                               ; preds = %38
  br label %40

40:                                               ; preds = %39
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %41, i32 0, i32 46
  %43 = load i32, ptr %5, align 4, !tbaa !9
  %44 = zext i32 %43 to i64
  %45 = getelementptr inbounds [16 x %struct.PXEBC_CACHED_DHCP4_PACKET], ptr %42, i64 0, i64 %44
  %46 = getelementptr inbounds %struct.PXEBC_CACHED_DHCP4_PACKET, ptr %45, i32 0, i32 0
  store ptr %46, ptr %6, align 8, !tbaa !5
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %47, i32 0, i32 2
  %49 = getelementptr inbounds %struct.anon, ptr %48, i32 0, i32 0
  %50 = getelementptr inbounds %struct.EFI_DHCP4_HEADER, ptr %49, i32 0, i32 9
  %51 = getelementptr inbounds %struct.EFI_IPv4_ADDRESS, ptr %50, i32 0, i32 0
  %52 = call i64 @CompareMem(ptr noundef %51, ptr noundef @mZeroIp4Addr, i64 noundef 4)
  %53 = icmp eq i64 %52, 0
  br i1 %53, label %54, label %67

54:                                               ; preds = %40
  %55 = getelementptr inbounds [4 x i32], ptr %7, i64 0, i64 0
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %56, i32 0, i32 46
  %58 = load i32, ptr %5, align 4, !tbaa !9
  %59 = zext i32 %58 to i64
  %60 = getelementptr inbounds [16 x %struct.PXEBC_CACHED_DHCP4_PACKET], ptr %57, i64 0, i64 %59
  %61 = getelementptr inbounds %struct.PXEBC_CACHED_DHCP4_PACKET, ptr %60, i32 0, i32 3
  %62 = getelementptr inbounds [7 x ptr], ptr %61, i64 0, i64 4
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.EFI_DHCP4_PACKET_OPTION, ptr %63, i32 0, i32 2
  %65 = getelementptr inbounds [1 x i8], ptr %64, i64 0, i64 0
  %66 = call ptr @CopyMem(ptr noundef %55, ptr noundef %65, i64 noundef 4)
  br label %74

67:                                               ; preds = %40
  %68 = getelementptr inbounds [4 x i32], ptr %7, i64 0, i64 0
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %69, i32 0, i32 2
  %71 = getelementptr inbounds %struct.anon, ptr %70, i32 0, i32 0
  %72 = getelementptr inbounds %struct.EFI_DHCP4_HEADER, ptr %71, i32 0, i32 9
  %73 = call ptr @CopyMem(ptr noundef %68, ptr noundef %72, i64 noundef 4)
  br label %74

74:                                               ; preds = %67, %54
  %75 = getelementptr inbounds [4 x i32], ptr %7, i64 0, i64 0
  %76 = load i32, ptr %75, align 4, !tbaa !16
  %77 = icmp eq i32 %76, 0
  br i1 %77, label %78, label %79

78:                                               ; preds = %74
  store i8 0, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %126

79:                                               ; preds = %74
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %80, i32 0, i32 43
  store ptr %81, ptr %9, align 8, !tbaa !5
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.PXEBC_CACHED_DHCP4_PACKET, ptr %82, i32 0, i32 0
  store ptr %83, ptr %10, align 8, !tbaa !5
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  %86 = call i64 @PxeBcDiscvBootService(ptr noundef %84, i16 noundef zeroext 0, ptr noundef null, i8 noundef zeroext 0, ptr noundef %7, i16 noundef zeroext 0, ptr noundef null, i8 noundef zeroext 0, ptr noundef %85)
  store i64 %86, ptr %8, align 8, !tbaa !17
  %87 = load i64, ptr %8, align 8, !tbaa !17
  %88 = icmp slt i64 %87, 0
  br i1 %88, label %89, label %90

89:                                               ; preds = %79
  store i8 0, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %126

90:                                               ; preds = %79
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = call zeroext i8 @PxeBcParseCachedDhcpPacket(ptr noundef %91)
  %93 = icmp ne i8 %92, 0
  br i1 %93, label %95, label %94

94:                                               ; preds = %90
  store i8 0, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %126

95:                                               ; preds = %90
  %96 = load ptr, ptr %9, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.PXEBC_CACHED_DHCP4_PACKET, ptr %96, i32 0, i32 2
  %98 = load i8, ptr %97, align 1, !tbaa !11
  %99 = zext i8 %98 to i32
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %101, label %108

101:                                              ; preds = %95
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.PXEBC_CACHED_DHCP4_PACKET, ptr %102, i32 0, i32 3
  %104 = getelementptr inbounds [7 x ptr], ptr %103, i64 0, i64 6
  %105 = load ptr, ptr %104, align 8, !tbaa !5
  %106 = icmp eq ptr %105, null
  br i1 %106, label %107, label %108

107:                                              ; preds = %101
  store i8 0, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %126

108:                                              ; preds = %101, %95
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %109, i32 0, i32 10
  %111 = getelementptr inbounds %struct._EFI_PXE_BASE_CODE_PROTOCOL, ptr %110, i32 0, i32 13
  %112 = load ptr, ptr %111, align 8, !tbaa !19
  %113 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_MODE, ptr %112, i32 0, i32 10
  store i8 1, ptr %113, align 2, !tbaa !34
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %114, i32 0, i32 10
  %116 = getelementptr inbounds %struct._EFI_PXE_BASE_CODE_PROTOCOL, ptr %115, i32 0, i32 13
  %117 = load ptr, ptr %116, align 8, !tbaa !19
  %118 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_MODE, ptr %117, i32 0, i32 23
  %119 = load ptr, ptr %10, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %119, i32 0, i32 2
  %121 = load ptr, ptr %10, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %121, i32 0, i32 1
  %123 = load i32, ptr %122, align 1, !tbaa !35
  %124 = zext i32 %123 to i64
  %125 = call ptr @CopyMem(ptr noundef %118, ptr noundef %120, i64 noundef %124)
  store i8 1, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %126

126:                                              ; preds = %108, %107, %94, %89, %78
  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 16, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %127 = load i8, ptr %3, align 1
  ret i8 %127
}

; Function Attrs: nounwind uwtable
declare dso_local i64 @PxeBcDiscvBootService(ptr noundef, i16 noundef zeroext, ptr noundef, i8 noundef zeroext, ptr noundef, i16 noundef zeroext, ptr noundef, i8 noundef zeroext, ptr noundef) #2

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, !7, i64 1481}
!12 = !{!"", !7, i64 0, !7, i64 1480, !7, i64 1481, !7, i64 1488, !13, i64 1544}
!13 = !{!"", !7, i64 0, !14, i64 32, !15, i64 36, !15, i64 38, !7, i64 40, !7, i64 41, !7, i64 42, !14, i64 43, !14, i64 47, !15, i64 52, !15, i64 54, !15, i64 56, !15, 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}
!14 = !{!"", !7, i64 0}
!15 = !{!"short", !7, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"long long", !7, i64 0}
!19 = !{!20, !6, i64 184}
!20 = !{!"_PXEBC_PRIVATE_DATA", !10, 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, !21, i64 80, !22, i64 192, !23, i64 200, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !24, i64 248, !6, i64 280, !6, i64 288, !6, i64 296, !15, i64 304, !25, i64 308, !26, i64 344, !10, i64 10768, !6, i64 10776, !7, i64 10784, !7, i64 10800, !7, i64 10816, !7, i64 10832, !7, i64 10848, !10, i64 10852, !18, i64 10856, !18, i64 10864, !7, i64 10872, !30, i64 11184, !14, i64 11433, !7, i64 11465, !7, i64 11466, !7, i64 11467, !10, i64 11468, !10, i64 11472, !10, i64 11476, !12, i64 11480, !12, i64 13152, !12, i64 14824, !7, i64 16496, !7, i64 43248, !7, i64 43268, !10, i64 43588, !7, i64 43592, !7, i64 43612, !6, i64 43680, !33, i64 43688}
!21 = !{!"_EFI_PXE_BASE_CODE_PROTOCOL", !18, 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}
!22 = !{!"_EFI_LOAD_FILE_PROTOCOL", !6, i64 0}
!23 = !{!"_EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL", !18, i64 0, !6, i64 8}
!24 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !14, i64 6, !14, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !10, i64 20, !10, i64 24}
!25 = !{!"", !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, !14, i64 17, !14, i64 21, !15, i64 26, !14, i64 28, !15, i64 32}
!26 = !{!"", !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, !27, i64 8884, !10, i64 9016, !7, i64 9020, !10, i64 9404, !7, i64 9408, !28, i64 9792, !29, i64 10296}
!27 = !{!"", !7, i64 0, !7, i64 1, !15, i64 2, !7, i64 4}
!28 = !{!"", !7, i64 0, !7, i64 1, !15, i64 2, !7, i64 4, !7, i64 8}
!29 = !{!"", !7, i64 0, !7, i64 1}
!30 = !{!"", !10, i64 0, !10, i64 4, !31, i64 8}
!31 = !{!"", !32, i64 0, !10, i64 236, !7, i64 240}
!32 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !10, i64 4, !15, i64 8, !15, i64 10, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !7, i64 28, !7, i64 44, !7, i64 108}
!33 = !{!"", !6, i64 0, !18, i64 8, !7, i64 16}
!34 = !{!26, !7, i64 10}
!35 = !{!30, !10, i64 4}


; 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_IPv4_ADDRESS = type { [4 x i8] }
%union.EFI_IP_ADDRESS = type { [4 x i32] }
%struct.PXEBC_CACHED_DHCP4_PACKET = type { %union.PXEBC_DHCP4_PACKET, i8, i8, [7 x ptr], %struct.PXEBC_VENDOR_OPTION }
%union.PXEBC_DHCP4_PACKET = type { [1480 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 }

@.str = external hidden unnamed_addr constant [157 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [43 x i8], align 1
@mZeroIp4Addr = external global %struct.EFI_IPv4_ADDRESS, 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 ptr @CopyMem(ptr noundef, ptr noundef, i64 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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @PxeBcParseCachedDhcpPacket(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local zeroext range(i8 0, 2) i8 @PxeBcTryBinl(ptr noundef %0, i32 noundef %1) local_unnamed_addr #2 {
  %3 = alloca %union.EFI_IP_ADDRESS, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #3
  %4 = tail call zeroext i8 @DebugAssertEnabled() #3
  %5 = icmp eq i8 %4, 0
  %6 = icmp ult i32 %1, 16
  %or.cond = or i1 %6, %5
  br i1 %or.cond, label %8, label %7

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

8:                                                ; preds = %2, %7
  %9 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %9, 0
  br i1 %.not, label %._crit_edge, label %10

._crit_edge:                                      ; preds = %8
  %.pre = zext i32 %1 to i64
  br label %17

10:                                               ; preds = %8
  %11 = getelementptr inbounds i8, ptr %0, i64 16496
  %12 = zext i32 %1 to i64
  %13 = getelementptr inbounds [16 x %struct.PXEBC_CACHED_DHCP4_PACKET], ptr %11, i64 0, i64 %12, i32 2
  %14 = load i8, ptr %13, align 1, !tbaa !5
  %15 = icmp eq i8 %14, 2
  br i1 %15, label %17, label %16

16:                                               ; preds = %10
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 306, ptr noundef nonnull @.str.6) #3
  br label %17

17:                                               ; preds = %._crit_edge, %10, %16
  %.pre-phi = phi i64 [ %.pre, %._crit_edge ], [ %12, %10 ], [ %12, %16 ]
  %18 = getelementptr inbounds i8, ptr %0, i64 16496
  %19 = getelementptr inbounds [16 x %struct.PXEBC_CACHED_DHCP4_PACKET], ptr %18, i64 0, i64 %.pre-phi
  %20 = getelementptr inbounds i8, ptr %19, i64 28
  %21 = tail call i64 @CompareMem(ptr noundef nonnull %20, ptr noundef nonnull @mZeroIp4Addr, i64 noundef 4) #3
  %22 = icmp eq i64 %21, 0
  br i1 %22, label %23, label %27

23:                                               ; preds = %17
  %24 = getelementptr inbounds i8, ptr %19, i64 1520
  %25 = load ptr, ptr %24, align 8, !tbaa !13
  %26 = getelementptr inbounds i8, ptr %25, i64 2
  br label %27

27:                                               ; preds = %17, %23
  %.sink = phi ptr [ %26, %23 ], [ %20, %17 ]
  %28 = call ptr @CopyMem(ptr noundef nonnull %3, ptr noundef nonnull %.sink, i64 noundef 4) #3
  %29 = load i32, ptr %3, align 4, !tbaa !14
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %54, label %31

31:                                               ; preds = %27
  %32 = getelementptr inbounds i8, ptr %0, i64 11480
  %33 = call i64 @PxeBcDiscvBootService(ptr noundef %0, i16 noundef zeroext 0, ptr noundef null, i8 noundef zeroext 0, ptr noundef nonnull %3, i16 noundef zeroext 0, ptr noundef null, i8 noundef zeroext 0, ptr noundef nonnull %32)
  %34 = icmp slt i64 %33, 0
  br i1 %34, label %54, label %35

35:                                               ; preds = %31
  %36 = call zeroext i8 @PxeBcParseCachedDhcpPacket(ptr noundef nonnull %32)
  %.not22 = icmp eq i8 %36, 0
  br i1 %.not22, label %54, label %37

37:                                               ; preds = %35
  %38 = getelementptr inbounds i8, ptr %0, i64 12961
  %39 = load i8, ptr %38, align 1, !tbaa !5
  %.not23 = icmp eq i8 %39, 0
  br i1 %.not23, label %44, label %40

40:                                               ; preds = %37
  %41 = getelementptr inbounds i8, ptr %0, i64 13016
  %42 = load ptr, ptr %41, align 8, !tbaa !13
  %43 = icmp eq ptr %42, null
  br i1 %43, label %54, label %44

44:                                               ; preds = %40, %37
  %45 = getelementptr inbounds i8, ptr %0, i64 184
  %46 = load ptr, ptr %45, align 8, !tbaa !15
  %47 = getelementptr inbounds i8, ptr %46, i64 10
  store i8 1, ptr %47, align 2, !tbaa !32
  %48 = getelementptr inbounds i8, ptr %46, i64 2996
  %49 = getelementptr inbounds i8, ptr %0, i64 11488
  %50 = getelementptr inbounds i8, ptr %0, i64 11484
  %51 = load i32, ptr %50, align 1, !tbaa !33
  %52 = zext i32 %51 to i64
  %53 = call ptr @CopyMem(ptr noundef nonnull %48, ptr noundef nonnull %49, i64 noundef %52) #3
  br label %54

54:                                               ; preds = %40, %35, %31, %27, %44
  %.0 = phi i8 [ 1, %44 ], [ 0, %27 ], [ 0, %31 ], [ 0, %35 ], [ 0, %40 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #3
  ret i8 %.0
}

; Function Attrs: nounwind uwtable
declare dso_local i64 @PxeBcDiscvBootService(ptr noundef, i16 noundef zeroext, ptr noundef, i8 noundef zeroext, ptr noundef, i16 noundef zeroext, ptr noundef, i8 noundef zeroext, ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 1481}
!6 = !{!"", !7, i64 0, !7, i64 1480, !7, i64 1481, !7, i64 1488, !9, i64 1544}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"", !7, i64 0, !10, i64 32, !11, i64 36, !11, i64 38, !7, i64 40, !7, i64 41, !7, i64 42, !10, i64 43, !10, i64 47, !11, i64 52, !11, i64 54, !11, i64 56, !11, i64 58, !12, i64 64, !7, i64 72, !12, i64 80, !7, i64 88, !12, i64 96, !7, i64 104, !12, i64 112, !7, i64 120}
!10 = !{!"", !7, i64 0}
!11 = !{!"short", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !12, i64 184}
!16 = !{!"_PXEBC_PRIVATE_DATA", !17, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !18, i64 80, !20, i64 192, !21, i64 200, !12, i64 216, !12, i64 224, !12, i64 232, !12, i64 240, !22, i64 248, !12, i64 280, !12, i64 288, !12, i64 296, !11, i64 304, !23, i64 308, !24, i64 344, !17, i64 10768, !12, i64 10776, !7, i64 10784, !7, i64 10800, !7, i64 10816, !7, i64 10832, !7, i64 10848, !17, i64 10852, !19, i64 10856, !19, i64 10864, !7, i64 10872, !28, i64 11184, !10, i64 11433, !7, i64 11465, !7, i64 11466, !7, i64 11467, !17, i64 11468, !17, i64 11472, !17, i64 11476, !6, i64 11480, !6, i64 13152, !6, i64 14824, !7, i64 16496, !7, i64 43248, !7, i64 43268, !17, i64 43588, !7, i64 43592, !7, i64 43612, !12, i64 43680, !31, i64 43688}
!17 = !{!"int", !7, i64 0}
!18 = !{!"_EFI_PXE_BASE_CODE_PROTOCOL", !19, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104}
!19 = !{!"long long", !7, i64 0}
!20 = !{!"_EFI_LOAD_FILE_PROTOCOL", !12, i64 0}
!21 = !{!"_EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL", !19, i64 0, !12, i64 8}
!22 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !10, i64 6, !10, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !17, i64 20, !17, i64 24}
!23 = !{!"", !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, !10, i64 17, !10, i64 21, !11, i64 26, !10, i64 28, !11, i64 32}
!24 = !{!"", !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, !25, i64 8884, !17, i64 9016, !7, i64 9020, !17, i64 9404, !7, i64 9408, !26, i64 9792, !27, i64 10296}
!25 = !{!"", !7, i64 0, !7, i64 1, !11, i64 2, !7, i64 4}
!26 = !{!"", !7, i64 0, !7, i64 1, !11, i64 2, !7, i64 4, !7, i64 8}
!27 = !{!"", !7, i64 0, !7, i64 1}
!28 = !{!"", !17, i64 0, !17, i64 4, !29, i64 8}
!29 = !{!"", !30, i64 0, !17, i64 236, !7, i64 240}
!30 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !17, i64 4, !11, i64 8, !11, i64 10, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !7, i64 28, !7, i64 44, !7, i64 108}
!31 = !{!"", !12, i64 0, !19, i64 8, !7, i64 16}
!32 = !{!24, !7, i64 10}
!33 = !{!28, !17, i64 4}


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