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

; 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._ISCSI_DRIVER_DATA = type { i32, ptr, ptr, %struct._ISCSI_PRIVATE_PROTOCOL, ptr, %struct._EFI_EXT_SCSI_PASS_THRU_PROTOCOL, %struct.EFI_EXT_SCSI_PASS_THRU_MODE, ptr, ptr, ptr, ptr }
%struct._ISCSI_PRIVATE_PROTOCOL = type { i32 }
%struct._EFI_EXT_SCSI_PASS_THRU_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_EXT_SCSI_PASS_THRU_MODE = type { i32, i32, i32 }
%struct._ISCSI_SESSION = type { i32, ptr, ptr, i8, %union.anon, i8, [6 x i8], i16, i32, i32, i32, i32, i16, %struct._LIST_ENTRY, i32, %struct._LIST_ENTRY, i16, i32, i8, i8, i32, i32, i32, i32, i16, i8, i8, i8 }
%union.anon = type { %struct._ISCSI_CHAP_AUTH_DATA }
%struct._ISCSI_CHAP_AUTH_DATA = type { ptr, i32, [1024 x i8], i32, [16 x i8], i32, [1024 x i8], i32 }
%struct._LIST_ENTRY = type { ptr, ptr }
%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.0 }>
%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.0 = 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_DEVICE_PATH_PROTOCOL = type { i8, i8, [2 x i8] }
%struct.ISCSI_DEVICE_PATH = type <{ %struct.EFI_DEVICE_PATH_PROTOCOL, i16, i16, i64, i16 }>

@.str = external hidden unnamed_addr constant [144 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1

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

19:                                               ; preds = %4
  store i64 -9223372036854775806, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %135

20:                                               ; preds = %4
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %21, i64 0
  %23 = load i8, ptr %22, align 1, !tbaa !11
  %24 = zext i8 %23 to i32
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %26, label %27

26:                                               ; preds = %20
  store i64 -9223372036854775794, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %135

27:                                               ; preds = %20
  %28 = call zeroext i8 @DebugAssertEnabled()
  %29 = zext i8 %28 to i32
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %41

31:                                               ; preds = %27
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = ptrtoint ptr %32 to i64
  %34 = sub i64 %33, ptrtoint (ptr getelementptr inbounds (%struct._ISCSI_DRIVER_DATA, ptr null, i32 0, i32 5) to i64)
  %35 = inttoptr i64 %34 to ptr
  %36 = getelementptr inbounds %struct._ISCSI_DRIVER_DATA, ptr %35, i32 0, i32 0
  %37 = load i32, ptr %36, align 8, !tbaa !12
  %38 = icmp ne i32 %37, 1094996809
  br i1 %38, label %39, label %41

39:                                               ; preds = %31
  call void @DebugAssert(ptr noundef @.str, i64 noundef 230, ptr noundef @.str.1)
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  br label %46

41:                                               ; preds = %31, %27
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = ptrtoint ptr %42 to i64
  %44 = sub i64 %43, ptrtoint (ptr getelementptr inbounds (%struct._ISCSI_DRIVER_DATA, ptr null, i32 0, i32 5) to i64)
  %45 = inttoptr i64 %44 to ptr
  br label %46

46:                                               ; preds = %41, %39
  %47 = phi ptr [ %40, %39 ], [ %45, %41 ]
  store ptr %47, ptr %10, align 8, !tbaa !5
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._ISCSI_DRIVER_DATA, ptr %48, i32 0, i32 10
  %50 = load ptr, ptr %49, align 8, !tbaa !18
  store ptr %50, ptr %11, align 8, !tbaa !5
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %51, i32 0, i32 2
  %53 = load ptr, ptr %52, align 8, !tbaa !19
  %54 = getelementptr inbounds %struct._ISCSI_ATTEMPT_CONFIG_NVDATA, ptr %53, i32 0, i32 14
  store ptr %54, ptr %12, align 8, !tbaa !5
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %55, i32 0, i32 4
  %57 = getelementptr inbounds %struct._ISCSI_CHAP_AUTH_DATA, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !11
  store ptr %58, ptr %13, align 8, !tbaa !5
  %59 = load ptr, ptr %12, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._ISCSI_SESSION_CONFIG_NVDATA, ptr %59, i32 0, i32 11
  %61 = getelementptr inbounds [8 x i8], ptr %60, i64 0, i64 0
  %62 = call i64 @CompareMem(ptr noundef %8, ptr noundef %61, i64 noundef 8)
  %63 = icmp ne i64 %62, 0
  br i1 %63, label %64, label %65

64:                                               ; preds = %46
  store i64 -9223372036854775794, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %135

65:                                               ; preds = %46
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct._ISCSI_SESSION_CONFIG_NVDATA, ptr %66, i32 0, i32 8
  %68 = getelementptr inbounds [224 x i8], ptr %67, i64 0, i64 0
  %69 = call i64 @AsciiStrLen(ptr noundef %68)
  %70 = add i64 18, %69
  %71 = add i64 %70, 1
  store i64 %71, ptr %15, align 8, !tbaa !9
  %72 = load i64, ptr %15, align 8, !tbaa !9
  %73 = call ptr @AllocateZeroPool(i64 noundef %72)
  store ptr %73, ptr %14, align 8, !tbaa !5
  %74 = load ptr, ptr %14, align 8, !tbaa !5
  %75 = icmp eq ptr %74, null
  br i1 %75, label %76, label %77

76:                                               ; preds = %65
  store i64 -9223372036854775799, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %135

77:                                               ; preds = %65
  %78 = load ptr, ptr %14, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.EFI_DEVICE_PATH_PROTOCOL, ptr %78, i32 0, i32 0
  store i8 3, ptr %79, align 1, !tbaa !11
  %80 = load ptr, ptr %14, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.EFI_DEVICE_PATH_PROTOCOL, ptr %80, i32 0, i32 1
  store i8 19, ptr %81, align 1, !tbaa !11
  %82 = load ptr, ptr %14, align 8, !tbaa !5
  %83 = load i64, ptr %15, align 8, !tbaa !9
  %84 = call zeroext i16 @SetDevicePathNodeLength(ptr noundef %82, i64 noundef %83)
  %85 = load ptr, ptr %14, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.ISCSI_DEVICE_PATH, ptr %85, i32 0, i32 1
  store i16 0, ptr %86, align 1, !tbaa !11
  %87 = load ptr, ptr %14, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.ISCSI_DEVICE_PATH, ptr %87, i32 0, i32 2
  store i16 0, ptr %88, align 1, !tbaa !11
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %89, i32 0, i32 3
  %91 = load i8, ptr %90, align 8, !tbaa !23
  %92 = zext i8 %91 to i32
  switch i32 %92, label %114 [
    i32 0, label %93
    i32 1, label %100
  ]

93:                                               ; preds = %77
  %94 = load ptr, ptr %14, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.ISCSI_DEVICE_PATH, ptr %94, i32 0, i32 2
  %96 = load i16, ptr %95, align 1, !tbaa !11
  %97 = zext i16 %96 to i32
  %98 = or i32 %97, 2048
  %99 = trunc i32 %98 to i16
  store i16 %99, ptr %95, align 1, !tbaa !11
  br label %115

100:                                              ; preds = %77
  %101 = load ptr, ptr %13, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._ISCSI_CHAP_AUTH_CONFIG_NVDATA, ptr %101, i32 0, i32 0
  %103 = load i8, ptr %102, align 1, !tbaa !24
  %104 = zext i8 %103 to i32
  %105 = icmp eq i32 %104, 0
  br i1 %105, label %106, label %113

106:                                              ; preds = %100
  %107 = load ptr, ptr %14, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.ISCSI_DEVICE_PATH, ptr %107, i32 0, i32 2
  %109 = load i16, ptr %108, align 1, !tbaa !11
  %110 = zext i16 %109 to i32
  %111 = or i32 %110, 4096
  %112 = trunc i32 %111 to i16
  store i16 %112, ptr %108, align 1, !tbaa !11
  br label %113

113:                                              ; preds = %106, %100
  br label %115

114:                                              ; preds = %77
  br label %115

115:                                              ; preds = %114, %113, %93
  %116 = load ptr, ptr %14, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.ISCSI_DEVICE_PATH, ptr %116, i32 0, i32 3
  %118 = load ptr, ptr %12, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._ISCSI_SESSION_CONFIG_NVDATA, ptr %118, i32 0, i32 11
  %120 = getelementptr inbounds [8 x i8], ptr %119, i64 0, i64 0
  %121 = call ptr @CopyMem(ptr noundef %117, ptr noundef %120, i64 noundef 8)
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %122, i32 0, i32 16
  %124 = load i16, ptr %123, align 8, !tbaa !26
  %125 = load ptr, ptr %14, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.ISCSI_DEVICE_PATH, ptr %125, i32 0, i32 4
  store i16 %124, ptr %126, align 1, !tbaa !11
  %127 = load ptr, ptr %14, align 8, !tbaa !5
  %128 = getelementptr inbounds i8, ptr %127, i64 18
  %129 = load ptr, ptr %12, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct._ISCSI_SESSION_CONFIG_NVDATA, ptr %129, i32 0, i32 8
  %131 = getelementptr inbounds [224 x i8], ptr %130, i64 0, i64 0
  %132 = call ptr @AsciiStrCpy(ptr noundef %128, ptr noundef %131)
  %133 = load ptr, ptr %14, align 8, !tbaa !5
  %134 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %133, ptr %134, align 8, !tbaa !5
  store i64 0, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %135

135:                                              ; preds = %115, %76, %64, %26, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, 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 8, ptr %10) #3
  %136 = load i64, ptr %5, align 8
  ret i64 %136
}

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

declare zeroext i8 @DebugAssertEnabled() #2

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

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

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

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

declare i64 @AsciiStrLen(ptr noundef) #2

declare ptr @AllocateZeroPool(i64 noundef) #2

declare zeroext i16 @SetDevicePathNodeLength(ptr noundef, i64 noundef) #2

declare ptr @AsciiStrCpy(ptr noundef, ptr noundef) #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 = !{!"long long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !14, i64 0}
!13 = !{!"_ISCSI_DRIVER_DATA", !14, i64 0, !6, i64 8, !6, i64 16, !15, i64 24, !6, i64 32, !16, i64 40, !17, i64 104, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ISCSI_PRIVATE_PROTOCOL", !14, i64 0}
!16 = !{!"_EFI_EXT_SCSI_PASS_THRU_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}
!17 = !{!"", !14, i64 0, !14, i64 4, !14, i64 8}
!18 = !{!13, !6, i64 144}
!19 = !{!20, !6, i64 16}
!20 = !{!"_ISCSI_SESSION", !14, i64 0, !6, i64 8, !6, i64 16, !7, i64 24, !7, i64 32, !7, i64 2120, !7, i64 2121, !21, i64 2128, !14, i64 2132, !14, i64 2136, !14, i64 2140, !14, i64 2144, !21, i64 2148, !22, i64 2152, !14, i64 2168, !22, i64 2176, !21, i64 2192, !14, i64 2196, !7, i64 2200, !7, i64 2201, !14, i64 2204, !14, i64 2208, !14, i64 2212, !14, i64 2216, !21, i64 2220, !7, i64 2222, !7, i64 2223, !7, i64 2224}
!21 = !{!"short", !7, i64 0}
!22 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!23 = !{!20, !7, i64 24}
!24 = !{!25, !7, i64 0}
!25 = !{!"_ISCSI_CHAP_AUTH_CONFIG_NVDATA", !7, i64 0, !7, i64 1, !7, i64 128, !7, i64 145, !7, i64 272}
!26 = !{!20, !21, i64 2192}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str = external hidden unnamed_addr constant [144 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775806, 1) i64 @IScsiExtScsiPassThruBuildDevicePath(ptr noundef %0, ptr nocapture noundef readonly %1, i64 noundef %2, ptr noundef writeonly %3) local_unnamed_addr #0 {
  %5 = alloca i64, align 8
  store i64 %2, ptr %5, align 8, !tbaa !5
  %6 = icmp eq ptr %3, null
  br i1 %6, label %47, label %7

7:                                                ; preds = %4
  %8 = load i8, ptr %1, align 1, !tbaa !9
  %.not = icmp eq i8 %8, 0
  br i1 %.not, label %9, label %47

9:                                                ; preds = %7
  %10 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not32 = icmp eq i8 %10, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre35 = add i64 %.pre, -40
  %.pre37 = inttoptr i64 %.pre35 to ptr
  br i1 %.not32, label %._crit_edge, label %11

11:                                               ; preds = %9
  %12 = load i32, ptr %.pre37, align 8, !tbaa !10
  %.not33 = icmp eq i32 %12, 1094996809
  br i1 %.not33, label %._crit_edge, label %13

13:                                               ; preds = %11
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 230, ptr noundef nonnull @.str.1) #2
  br label %._crit_edge

._crit_edge:                                      ; preds = %9, %11, %13
  %14 = phi ptr [ %0, %13 ], [ %.pre37, %11 ], [ %.pre37, %9 ]
  %15 = getelementptr inbounds i8, ptr %14, i64 144
  %16 = load ptr, ptr %15, align 8, !tbaa !17
  %17 = getelementptr inbounds i8, ptr %16, i64 16
  %18 = load ptr, ptr %17, align 8, !tbaa !18
  %19 = getelementptr inbounds i8, ptr %16, i64 32
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  %21 = getelementptr inbounds i8, ptr %18, i64 549
  %22 = call i64 @CompareMem(ptr noundef nonnull %5, ptr noundef nonnull %21, i64 noundef 8) #2
  %.not34 = icmp eq i64 %22, 0
  br i1 %.not34, label %23, label %47

23:                                               ; preds = %._crit_edge
  %24 = getelementptr inbounds i8, ptr %18, i64 308
  %25 = call i64 @AsciiStrLen(ptr noundef nonnull %24) #2
  %26 = add i64 %25, 19
  %27 = call ptr @AllocateZeroPool(i64 noundef %26) #2
  %28 = icmp eq ptr %27, null
  br i1 %28, label %47, label %29

29:                                               ; preds = %23
  store i8 3, ptr %27, align 1, !tbaa !9
  %30 = getelementptr inbounds i8, ptr %27, i64 1
  store i8 19, ptr %30, align 1, !tbaa !9
  %31 = call zeroext i16 @SetDevicePathNodeLength(ptr noundef nonnull %27, i64 noundef %26) #2
  %32 = getelementptr inbounds i8, ptr %27, i64 4
  store i16 0, ptr %32, align 1, !tbaa !9
  %33 = getelementptr inbounds i8, ptr %27, i64 6
  store i16 0, ptr %33, align 1, !tbaa !9
  %34 = getelementptr inbounds i8, ptr %16, i64 24
  %35 = load i8, ptr %34, align 8, !tbaa !22
  switch i8 %35, label %39 [
    i8 0, label %.sink.split
    i8 1, label %36
  ]

36:                                               ; preds = %29
  %37 = load i8, ptr %20, align 1, !tbaa !23
  %38 = icmp eq i8 %37, 0
  br i1 %38, label %.sink.split, label %39

.sink.split:                                      ; preds = %36, %29
  %.sink = phi i16 [ 2048, %29 ], [ 4096, %36 ]
  store i16 %.sink, ptr %33, align 1, !tbaa !9
  br label %39

39:                                               ; preds = %.sink.split, %29, %36
  %40 = getelementptr inbounds i8, ptr %27, i64 8
  %41 = call ptr @CopyMem(ptr noundef nonnull %40, ptr noundef nonnull %21, i64 noundef 8) #2
  %42 = getelementptr inbounds i8, ptr %16, i64 2192
  %43 = load i16, ptr %42, align 8, !tbaa !25
  %44 = getelementptr inbounds i8, ptr %27, i64 16
  store i16 %43, ptr %44, align 1, !tbaa !9
  %45 = getelementptr inbounds i8, ptr %27, i64 18
  %46 = call ptr @AsciiStrCpy(ptr noundef nonnull %45, ptr noundef nonnull %24) #2
  store ptr %27, ptr %3, align 8, !tbaa !26
  br label %47

47:                                               ; preds = %23, %._crit_edge, %7, %4, %39
  %.0 = phi i64 [ 0, %39 ], [ -9223372036854775806, %4 ], [ -9223372036854775794, %7 ], [ -9223372036854775794, %._crit_edge ], [ -9223372036854775799, %23 ]
  ret i64 %.0
}

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

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

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

declare i64 @AsciiStrLen(ptr noundef) local_unnamed_addr #1

declare ptr @AllocateZeroPool(i64 noundef) local_unnamed_addr #1

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

declare ptr @AsciiStrCpy(ptr noundef, ptr noundef) local_unnamed_addr #1

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 = { "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 }

!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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !12, i64 0}
!11 = !{!"_ISCSI_DRIVER_DATA", !12, i64 0, !13, i64 8, !13, i64 16, !14, i64 24, !13, i64 32, !15, i64 40, !16, i64 104, !13, i64 120, !13, i64 128, !13, i64 136, !13, i64 144}
!12 = !{!"int", !7, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"_ISCSI_PRIVATE_PROTOCOL", !12, i64 0}
!15 = !{!"_EFI_EXT_SCSI_PASS_THRU_PROTOCOL", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56}
!16 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8}
!17 = !{!11, !13, i64 144}
!18 = !{!19, !13, i64 16}
!19 = !{!"_ISCSI_SESSION", !12, i64 0, !13, i64 8, !13, i64 16, !7, i64 24, !7, i64 32, !7, i64 2120, !7, i64 2121, !20, i64 2128, !12, i64 2132, !12, i64 2136, !12, i64 2140, !12, i64 2144, !20, i64 2148, !21, i64 2152, !12, i64 2168, !21, i64 2176, !20, i64 2192, !12, i64 2196, !7, i64 2200, !7, i64 2201, !12, i64 2204, !12, i64 2208, !12, i64 2212, !12, i64 2216, !20, i64 2220, !7, i64 2222, !7, i64 2223, !7, i64 2224}
!20 = !{!"short", !7, i64 0}
!21 = !{!"_LIST_ENTRY", !13, i64 0, !13, i64 8}
!22 = !{!19, !7, i64 24}
!23 = !{!24, !7, i64 0}
!24 = !{!"_ISCSI_CHAP_AUTH_CONFIG_NVDATA", !7, i64 0, !7, i64 1, !7, i64 128, !7, i64 145, !7, i64 272}
!25 = !{!19, !20, i64 2192}
!26 = !{!13, !13, i64 0}


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