; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/NetworkPkg/IScsiDxe (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._ISCSI_ATTEMPT_CONFIG_NVDATA = type <{ %struct._LIST_ENTRY, i8, i8, i8, i8, i8, i8, i16, i16, [96 x i8], [96 x i8], %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %struct._ISCSI_SESSION_CONFIG_NVDATA, i8, %union.anon }>
%struct._LIST_ENTRY = type { ptr, ptr }
%union.EFI_IP_ADDRESS = type { [4 x i32] }
%struct._ISCSI_SESSION_CONFIG_NVDATA = type <{ i16, i8, i8, %union.EFI_IP_ADDRESS, %struct.EFI_IPv4_ADDRESS, %union.EFI_IP_ADDRESS, i8, i8, [224 x i8], %union.EFI_IP_ADDRESS, i8, [8 x i8], i16, i8, [6 x i8] }>
%union.anon = type { %struct._ISCSI_CHAP_AUTH_CONFIG_NVDATA }
%struct._ISCSI_CHAP_AUTH_CONFIG_NVDATA = type { i8, [127 x i8], [17 x i8], [127 x i8], [17 x i8] }
%struct.EFI_DHCP4_PACKET_OPTION = type { i8, i8, [1 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 ptr, align 8
  %14 = alloca i8, align 1
  %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 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 1, 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 %14, align 1, !tbaa !9
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = call i64 @NetLibDetectMedia(ptr noundef %16, ptr noundef %14)
  %18 = load i8, ptr %14, 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 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._ISCSI_ATTEMPT_CONFIG_NVDATA, ptr %41, i32 0, i32 14
  store ptr %42, ptr %13, align 8, !tbaa !5
  %43 = call ptr @AllocatePool(i64 noundef 6)
  store ptr %43, ptr %11, align 8, !tbaa !5
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  %45 = icmp eq ptr %44, null
  br i1 %45, label %46, label %47

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

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

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

83:                                               ; preds = %79, %47
  %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 !28
  %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 !30
  %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, %46, %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 !31
  %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 !28
  %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 !32
  %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 1, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, 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 41}
!19 = !{!"_ISCSI_SESSION_CONFIG_NVDATA", !20, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !21, i64 20, !7, i64 24, !7, i64 40, !7, i64 41, !7, i64 42, !7, i64 266, !7, i64 282, !7, i64 283, !20, i64 291, !7, i64 293, !7, i64 294}
!20 = !{!"short", !7, i64 0}
!21 = !{!"", !7, i64 0}
!22 = !{!17, !7, i64 1}
!23 = !{!24, !15, i64 56}
!24 = !{!"", !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}
!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 = !{!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 307
  %26 = load i8, ptr %25, align 1, !tbaa !17
  %.not28 = icmp eq i8 %26, 0
  %27 = select i1 %.not28, i8 3, i8 4
  %28 = getelementptr inbounds i8, ptr %22, i64 1
  store i8 %27, ptr %28, align 1, !tbaa !21
  %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 !22
  %32 = getelementptr inbounds i8, ptr %7, i64 64
  store ptr %6, ptr %32, align 8, !tbaa !24
  %33 = load i8, ptr %25, align 1, !tbaa !17
  %.not29 = icmp eq i8 %33, 0
  br i1 %.not29, label %37, label %34

34:                                               ; preds = %24
  %35 = getelementptr inbounds i8, ptr %7, i64 40
  store ptr @IScsiDhcpSelectOffer, ptr %35, align 8, !tbaa !25
  %36 = getelementptr inbounds i8, ptr %7, i64 48
  store ptr %2, ptr %36, align 8, !tbaa !26
  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 !27
  %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 !29
  %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
  %.020.ph = phi i64 [ %51, %49 ], [ %47, %43 ], [ %41, %37 ], [ %19, %14 ]
  %.pr = load ptr, ptr %6, align 8, !tbaa !5
  %.not30 = icmp eq ptr %.pr, null
  br i1 %.not30, label %.thread, label %53

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

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

55:                                               ; preds = %.thread
  %56 = getelementptr inbounds i8, ptr %54, i64 40
  %57 = load ptr, ptr %56, align 8, !tbaa !30
  %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 !27
  %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 !31
  %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 [ %.02034, %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 41}
!18 = !{!"_ISCSI_SESSION_CONFIG_NVDATA", !19, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !20, i64 20, !7, i64 24, !7, i64 40, !7, i64 41, !7, i64 42, !7, i64 266, !7, i64 282, !7, i64 283, !19, i64 291, !7, i64 293, !7, i64 294}
!19 = !{!"short", !7, i64 0}
!20 = !{!"", !7, i64 0}
!21 = !{!16, !7, i64 1}
!22 = !{!23, !14, i64 56}
!23 = !{!"", !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}
!24 = !{!23, !6, i64 64}
!25 = !{!23, !6, i64 40}
!26 = !{!23, !6, i64 48}
!27 = !{!28, !6, i64 8}
!28 = !{!"_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}
!29 = !{!28, !6, i64 16}
!30 = !{!28, !6, i64 40}
!31 = !{!11, !6, i64 288}


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