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

; 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_DHCP6_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_DHCP6_PACKET_OPTION = type <{ i16, i16, [1 x i8] }>
%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] }>
%struct.EFI_IPv4_ADDRESS = type { [4 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] }

; Function Attrs: nounwind uwtable
declare dso_local i64 @IScsiDhcp6ExtractRootPath(ptr noundef, i16 noundef zeroext, ptr noundef) #0

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

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) #2

declare void @FreePool(ptr noundef) #2

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

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

24:                                               ; preds = %3
  store i64 -9223372036854775802, ptr %4, align 8
  store i32 1, ptr %15, align 4
  br label %226

25:                                               ; preds = %3
  %26 = load i32, ptr %10, align 4, !tbaa !9
  %27 = zext i32 %26 to i64
  %28 = mul i64 %27, 8
  %29 = call ptr @AllocateZeroPool(i64 noundef %28)
  store ptr %29, ptr %12, align 8, !tbaa !5
  %30 = load ptr, ptr %12, align 8, !tbaa !5
  %31 = icmp eq ptr %30, null
  br i1 %31, label %32, label %33

32:                                               ; preds = %25
  store i64 -9223372036854775802, ptr %4, align 8
  store i32 1, ptr %15, align 4
  br label %226

33:                                               ; preds = %25
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._EFI_DHCP6_PROTOCOL, ptr %34, i32 0, i32 8
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = load ptr, ptr %12, align 8, !tbaa !5
  %40 = call i64 %36(ptr noundef %37, ptr noundef %38, ptr noundef %10, ptr noundef %39)
  store i64 %40, ptr %8, align 8, !tbaa !13
  %41 = load i64, ptr %8, align 8, !tbaa !13
  %42 = icmp slt i64 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %33
  store i64 -9223372036854775802, ptr %8, align 8, !tbaa !13
  br label %223

44:                                               ; preds = %33
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %45, ptr %13, align 8, !tbaa !5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %207, %44
  %47 = load i32, ptr %9, align 4, !tbaa !9
  %48 = load i32, ptr %10, align 4, !tbaa !9
  %49 = icmp ult i32 %47, %48
  br i1 %49, label %50, label %210

50:                                               ; preds = %46
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = load i32, ptr %9, align 4, !tbaa !9
  %53 = zext i32 %52 to i64
  %54 = getelementptr inbounds ptr, ptr %51, i64 %53
  %55 = load ptr, ptr %54, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %55, i32 0, i32 0
  %57 = load i16, ptr %56, align 1, !tbaa !15
  %58 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %57)
  %59 = load ptr, ptr %12, align 8, !tbaa !5
  %60 = load i32, ptr %9, align 4, !tbaa !9
  %61 = zext i32 %60 to i64
  %62 = getelementptr inbounds ptr, ptr %59, i64 %61
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %63, i32 0, i32 0
  store i16 %58, ptr %64, align 1, !tbaa !15
  %65 = load ptr, ptr %12, align 8, !tbaa !5
  %66 = load i32, ptr %9, align 4, !tbaa !9
  %67 = zext i32 %66 to i64
  %68 = getelementptr inbounds ptr, ptr %65, i64 %67
  %69 = load ptr, ptr %68, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %69, i32 0, i32 1
  %71 = load i16, ptr %70, align 1, !tbaa !18
  %72 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %71)
  %73 = load ptr, ptr %12, align 8, !tbaa !5
  %74 = load i32, ptr %9, align 4, !tbaa !9
  %75 = zext i32 %74 to i64
  %76 = getelementptr inbounds ptr, ptr %73, i64 %75
  %77 = load ptr, ptr %76, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %77, i32 0, i32 1
  store i16 %72, ptr %78, align 1, !tbaa !18
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  %80 = load i32, ptr %9, align 4, !tbaa !9
  %81 = zext i32 %80 to i64
  %82 = getelementptr inbounds ptr, ptr %79, i64 %81
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %83, i32 0, i32 0
  %85 = load i16, ptr %84, align 1, !tbaa !15
  %86 = zext i16 %85 to i32
  %87 = icmp eq i32 %86, 23
  br i1 %87, label %88, label %142

88:                                               ; preds = %50
  %89 = load ptr, ptr %12, align 8, !tbaa !5
  %90 = load i32, ptr %9, align 4, !tbaa !9
  %91 = zext i32 %90 to i64
  %92 = getelementptr inbounds ptr, ptr %89, i64 %91
  %93 = load ptr, ptr %92, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %93, i32 0, i32 1
  %95 = load i16, ptr %94, align 1, !tbaa !18
  %96 = zext i16 %95 to i32
  %97 = and i32 %96, 15
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %109, label %99

99:                                               ; preds = %88
  %100 = load ptr, ptr %12, align 8, !tbaa !5
  %101 = load i32, ptr %9, align 4, !tbaa !9
  %102 = zext i32 %101 to i64
  %103 = getelementptr inbounds ptr, ptr %100, i64 %102
  %104 = load ptr, ptr %103, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %104, i32 0, i32 1
  %106 = load i16, ptr %105, align 1, !tbaa !18
  %107 = zext i16 %106 to i32
  %108 = icmp eq i32 %107, 0
  br i1 %108, label %109, label %110

109:                                              ; preds = %99, %88
  store i64 -9223372036854775805, ptr %8, align 8, !tbaa !13
  br label %223

110:                                              ; preds = %99
  %111 = load ptr, ptr %13, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._ISCSI_ATTEMPT_CONFIG_NVDATA, ptr %111, i32 0, i32 11
  %113 = load ptr, ptr %12, align 8, !tbaa !5
  %114 = load i32, ptr %9, align 4, !tbaa !9
  %115 = zext i32 %114 to i64
  %116 = getelementptr inbounds ptr, ptr %113, i64 %115
  %117 = load ptr, ptr %116, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %117, i32 0, i32 2
  %119 = getelementptr inbounds [1 x i8], ptr %118, i64 0, i64 0
  %120 = call ptr @CopyMem(ptr noundef %112, ptr noundef %119, i64 noundef 16)
  %121 = load ptr, ptr %12, align 8, !tbaa !5
  %122 = load i32, ptr %9, align 4, !tbaa !9
  %123 = zext i32 %122 to i64
  %124 = getelementptr inbounds ptr, ptr %121, i64 %123
  %125 = load ptr, ptr %124, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %125, i32 0, i32 1
  %127 = load i16, ptr %126, align 1, !tbaa !18
  %128 = zext i16 %127 to i32
  %129 = icmp sgt i32 %128, 16
  br i1 %129, label %130, label %141

130:                                              ; preds = %110
  %131 = load ptr, ptr %13, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct._ISCSI_ATTEMPT_CONFIG_NVDATA, ptr %131, i32 0, i32 12
  %133 = load ptr, ptr %12, align 8, !tbaa !5
  %134 = load i32, ptr %9, align 4, !tbaa !9
  %135 = zext i32 %134 to i64
  %136 = getelementptr inbounds ptr, ptr %133, i64 %135
  %137 = load ptr, ptr %136, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %137, i32 0, i32 2
  %139 = getelementptr inbounds [1 x i8], ptr %138, i64 0, i64 16
  %140 = call ptr @CopyMem(ptr noundef %132, ptr noundef %139, i64 noundef 16)
  br label %141

141:                                              ; preds = %130, %110
  br label %206

142:                                              ; preds = %50
  %143 = load ptr, ptr %12, align 8, !tbaa !5
  %144 = load i32, ptr %9, align 4, !tbaa !9
  %145 = zext i32 %144 to i64
  %146 = getelementptr inbounds ptr, ptr %143, i64 %145
  %147 = load ptr, ptr %146, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %147, i32 0, i32 0
  %149 = load i16, ptr %148, align 1, !tbaa !15
  %150 = zext i16 %149 to i32
  %151 = icmp eq i32 %150, 59
  br i1 %151, label %152, label %158

152:                                              ; preds = %142
  %153 = load ptr, ptr %12, align 8, !tbaa !5
  %154 = load i32, ptr %9, align 4, !tbaa !9
  %155 = zext i32 %154 to i64
  %156 = getelementptr inbounds ptr, ptr %153, i64 %155
  %157 = load ptr, ptr %156, align 8, !tbaa !5
  store ptr %157, ptr %11, align 8, !tbaa !5
  br label %205

158:                                              ; preds = %142
  %159 = load ptr, ptr %12, align 8, !tbaa !5
  %160 = load i32, ptr %9, align 4, !tbaa !9
  %161 = zext i32 %160 to i64
  %162 = getelementptr inbounds ptr, ptr %159, i64 %161
  %163 = load ptr, ptr %162, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %163, i32 0, i32 0
  %165 = load i16, ptr %164, align 1, !tbaa !15
  %166 = zext i16 %165 to i32
  %167 = icmp eq i32 %166, 60
  br i1 %167, label %168, label %204

168:                                              ; preds = %158
  %169 = load ptr, ptr %12, align 8, !tbaa !5
  %170 = load i32, ptr %9, align 4, !tbaa !9
  %171 = zext i32 %170 to i64
  %172 = getelementptr inbounds ptr, ptr %169, i64 %171
  %173 = load ptr, ptr %172, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %173, i32 0, i32 1
  %175 = load i16, ptr %174, align 1, !tbaa !18
  %176 = zext i16 %175 to i32
  %177 = icmp slt i32 %176, 18
  br i1 %177, label %178, label %179

178:                                              ; preds = %168
  store i64 -9223372036854775805, ptr %8, align 8, !tbaa !13
  br label %223

179:                                              ; preds = %168
  %180 = load ptr, ptr %12, align 8, !tbaa !5
  %181 = load i32, ptr %9, align 4, !tbaa !9
  %182 = zext i32 %181 to i64
  %183 = getelementptr inbounds ptr, ptr %180, i64 %182
  %184 = load ptr, ptr %183, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %184, i32 0, i32 2
  %186 = getelementptr inbounds [1 x i8], ptr %185, i64 0, i64 0
  %187 = call ptr @CopyMem(ptr noundef %14, ptr noundef %186, i64 noundef 2)
  %188 = load i16, ptr %14, align 2, !tbaa !19
  %189 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %188)
  %190 = zext i16 %189 to i32
  %191 = icmp ne i32 %190, 16
  br i1 %191, label %192, label %193

192:                                              ; preds = %179
  store i64 -9223372036854775805, ptr %8, align 8, !tbaa !13
  br label %223

193:                                              ; preds = %179
  %194 = load ptr, ptr %13, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct._ISCSI_ATTEMPT_CONFIG_NVDATA, ptr %194, i32 0, i32 13
  %196 = load ptr, ptr %12, align 8, !tbaa !5
  %197 = load i32, ptr %9, align 4, !tbaa !9
  %198 = zext i32 %197 to i64
  %199 = getelementptr inbounds ptr, ptr %196, i64 %198
  %200 = load ptr, ptr %199, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %200, i32 0, i32 2
  %202 = getelementptr inbounds [1 x i8], ptr %201, i64 0, i64 2
  %203 = call ptr @CopyMem(ptr noundef %195, ptr noundef %202, i64 noundef 16)
  br label %204

204:                                              ; preds = %193, %158
  br label %205

205:                                              ; preds = %204, %152
  br label %206

206:                                              ; preds = %205, %141
  br label %207

207:                                              ; preds = %206
  %208 = load i32, ptr %9, align 4, !tbaa !9
  %209 = add i32 %208, 1
  store i32 %209, ptr %9, align 4, !tbaa !9
  br label %46, !llvm.loop !20

210:                                              ; preds = %46
  %211 = load ptr, ptr %11, align 8, !tbaa !5
  %212 = icmp eq ptr %211, null
  br i1 %212, label %213, label %214

213:                                              ; preds = %210
  store i64 -9223372036854775805, ptr %8, align 8, !tbaa !13
  br label %223

214:                                              ; preds = %210
  %215 = load ptr, ptr %11, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %215, i32 0, i32 2
  %217 = getelementptr inbounds [1 x i8], ptr %216, i64 0, i64 0
  %218 = load ptr, ptr %11, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %218, i32 0, i32 1
  %220 = load i16, ptr %219, align 1, !tbaa !18
  %221 = load ptr, ptr %13, align 8, !tbaa !5
  %222 = call i64 @IScsiDhcp6ExtractRootPath(ptr noundef %217, i16 noundef zeroext %220, ptr noundef %221)
  store i64 %222, ptr %8, align 8, !tbaa !13
  br label %223

223:                                              ; preds = %214, %213, %192, %178, %109, %43
  %224 = load ptr, ptr %12, align 8, !tbaa !5
  call void @FreePool(ptr noundef %224)
  %225 = load i64, ptr %8, align 8, !tbaa !13
  store i64 %225, ptr %4, align 8
  store i32 1, ptr %15, align 4
  br label %226

226:                                              ; preds = %223, %32, %24
  call void @llvm.lifetime.end.p0(i64 2, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %227 = load i64, ptr %4, align 8
  ret i64 %227
}

declare ptr @AllocateZeroPool(i64 noundef) #2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 64}
!12 = !{!"_EFI_DHCP6_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}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = !{!16, !17, i64 0}
!16 = !{!"", !17, i64 0, !17, i64 2, !7, i64 4}
!17 = !{!"short", !7, i64 0}
!18 = !{!16, !17, i64 2}
!19 = !{!17, !17, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


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

; Function Attrs: nounwind uwtable
declare dso_local i64 @IScsiDhcp6ExtractRootPath(ptr noundef, i16 noundef zeroext, ptr noundef) local_unnamed_addr #0

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

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

declare void @FreePool(ptr noundef) local_unnamed_addr #2

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

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

9:                                                ; preds = %3
  %10 = load i32, ptr %4, align 4, !tbaa !5
  %11 = zext i32 %10 to i64
  %12 = shl nuw nsw i64 %11, 3
  %13 = call ptr @AllocateZeroPool(i64 noundef %12) #3
  %14 = icmp eq ptr %13, null
  br i1 %14, label %69, label %15

15:                                               ; preds = %9
  %16 = load ptr, ptr %6, align 8, !tbaa !9
  %17 = call i64 %16(ptr noundef nonnull %0, ptr noundef %2, ptr noundef nonnull %4, ptr noundef nonnull %13) #3
  %18 = icmp slt i64 %17, 0
  br i1 %18, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %15
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %.not64 = icmp eq i32 %19, 0
  br i1 %.not64, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %20 = getelementptr inbounds i8, ptr %1, i64 250
  %21 = getelementptr inbounds i8, ptr %1, i64 218
  %22 = getelementptr inbounds i8, ptr %1, i64 234
  br label %23

23:                                               ; preds = %.lr.ph, %59
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %59 ]
  %.05563 = phi ptr [ null, %.lr.ph ], [ %.1, %59 ]
  %24 = getelementptr inbounds ptr, ptr %13, i64 %indvars.iv
  %25 = load ptr, ptr %24, align 8, !tbaa !12
  %26 = load i16, ptr %25, align 1, !tbaa !13
  %27 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %26) #3
  %28 = load ptr, ptr %24, align 8, !tbaa !12
  store i16 %27, ptr %28, align 1, !tbaa !13
  %29 = getelementptr inbounds i8, ptr %28, i64 2
  %30 = load i16, ptr %29, align 1, !tbaa !16
  %31 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %30) #3
  %32 = load ptr, ptr %24, align 8, !tbaa !12
  %33 = getelementptr inbounds i8, ptr %32, i64 2
  store i16 %31, ptr %33, align 1, !tbaa !16
  %34 = load i16, ptr %32, align 1, !tbaa !13
  switch i16 %34, label %.fold.split [
    i16 23, label %35
    i16 59, label %59
    i16 60, label %48
  ]

35:                                               ; preds = %23
  %36 = and i16 %31, 15
  %.not60 = icmp ne i16 %36, 0
  %37 = icmp eq i16 %31, 0
  %or.cond = or i1 %37, %.not60
  br i1 %or.cond, label %.loopexit, label %38

38:                                               ; preds = %35
  %39 = getelementptr inbounds i8, ptr %32, i64 4
  %40 = call ptr @CopyMem(ptr noundef nonnull %21, ptr noundef nonnull %39, i64 noundef 16) #3
  %41 = load ptr, ptr %24, align 8, !tbaa !12
  %42 = getelementptr inbounds i8, ptr %41, i64 2
  %43 = load i16, ptr %42, align 1, !tbaa !16
  %44 = icmp ugt i16 %43, 16
  br i1 %44, label %45, label %59

45:                                               ; preds = %38
  %46 = getelementptr inbounds i8, ptr %41, i64 20
  %47 = call ptr @CopyMem(ptr noundef nonnull %22, ptr noundef nonnull %46, i64 noundef 16) #3
  br label %59

48:                                               ; preds = %23
  %49 = icmp ult i16 %31, 18
  br i1 %49, label %.loopexit, label %50

50:                                               ; preds = %48
  %51 = getelementptr inbounds i8, ptr %32, i64 4
  %52 = call ptr @CopyMem(ptr noundef nonnull %5, ptr noundef nonnull %51, i64 noundef 2) #3
  %53 = load i16, ptr %5, align 2, !tbaa !17
  %54 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %53) #3
  %.not59 = icmp eq i16 %54, 16
  br i1 %.not59, label %55, label %.loopexit

55:                                               ; preds = %50
  %56 = load ptr, ptr %24, align 8, !tbaa !12
  %57 = getelementptr inbounds i8, ptr %56, i64 6
  %58 = call ptr @CopyMem(ptr noundef nonnull %20, ptr noundef nonnull %57, i64 noundef 16) #3
  br label %59

.fold.split:                                      ; preds = %23
  br label %59

59:                                               ; preds = %23, %.fold.split, %45, %38, %55
  %.1 = phi ptr [ %.05563, %45 ], [ %.05563, %38 ], [ %.05563, %55 ], [ %32, %23 ], [ %.05563, %.fold.split ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = zext i32 %60 to i64
  %62 = icmp ult i64 %indvars.iv.next, %61
  br i1 %62, label %23, label %._crit_edge, !llvm.loop !18

._crit_edge:                                      ; preds = %59
  %63 = icmp eq ptr %.1, null
  br i1 %63, label %.loopexit, label %64

64:                                               ; preds = %._crit_edge
  %65 = getelementptr inbounds i8, ptr %.1, i64 4
  %66 = getelementptr inbounds i8, ptr %.1, i64 2
  %67 = load i16, ptr %66, align 1, !tbaa !16
  %68 = call i64 @IScsiDhcp6ExtractRootPath(ptr noundef nonnull %65, i16 noundef zeroext %67, ptr noundef %1)
  br label %.loopexit

.loopexit:                                        ; preds = %50, %48, %35, %.preheader, %._crit_edge, %15, %64
  %.054 = phi i64 [ %68, %64 ], [ -9223372036854775802, %15 ], [ -9223372036854775805, %._crit_edge ], [ -9223372036854775805, %.preheader ], [ -9223372036854775805, %35 ], [ -9223372036854775805, %48 ], [ -9223372036854775805, %50 ]
  call void @FreePool(ptr noundef nonnull %13) #3
  br label %69

69:                                               ; preds = %9, %3, %.loopexit
  %.0 = phi i64 [ %.054, %.loopexit ], [ -9223372036854775802, %3 ], [ -9223372036854775802, %9 ]
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  ret i64 %.0
}

declare ptr @AllocateZeroPool(i64 noundef) local_unnamed_addr #2

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 64}
!10 = !{!"_EFI_DHCP6_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"", !15, i64 0, !15, i64 2, !7, i64 4}
!15 = !{!"short", !7, i64 0}
!16 = !{!14, !15, i64 2}
!17 = !{!15, !15, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass