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

; 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.GUID = type { i32, i16, i16, [8 x i8] }
%struct.EFI_DHCP4_CONFIG_DATA = type { i32, ptr, i32, ptr, %struct.EFI_IPv4_ADDRESS, ptr, ptr, i32, ptr }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.EFI_BOOT_SERVICES = type { %struct.EFI_TABLE_HEADER, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, i32, i32 }
%struct.EFI_DHCP4_PACKET_OPTION = type { i8, i8, [1 x i8] }
%struct._ISCSI_SESSION_CONFIG_DATA = type { %struct.ISCSI_SESSION_CONFIG_NVDATA, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS }
%struct.ISCSI_SESSION_CONFIG_NVDATA = type <{ i8, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i8, [224 x i8], %struct.EFI_IPv4_ADDRESS, i16, [8 x i8], [6 x i8] }>
%struct._EFI_DHCP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@gEfiDhcp4ServiceBindingProtocolGuid = external global %struct.GUID, align 4
@gBS = external global ptr, align 8
@gEfiDhcp4ProtocolGuid = external global %struct.GUID, align 4

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

declare ptr @AllocatePool(i64 noundef) #1

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

declare void @FreePool(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @IScsiDhcpSelectOffer(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @IScsiParseDhcpAck(ptr noundef, ptr noundef) #2

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

20:                                               ; preds = %3
  store i64 -9223372036854775796, ptr %4, align 8
  store i32 1, ptr %15, align 4
  br label %137

21:                                               ; preds = %3
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = call i64 @NetLibCreateServiceChild(ptr noundef %22, ptr noundef %23, ptr noundef @gEfiDhcp4ServiceBindingProtocolGuid, ptr noundef %8)
  store i64 %24, ptr %10, align 8, !tbaa !10
  %25 = load i64, ptr %10, align 8, !tbaa !10
  %26 = icmp slt i64 %25, 0
  br i1 %26, label %27, label %29

27:                                               ; preds = %21
  %28 = load i64, ptr %10, align 8, !tbaa !10
  store i64 %28, ptr %4, align 8
  store i32 1, ptr %15, align 4
  br label %137

29:                                               ; preds = %21
  %30 = load ptr, ptr @gBS, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %30, i32 0, i32 33
  %32 = load ptr, ptr %31, align 8, !tbaa !12
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = call i64 %32(ptr noundef %33, ptr noundef @gEfiDhcp4ProtocolGuid, ptr noundef %9, ptr noundef %34, ptr noundef %35, i32 noundef 16)
  store i64 %36, ptr %10, align 8, !tbaa !10
  %37 = load i64, ptr %10, align 8, !tbaa !10
  %38 = icmp slt i64 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %29
  br label %105

40:                                               ; preds = %29
  %41 = call ptr @AllocatePool(i64 noundef 6)
  store ptr %41, ptr %11, align 8, !tbaa !5
  %42 = load ptr, ptr %11, align 8, !tbaa !5
  %43 = icmp eq ptr %42, null
  br i1 %43, label %44, label %45

44:                                               ; preds = %40
  store i64 -9223372036854775799, ptr %10, align 8, !tbaa !10
  br label %105

45:                                               ; preds = %40
  %46 = load ptr, ptr %11, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.EFI_DHCP4_PACKET_OPTION, ptr %46, i32 0, i32 0
  store i8 55, ptr %47, align 1, !tbaa !16
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._ISCSI_SESSION_CONFIG_DATA, ptr %48, i32 0, i32 0
  %50 = getelementptr inbounds %struct.ISCSI_SESSION_CONFIG_NVDATA, ptr %49, i32 0, i32 5
  %51 = load i8, ptr %50, align 1, !tbaa !18
  %52 = zext i8 %51 to i32
  %53 = icmp ne i32 %52, 0
  %54 = zext i1 %53 to i64
  %55 = select i1 %53, i32 4, i32 3
  %56 = trunc i32 %55 to i8
  %57 = load ptr, ptr %11, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.EFI_DHCP4_PACKET_OPTION, ptr %57, i32 0, i32 1
  store i8 %56, ptr %58, align 1, !tbaa !23
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.EFI_DHCP4_PACKET_OPTION, ptr %59, i32 0, i32 2
  %61 = getelementptr inbounds [1 x i8], ptr %60, i64 0, i64 0
  store ptr %61, ptr %14, align 8, !tbaa !5
  %62 = load ptr, ptr %14, align 8, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %62, i64 0
  store i8 1, ptr %63, align 1, !tbaa !9
  %64 = load ptr, ptr %14, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %64, i64 1
  store i8 3, ptr %65, align 1, !tbaa !9
  %66 = load ptr, ptr %14, align 8, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %66, i64 2
  store i8 6, ptr %67, align 1, !tbaa !9
  %68 = load ptr, ptr %14, align 8, !tbaa !5
  %69 = getelementptr inbounds i8, ptr %68, i64 3
  store i8 17, ptr %69, align 1, !tbaa !9
  %70 = call ptr @ZeroMem(ptr noundef %12, i64 noundef 72)
  %71 = getelementptr inbounds %struct.EFI_DHCP4_CONFIG_DATA, ptr %12, i32 0, i32 7
  store i32 1, ptr %71, align 8, !tbaa !24
  %72 = getelementptr inbounds %struct.EFI_DHCP4_CONFIG_DATA, ptr %12, i32 0, i32 8
  store ptr %11, ptr %72, align 8, !tbaa !26
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._ISCSI_SESSION_CONFIG_DATA, ptr %73, i32 0, i32 0
  %75 = getelementptr inbounds %struct.ISCSI_SESSION_CONFIG_NVDATA, ptr %74, i32 0, i32 5
  %76 = load i8, ptr %75, align 1, !tbaa !18
  %77 = icmp ne i8 %76, 0
  br i1 %77, label %78, label %83

78:                                               ; preds = %45
  %79 = getelementptr inbounds %struct.EFI_DHCP4_CONFIG_DATA, ptr %12, i32 0, i32 5
  store ptr @IScsiDhcpSelectOffer, ptr %79, align 8, !tbaa !27
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct._ISCSI_SESSION_CONFIG_DATA, ptr %80, i32 0, i32 0
  %82 = getelementptr inbounds %struct.EFI_DHCP4_CONFIG_DATA, ptr %12, i32 0, i32 6
  store ptr %81, ptr %82, align 8, !tbaa !28
  br label %83

83:                                               ; preds = %78, %45
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._EFI_DHCP4_PROTOCOL, ptr %84, i32 0, i32 1
  %86 = load ptr, ptr %85, align 8, !tbaa !29
  %87 = load ptr, ptr %9, align 8, !tbaa !5
  %88 = call i64 %86(ptr noundef %87, ptr noundef %12)
  store i64 %88, ptr %10, align 8, !tbaa !10
  %89 = load i64, ptr %10, align 8, !tbaa !10
  %90 = icmp slt i64 %89, 0
  br i1 %90, label %91, label %92

91:                                               ; preds = %83
  br label %105

92:                                               ; preds = %83
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct._EFI_DHCP4_PROTOCOL, ptr %93, i32 0, i32 2
  %95 = load ptr, ptr %94, align 8, !tbaa !31
  %96 = load ptr, ptr %9, align 8, !tbaa !5
  %97 = call i64 %95(ptr noundef %96, ptr noundef null)
  store i64 %97, ptr %10, align 8, !tbaa !10
  %98 = load i64, ptr %10, align 8, !tbaa !10
  %99 = icmp slt i64 %98, 0
  br i1 %99, label %100, label %101

100:                                              ; preds = %92
  br label %105

101:                                              ; preds = %92
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = call i64 @IScsiParseDhcpAck(ptr noundef %102, ptr noundef %103)
  store i64 %104, ptr %10, align 8, !tbaa !10
  br label %105

105:                                              ; preds = %101, %100, %91, %44, %39
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = icmp ne ptr %106, null
  br i1 %107, label %108, label %110

108:                                              ; preds = %105
  %109 = load ptr, ptr %11, align 8, !tbaa !5
  call void @FreePool(ptr noundef %109)
  br label %110

110:                                              ; preds = %108, %105
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = icmp ne ptr %111, null
  br i1 %112, label %113, label %131

113:                                              ; preds = %110
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._EFI_DHCP4_PROTOCOL, ptr %114, i32 0, i32 5
  %116 = load ptr, ptr %115, align 8, !tbaa !32
  %117 = load ptr, ptr %9, align 8, !tbaa !5
  %118 = call i64 %116(ptr noundef %117)
  %119 = load ptr, ptr %9, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct._EFI_DHCP4_PROTOCOL, ptr %119, i32 0, i32 1
  %121 = load ptr, ptr %120, align 8, !tbaa !29
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = call i64 %121(ptr noundef %122, ptr noundef null)
  %124 = load ptr, ptr @gBS, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %124, i32 0, i32 34
  %126 = load ptr, ptr %125, align 8, !tbaa !33
  %127 = load ptr, ptr %8, align 8, !tbaa !5
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = load ptr, ptr %6, align 8, !tbaa !5
  %130 = call i64 %126(ptr noundef %127, ptr noundef @gEfiDhcp4ProtocolGuid, ptr noundef %128, ptr noundef %129)
  br label %131

131:                                              ; preds = %113, %110
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = load ptr, ptr %8, align 8, !tbaa !5
  %135 = call i64 @NetLibDestroyServiceChild(ptr noundef %132, ptr noundef %133, ptr noundef @gEfiDhcp4ServiceBindingProtocolGuid, ptr noundef %134)
  %136 = load i64, ptr %10, align 8, !tbaa !10
  store i64 %136, ptr %4, align 8
  store i32 1, ptr %15, align 4
  br label %137

137:                                              ; preds = %131, %27, %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 72, 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
  %138 = load i64, ptr %4, align 8
  ret i64 %138
}

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"long long", !7, i64 0}
!12 = !{!13, !6, i64 280}
!13 = !{!"", !14, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368}
!14 = !{!"", !11, i64 0, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20}
!15 = !{!"int", !7, i64 0}
!16 = !{!17, !7, i64 0}
!17 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2}
!18 = !{!19, !7, i64 14}
!19 = !{!"_ISCSI_SESSION_CONFIG_DATA", !20, i64 0, !21, i64 259, !21, i64 263, !21, i64 267}
!20 = !{!"", !7, i64 0, !7, i64 1, !21, i64 2, !21, i64 6, !21, i64 10, !7, i64 14, !7, i64 15, !21, i64 239, !22, i64 243, !7, i64 245, !7, i64 253}
!21 = !{!"", !7, i64 0}
!22 = !{!"short", !7, i64 0}
!23 = !{!17, !7, i64 1}
!24 = !{!25, !15, i64 56}
!25 = !{!"", !15, i64 0, !6, i64 8, !15, i64 16, !6, i64 24, !21, i64 32, !6, i64 40, !6, i64 48, !15, i64 56, !6, i64 64}
!26 = !{!25, !6, i64 64}
!27 = !{!25, !6, i64 40}
!28 = !{!25, !6, i64 48}
!29 = !{!30, !6, i64 8}
!30 = !{!"_EFI_DHCP4_PROTOCOL", !6, 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}
!31 = !{!30, !6, i64 16}
!32 = !{!30, !6, i64 40}
!33 = !{!13, !6, i64 288}


; 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.GUID = type { i32, i16, i16, [8 x i8] }
%struct.EFI_DHCP4_CONFIG_DATA = type { i32, ptr, i32, ptr, %struct.EFI_IPv4_ADDRESS, ptr, ptr, i32, ptr }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }

@gEfiDhcp4ServiceBindingProtocolGuid = external global %struct.GUID, align 4
@gBS = external local_unnamed_addr global ptr, align 8
@gEfiDhcp4ProtocolGuid = external global %struct.GUID, align 4

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

declare ptr @AllocatePool(i64 noundef) local_unnamed_addr #1

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

declare void @FreePool(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @IScsiDhcpSelectOffer(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @IScsiParseDhcpAck(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i64 @IScsiDoDhcp(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.EFI_DHCP4_CONFIG_DATA, align 8
  %8 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 8, 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
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #3
  store ptr null, ptr %4, align 8, !tbaa !5
  store ptr null, ptr %5, align 8, !tbaa !5
  store ptr null, ptr %6, align 8, !tbaa !5
  store i8 1, ptr %8, align 1, !tbaa !9
  %9 = call i64 @NetLibDetectMedia(ptr noundef %1, ptr noundef nonnull %8) #3
  %10 = load i8, ptr %8, align 1, !tbaa !9
  %.not = icmp eq i8 %10, 0
  br i1 %.not, label %71, label %11

11:                                               ; preds = %3
  %12 = call i64 @NetLibCreateServiceChild(ptr noundef %1, ptr noundef %0, ptr noundef nonnull @gEfiDhcp4ServiceBindingProtocolGuid, ptr noundef nonnull %4) #3
  %13 = icmp slt i64 %12, 0
  br i1 %13, label %71, label %14

14:                                               ; preds = %11
  %15 = load ptr, ptr @gBS, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i64 280
  %17 = load ptr, ptr %16, align 8, !tbaa !10
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = call i64 %17(ptr noundef %18, ptr noundef nonnull @gEfiDhcp4ProtocolGuid, ptr noundef nonnull %5, ptr noundef %0, ptr noundef %1, i32 noundef 16) #3
  %20 = icmp slt i64 %19, 0
  br i1 %20, label %52, label %21

21:                                               ; preds = %14
  %22 = call ptr @AllocatePool(i64 noundef 6) #3
  store ptr %22, ptr %6, align 8, !tbaa !5
  %23 = icmp eq ptr %22, null
  br i1 %23, label %.thread, label %24

24:                                               ; preds = %21
  store i8 55, ptr %22, align 1, !tbaa !15
  %25 = getelementptr inbounds i8, ptr %2, i64 14
  %26 = load i8, ptr %25, align 1, !tbaa !17
  %.not31 = icmp eq i8 %26, 0
  %27 = select i1 %.not31, i8 3, i8 4
  %28 = getelementptr inbounds i8, ptr %22, i64 1
  store i8 %27, ptr %28, align 1, !tbaa !22
  %29 = getelementptr inbounds i8, ptr %22, i64 2
  store <4 x i8> <i8 1, i8 3, i8 6, i8 17>, ptr %29, align 1, !tbaa !9
  %30 = call ptr @ZeroMem(ptr noundef nonnull %7, i64 noundef 72) #3
  %31 = getelementptr inbounds i8, ptr %7, i64 56
  store i32 1, ptr %31, align 8, !tbaa !23
  %32 = getelementptr inbounds i8, ptr %7, i64 64
  store ptr %6, ptr %32, align 8, !tbaa !25
  %33 = load i8, ptr %25, align 1, !tbaa !17
  %.not32 = icmp eq i8 %33, 0
  br i1 %.not32, label %37, label %34

34:                                               ; preds = %24
  %35 = getelementptr inbounds i8, ptr %7, i64 40
  store ptr @IScsiDhcpSelectOffer, ptr %35, align 8, !tbaa !26
  %36 = getelementptr inbounds i8, ptr %7, i64 48
  store ptr %2, ptr %36, align 8, !tbaa !27
  br label %37

37:                                               ; preds = %34, %24
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %38, i64 8
  %40 = load ptr, ptr %39, align 8, !tbaa !28
  %41 = call i64 %40(ptr noundef %38, ptr noundef nonnull %7) #3
  %42 = icmp slt i64 %41, 0
  br i1 %42, label %52, label %43

43:                                               ; preds = %37
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %44, i64 16
  %46 = load ptr, ptr %45, align 8, !tbaa !30
  %47 = call i64 %46(ptr noundef %44, ptr noundef null) #3
  %48 = icmp slt i64 %47, 0
  br i1 %48, label %52, label %49

49:                                               ; preds = %43
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = call i64 @IScsiParseDhcpAck(ptr noundef %50, ptr noundef nonnull %2)
  br label %52

52:                                               ; preds = %43, %37, %14, %49
  %.023.ph = phi i64 [ %51, %49 ], [ %47, %43 ], [ %41, %37 ], [ %19, %14 ]
  %.pr = load ptr, ptr %6, align 8, !tbaa !5
  %.not33 = icmp eq ptr %.pr, null
  br i1 %.not33, label %.thread, label %53

53:                                               ; preds = %52
  call void @FreePool(ptr noundef nonnull %.pr) #3
  br label %.thread

.thread:                                          ; preds = %21, %53, %52
  %.02337 = phi i64 [ %.023.ph, %53 ], [ %.023.ph, %52 ], [ -9223372036854775799, %21 ]
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %.not34 = icmp eq ptr %54, null
  br i1 %.not34, label %68, label %55

55:                                               ; preds = %.thread
  %56 = getelementptr inbounds i8, ptr %54, i64 40
  %57 = load ptr, ptr %56, align 8, !tbaa !31
  %58 = call i64 %57(ptr noundef nonnull %54) #3
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %59, i64 8
  %61 = load ptr, ptr %60, align 8, !tbaa !28
  %62 = call i64 %61(ptr noundef %59, ptr noundef null) #3
  %63 = load ptr, ptr @gBS, align 8, !tbaa !5
  %64 = getelementptr inbounds i8, ptr %63, i64 288
  %65 = load ptr, ptr %64, align 8, !tbaa !32
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = call i64 %65(ptr noundef %66, ptr noundef nonnull @gEfiDhcp4ProtocolGuid, ptr noundef %0, ptr noundef %1) #3
  br label %68

68:                                               ; preds = %55, %.thread
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = call i64 @NetLibDestroyServiceChild(ptr noundef %1, ptr noundef %0, ptr noundef nonnull @gEfiDhcp4ServiceBindingProtocolGuid, ptr noundef %69) #3
  br label %71

71:                                               ; preds = %11, %3, %68
  %.0 = phi i64 [ %.02337, %68 ], [ -9223372036854775796, %3 ], [ %12, %11 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %7) #3
  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 8, ptr nonnull %4) #3
  ret i64 %.0
}

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 280}
!11 = !{!"", !12, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368}
!12 = !{!"", !13, i64 0, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !7, i64 0}
!16 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2}
!17 = !{!18, !7, i64 14}
!18 = !{!"_ISCSI_SESSION_CONFIG_DATA", !19, i64 0, !20, i64 259, !20, i64 263, !20, i64 267}
!19 = !{!"", !7, i64 0, !7, i64 1, !20, i64 2, !20, i64 6, !20, i64 10, !7, i64 14, !7, i64 15, !20, i64 239, !21, i64 243, !7, i64 245, !7, i64 253}
!20 = !{!"", !7, i64 0}
!21 = !{!"short", !7, i64 0}
!22 = !{!16, !7, i64 1}
!23 = !{!24, !14, i64 56}
!24 = !{!"", !14, i64 0, !6, i64 8, !14, i64 16, !6, i64 24, !20, i64 32, !6, i64 40, !6, i64 48, !14, i64 56, !6, i64 64}
!25 = !{!24, !6, i64 64}
!26 = !{!24, !6, i64 40}
!27 = !{!24, !6, i64 48}
!28 = !{!29, !6, i64 8}
!29 = !{!"_EFI_DHCP4_PROTOCOL", !6, 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}
!30 = !{!29, !6, i64 16}
!31 = !{!29, !6, i64 40}
!32 = !{!11, !6, i64 288}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass