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

; 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._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_CONNECTION = type { i32, %struct._LIST_ENTRY, ptr, ptr, i8, i8, i8, i8, i8, i8, i8, i8, i16, i32, %struct.NET_BUF_QUEUE, i8, %struct.TCP_IO, i32, i32, i32 }
%struct.NET_BUF_QUEUE = type { i32, i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i32, i32 }
%struct.TCP_IO = type { i8, ptr, ptr, ptr, %union.TCP_IO_PROTOCOL, %union.TCP_IO_PROTOCOL, %union.TCP_IO_CONNECTION_TOKEN, %union.TCP_IO_IO_TOKEN, %union.TCP_IO_IO_TOKEN, %union.TCP_IO_CLOSE_TOKEN, %union.TCP_IO_LISTEN_TOKEN, i8, i8, i8, i8, i8 }
%union.TCP_IO_PROTOCOL = type { ptr }
%union.TCP_IO_CONNECTION_TOKEN = type { %struct.EFI_TCP4_CONNECTION_TOKEN }
%struct.EFI_TCP4_CONNECTION_TOKEN = type { %struct.EFI_TCP4_COMPLETION_TOKEN }
%struct.EFI_TCP4_COMPLETION_TOKEN = type { ptr, i64 }
%union.TCP_IO_IO_TOKEN = type { %struct.EFI_TCP4_IO_TOKEN }
%struct.EFI_TCP4_IO_TOKEN = type { %struct.EFI_TCP4_COMPLETION_TOKEN, %union.anon.0 }
%union.anon.0 = type { ptr }
%union.TCP_IO_CLOSE_TOKEN = type { %struct.EFI_TCP4_CLOSE_TOKEN }
%struct.EFI_TCP4_CLOSE_TOKEN = type { %struct.EFI_TCP4_COMPLETION_TOKEN, i8 }
%union.TCP_IO_LISTEN_TOKEN = type { %struct.EFI_TCP4_LISTEN_TOKEN }
%struct.EFI_TCP4_LISTEN_TOKEN = type { %struct.EFI_TCP4_COMPLETION_TOKEN, ptr }
%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_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 }

@gBS = external global ptr, align 8
@gEfiTcp4ProtocolGuid = external global %struct.GUID, align 4
@gEfiTcp6ProtocolGuid = external global %struct.GUID, align 4
@.str.1 = external hidden unnamed_addr constant [134 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @IScsiDetatchConnection(ptr noundef) #0

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

; 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
declare dso_local void @IScsiConnReset(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @IScsiDestroyConnection(ptr noundef) #0

declare zeroext i8 @DebugAssertEnabled() #2

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

declare zeroext i8 @IsListEmpty(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @IScsiSessionAbort(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  %6 = load ptr, ptr %2, align 8, !tbaa !5
  %7 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %6, i32 0, i32 5
  %8 = load i8, ptr %7, align 8, !tbaa !9
  %9 = zext i8 %8 to i32
  %10 = icmp ne i32 %9, 1
  br i1 %10, label %11, label %12

11:                                               ; preds = %1
  store i32 1, ptr %5, align 4
  br label %94

12:                                               ; preds = %1
  br label %13

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

16:                                               ; preds = %13
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %17, i32 0, i32 13
  %19 = call zeroext i8 @IsListEmpty(ptr noundef %18)
  %20 = icmp ne i8 %19, 0
  br i1 %20, label %21, label %22

21:                                               ; preds = %16
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 3102, ptr noundef @.str.38)
  br label %22

22:                                               ; preds = %21, %16
  br label %23

23:                                               ; preds = %22, %13
  br label %24

24:                                               ; preds = %23
  br label %25

25:                                               ; preds = %24
  br label %26

26:                                               ; preds = %68, %25
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %27, i32 0, i32 13
  %29 = call zeroext i8 @IsListEmpty(ptr noundef %28)
  %30 = icmp ne i8 %29, 0
  %31 = xor i1 %30, true
  br i1 %31, label %32, label %91

32:                                               ; preds = %26
  %33 = call zeroext i8 @DebugAssertEnabled()
  %34 = zext i8 %33 to i32
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %52

36:                                               ; preds = %32
  %37 = load ptr, ptr %2, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %37, i32 0, i32 13
  %39 = getelementptr inbounds %struct._LIST_ENTRY, ptr %38, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !14
  %41 = ptrtoint ptr %40 to i64
  %42 = sub i64 %41, ptrtoint (ptr getelementptr inbounds (%struct._ISCSI_CONNECTION, ptr null, i32 0, i32 1) to i64)
  %43 = inttoptr i64 %42 to ptr
  %44 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %43, i32 0, i32 0
  %45 = load i32, ptr %44, align 8, !tbaa !15
  %46 = icmp ne i32 %45, 1313035081
  br i1 %46, label %47, label %52

47:                                               ; preds = %36
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 3110, ptr noundef @.str.36)
  %48 = load ptr, ptr %2, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %48, i32 0, i32 13
  %50 = getelementptr inbounds %struct._LIST_ENTRY, ptr %49, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !14
  br label %60

52:                                               ; preds = %36, %32
  %53 = load ptr, ptr %2, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %53, i32 0, i32 13
  %55 = getelementptr inbounds %struct._LIST_ENTRY, ptr %54, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !14
  %57 = ptrtoint ptr %56 to i64
  %58 = sub i64 %57, ptrtoint (ptr getelementptr inbounds (%struct._ISCSI_CONNECTION, ptr null, i32 0, i32 1) to i64)
  %59 = inttoptr i64 %58 to ptr
  br label %60

60:                                               ; preds = %52, %47
  %61 = phi ptr [ %51, %47 ], [ %59, %52 ]
  store ptr %61, ptr %3, align 8, !tbaa !5
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %62, i32 0, i32 15
  %64 = load i8, ptr %63, align 8, !tbaa !20
  %65 = icmp ne i8 %64, 0
  br i1 %65, label %67, label %66

66:                                               ; preds = %60
  store ptr @gEfiTcp4ProtocolGuid, ptr %4, align 8, !tbaa !5
  br label %68

67:                                               ; preds = %60
  store ptr @gEfiTcp6ProtocolGuid, ptr %4, align 8, !tbaa !5
  br label %68

68:                                               ; preds = %67, %66
  %69 = load ptr, ptr @gBS, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %69, i32 0, i32 34
  %71 = load ptr, ptr %70, align 8, !tbaa !21
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %72, i32 0, i32 16
  %74 = getelementptr inbounds %struct.TCP_IO, ptr %73, i32 0, i32 3
  %75 = load ptr, ptr %74, align 8, !tbaa !24
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = load ptr, ptr %2, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %77, i32 0, i32 1
  %79 = load ptr, ptr %78, align 8, !tbaa !25
  %80 = getelementptr inbounds %struct._ISCSI_DRIVER_DATA, ptr %79, i32 0, i32 1
  %81 = load ptr, ptr %80, align 8, !tbaa !26
  %82 = load ptr, ptr %2, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %82, i32 0, i32 1
  %84 = load ptr, ptr %83, align 8, !tbaa !25
  %85 = getelementptr inbounds %struct._ISCSI_DRIVER_DATA, ptr %84, i32 0, i32 7
  %86 = load ptr, ptr %85, align 8, !tbaa !31
  %87 = call i64 %71(ptr noundef %75, ptr noundef %76, ptr noundef %81, ptr noundef %86)
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  call void @IScsiConnReset(ptr noundef %88)
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  call void @IScsiDetatchConnection(ptr noundef %89)
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  call void @IScsiDestroyConnection(ptr noundef %90)
  br label %26, !llvm.loop !32

91:                                               ; preds = %26
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %92, i32 0, i32 5
  store i8 2, ptr %93, align 8, !tbaa !9
  store i32 1, ptr %5, align 4
  br label %94

94:                                               ; preds = %91, %11
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret void
}

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, !7, i64 2120}
!10 = !{!"_ISCSI_SESSION", !11, i64 0, !6, i64 8, !6, i64 16, !7, i64 24, !7, i64 32, !7, i64 2120, !7, i64 2121, !12, i64 2128, !11, i64 2132, !11, i64 2136, !11, i64 2140, !11, i64 2144, !12, i64 2148, !13, i64 2152, !11, i64 2168, !13, i64 2176, !12, i64 2192, !11, i64 2196, !7, i64 2200, !7, i64 2201, !11, i64 2204, !11, i64 2208, !11, i64 2212, !11, i64 2216, !12, i64 2220, !7, i64 2222, !7, i64 2223, !7, i64 2224}
!11 = !{!"int", !7, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!14 = !{!10, !6, i64 2152}
!15 = !{!16, !11, i64 0}
!16 = !{!"_ISCSI_CONNECTION", !11, i64 0, !13, i64 8, !6, i64 24, !6, i64 32, !7, i64 40, !7, i64 41, !7, i64 42, !7, i64 43, !7, i64 44, !7, i64 45, !7, i64 46, !7, i64 47, !12, i64 48, !11, i64 52, !17, i64 56, !7, i64 112, !19, i64 120, !11, i64 288, !11, i64 292, !11, i64 296}
!17 = !{!"", !11, i64 0, !18, i64 8, !13, i64 16, !13, i64 32, !11, i64 48, !11, i64 52}
!18 = !{!"long long", !7, i64 0}
!19 = !{!"", !7, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 64, !7, i64 88, !7, i64 112, !7, i64 136, !7, i64 160, !7, i64 161, !7, i64 162, !7, i64 163, !7, i64 164}
!20 = !{!16, !7, i64 112}
!21 = !{!22, !6, i64 288}
!22 = !{!"", !23, 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}
!23 = !{!"", !18, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!24 = !{!16, !6, i64 144}
!25 = !{!10, !6, i64 8}
!26 = !{!27, !6, i64 8}
!27 = !{!"_ISCSI_DRIVER_DATA", !11, i64 0, !6, i64 8, !6, i64 16, !28, i64 24, !6, i64 32, !29, i64 40, !30, i64 104, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144}
!28 = !{!"_ISCSI_PRIVATE_PROTOCOL", !11, i64 0}
!29 = !{!"_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}
!30 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8}
!31 = !{!27, !6, i64 120}
!32 = distinct !{!32, !33}
!33 = !{!"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"

%struct.GUID = type { i32, i16, i16, [8 x i8] }

@gBS = external local_unnamed_addr global ptr, align 8
@gEfiTcp4ProtocolGuid = external global %struct.GUID, align 4
@gEfiTcp6ProtocolGuid = external global %struct.GUID, align 4
@.str.1 = external hidden unnamed_addr constant [134 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @IScsiDetatchConnection(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @IScsiConnReset(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @IScsiDestroyConnection(ptr noundef) local_unnamed_addr #0

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

declare zeroext i8 @IsListEmpty(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @IScsiSessionAbort(ptr noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 2120
  %3 = load i8, ptr %2, align 8, !tbaa !5
  %.not = icmp eq i8 %3, 1
  br i1 %.not, label %4, label %35

4:                                                ; preds = %1
  %5 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not15 = icmp eq i8 %5, 0
  br i1 %.not15, label %10, label %6

6:                                                ; preds = %4
  %7 = getelementptr inbounds i8, ptr %0, i64 2152
  %8 = tail call zeroext i8 @IsListEmpty(ptr noundef nonnull %7) #2
  %.not16 = icmp eq i8 %8, 0
  br i1 %.not16, label %10, label %9

9:                                                ; preds = %6
  tail call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 3102, ptr noundef nonnull @.str.38) #2
  br label %10

10:                                               ; preds = %6, %9, %4
  %11 = getelementptr inbounds i8, ptr %0, i64 2152
  %12 = tail call zeroext i8 @IsListEmpty(ptr noundef nonnull %11) #2
  %.not1721 = icmp eq i8 %12, 0
  br i1 %.not1721, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %10
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  br label %14

14:                                               ; preds = %.lr.ph, %._crit_edge22
  %15 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not18 = icmp eq i8 %15, 0
  %.pre = load ptr, ptr %11, align 8, !tbaa !13
  %.pre23 = ptrtoint ptr %.pre to i64
  %.pre24 = add i64 %.pre23, -8
  %.pre26 = inttoptr i64 %.pre24 to ptr
  br i1 %.not18, label %._crit_edge22, label %16

16:                                               ; preds = %14
  %17 = load i32, ptr %.pre26, align 8, !tbaa !14
  %.not19 = icmp eq i32 %17, 1313035081
  br i1 %.not19, label %._crit_edge22, label %18

18:                                               ; preds = %16
  tail call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 3110, ptr noundef nonnull @.str.36) #2
  %19 = load ptr, ptr %11, align 8, !tbaa !13
  br label %._crit_edge22

._crit_edge22:                                    ; preds = %14, %16, %18
  %20 = phi ptr [ %19, %18 ], [ %.pre26, %16 ], [ %.pre26, %14 ]
  %21 = getelementptr inbounds i8, ptr %20, i64 112
  %22 = load i8, ptr %21, align 8, !tbaa !19
  %.not20 = icmp eq i8 %22, 0
  %gEfiTcp4ProtocolGuid.gEfiTcp6ProtocolGuid = select i1 %.not20, ptr @gEfiTcp4ProtocolGuid, ptr @gEfiTcp6ProtocolGuid
  %23 = load ptr, ptr @gBS, align 8, !tbaa !20
  %24 = getelementptr inbounds i8, ptr %23, i64 288
  %25 = load ptr, ptr %24, align 8, !tbaa !21
  %26 = getelementptr inbounds i8, ptr %20, i64 144
  %27 = load ptr, ptr %26, align 8, !tbaa !24
  %28 = load ptr, ptr %13, align 8, !tbaa !25
  %29 = getelementptr inbounds i8, ptr %28, i64 8
  %30 = load ptr, ptr %29, align 8, !tbaa !26
  %31 = getelementptr inbounds i8, ptr %28, i64 120
  %32 = load ptr, ptr %31, align 8, !tbaa !31
  %33 = tail call i64 %25(ptr noundef %27, ptr noundef nonnull %gEfiTcp4ProtocolGuid.gEfiTcp6ProtocolGuid, ptr noundef %30, ptr noundef %32) #2
  tail call void @IScsiConnReset(ptr noundef %20)
  tail call void @IScsiDetatchConnection(ptr noundef %20)
  tail call void @IScsiDestroyConnection(ptr noundef %20)
  %34 = tail call zeroext i8 @IsListEmpty(ptr noundef nonnull %11) #2
  %.not17 = icmp eq i8 %34, 0
  br i1 %.not17, label %14, label %._crit_edge, !llvm.loop !32

._crit_edge:                                      ; preds = %._crit_edge22, %10
  store i8 2, ptr %2, align 8, !tbaa !5
  br label %35

35:                                               ; preds = %1, %._crit_edge
  ret void
}

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, !8, i64 2120}
!6 = !{!"_ISCSI_SESSION", !7, i64 0, !10, i64 8, !10, i64 16, !8, i64 24, !8, i64 32, !8, i64 2120, !8, i64 2121, !11, i64 2128, !7, i64 2132, !7, i64 2136, !7, i64 2140, !7, i64 2144, !11, i64 2148, !12, i64 2152, !7, i64 2168, !12, i64 2176, !11, i64 2192, !7, i64 2196, !8, i64 2200, !8, i64 2201, !7, i64 2204, !7, i64 2208, !7, i64 2212, !7, i64 2216, !11, i64 2220, !8, i64 2222, !8, i64 2223, !8, i64 2224}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"short", !8, i64 0}
!12 = !{!"_LIST_ENTRY", !10, i64 0, !10, i64 8}
!13 = !{!6, !10, i64 2152}
!14 = !{!15, !7, i64 0}
!15 = !{!"_ISCSI_CONNECTION", !7, i64 0, !12, i64 8, !10, i64 24, !10, i64 32, !8, i64 40, !8, i64 41, !8, i64 42, !8, i64 43, !8, i64 44, !8, i64 45, !8, i64 46, !8, i64 47, !11, i64 48, !7, i64 52, !16, i64 56, !8, i64 112, !18, i64 120, !7, i64 288, !7, i64 292, !7, i64 296}
!16 = !{!"", !7, i64 0, !17, i64 8, !12, i64 16, !12, i64 32, !7, i64 48, !7, i64 52}
!17 = !{!"long long", !8, i64 0}
!18 = !{!"", !8, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !8, i64 32, !8, i64 40, !8, i64 48, !8, i64 64, !8, i64 88, !8, i64 112, !8, i64 136, !8, i64 160, !8, i64 161, !8, i64 162, !8, i64 163, !8, i64 164}
!19 = !{!15, !8, i64 112}
!20 = !{!10, !10, i64 0}
!21 = !{!22, !10, i64 288}
!22 = !{!"", !23, i64 0, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !10, i64 312, !10, i64 320, !10, i64 328, !10, i64 336, !10, i64 344, !10, i64 352, !10, i64 360, !10, i64 368}
!23 = !{!"", !17, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!24 = !{!15, !10, i64 144}
!25 = !{!6, !10, i64 8}
!26 = !{!27, !10, i64 8}
!27 = !{!"_ISCSI_DRIVER_DATA", !7, i64 0, !10, i64 8, !10, i64 16, !28, i64 24, !10, i64 32, !29, i64 40, !30, i64 104, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144}
!28 = !{!"_ISCSI_PRIVATE_PROTOCOL", !7, i64 0}
!29 = !{!"_EFI_EXT_SCSI_PASS_THRU_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56}
!30 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8}
!31 = !{!27, !10, i64 120}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass