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

; 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.NET_BUF = type { i32, i64, %struct._LIST_ENTRY, %union.NET_IP_HEAD, ptr, ptr, [64 x i8], ptr, i32, i32, [1 x %struct.NET_BLOCK_OP] }
%struct._LIST_ENTRY = type { ptr, ptr }
%union.NET_IP_HEAD = type { ptr }
%struct.NET_BLOCK_OP = type { ptr, ptr, ptr, ptr, i32 }
%struct._ISCSI_TCB = type { %struct._LIST_ENTRY, i8, i32, i8, i8, i32, i32, ptr, i32, i32, i32, %struct._ISCSI_XFER_CONTEXT, ptr }
%struct._ISCSI_XFER_CONTEXT = type { i32, i32, i32, i32 }
%struct._ISCSI_BASIC_HEADER = type { i8, i8, i16, i8, [3 x i8], [8 x i8], i32, [7 x i32] }
%struct._ISCSI_SCSI_DATA_OUT = type { i8, [3 x i8], i8, [3 x i8], [8 x i8], i32, i32, i32, i32, i32, i32, i32, i32 }
%struct._ISCSI_CONNECTION = type { i32, %struct._LIST_ENTRY, ptr, ptr, i8, i8, i8, i8, i8, i8, i8, i16, i32, %struct.NET_BUF_QUEUE, %struct._TCP4_IO, i32, i32, i32 }
%struct.NET_BUF_QUEUE = type { i32, i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i32, i32 }
%struct._TCP4_IO = type { ptr, ptr, ptr, ptr, %struct.EFI_TCP4_CONNECTION_TOKEN, %struct.EFI_TCP4_IO_TOKEN, %struct.EFI_TCP4_IO_TOKEN, %struct.EFI_TCP4_CLOSE_TOKEN, i8, i8, i8, i8 }
%struct.EFI_TCP4_CONNECTION_TOKEN = type { %struct.EFI_TCP4_COMPLETION_TOKEN }
%struct.EFI_TCP4_COMPLETION_TOKEN = type { ptr, i64 }
%struct.EFI_TCP4_IO_TOKEN = type { %struct.EFI_TCP4_COMPLETION_TOKEN, %union.anon }
%union.anon = type { ptr }
%struct.EFI_TCP4_CLOSE_TOKEN = type { %struct.EFI_TCP4_COMPLETION_TOKEN, i8 }

@.str = external hidden unnamed_addr constant [154 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [27 x i8], align 1

declare ptr @InsertTailList(ptr noundef, 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

declare ptr @AllocatePool(i64 noundef) #0

declare void @FreePool(ptr noundef) #0

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

declare zeroext i8 @DebugAssertEnabled() #0

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

declare ptr @NetbufAllocSpace(ptr noundef, i32 noundef, i8 noundef zeroext) #0

declare ptr @NetbufAlloc(i32 noundef) #0

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

declare i32 @SwapBytes32(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @IScsiFreeNbufList(ptr noundef) #2

declare ptr @InitializeListHead(ptr noundef) #0

declare ptr @NetbufFromBufList(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @IScsiNewDataSegment(ptr noundef, i32 noundef, i8 noundef zeroext) #2

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

22:                                               ; preds = %5
  store ptr null, ptr %6, align 8
  store i32 1, ptr %18, align 4
  br label %138

23:                                               ; preds = %5
  %24 = load ptr, ptr %12, align 8, !tbaa !5
  %25 = call ptr @InitializeListHead(ptr noundef %24)
  %26 = call ptr @NetbufAlloc(i32 noundef 48)
  store ptr %26, ptr %13, align 8, !tbaa !5
  %27 = load ptr, ptr %13, align 8, !tbaa !5
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %31

29:                                               ; preds = %23
  %30 = load ptr, ptr %12, align 8, !tbaa !5
  call void @FreePool(ptr noundef %30)
  store ptr null, ptr %6, align 8
  store i32 1, ptr %18, align 4
  br label %138

31:                                               ; preds = %23
  %32 = load ptr, ptr %12, align 8, !tbaa !5
  %33 = load ptr, ptr %13, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.NET_BUF, ptr %33, i32 0, i32 2
  %35 = call ptr @InsertTailList(ptr noundef %32, ptr noundef %34)
  %36 = load ptr, ptr %13, align 8, !tbaa !5
  %37 = call ptr @NetbufAllocSpace(ptr noundef %36, i32 noundef 48, i8 noundef zeroext 0)
  store ptr %37, ptr %16, align 8, !tbaa !5
  br label %38

38:                                               ; preds = %31
  %39 = call zeroext i8 @DebugAssertEnabled()
  %40 = icmp ne i8 %39, 0
  br i1 %40, label %41, label %46

41:                                               ; preds = %38
  %42 = load ptr, ptr %16, align 8, !tbaa !5
  %43 = icmp ne ptr %42, null
  br i1 %43, label %45, label %44

44:                                               ; preds = %41
  call void @DebugAssert(ptr noundef @.str, i64 noundef 2017, ptr noundef @.str.33)
  br label %45

45:                                               ; preds = %44, %41
  br label %46

46:                                               ; preds = %45, %38
  br label %47

47:                                               ; preds = %46
  br label %48

48:                                               ; preds = %47
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._ISCSI_TCB, ptr %49, i32 0, i32 11
  store ptr %50, ptr %17, align 8, !tbaa !5
  %51 = load ptr, ptr %16, align 8, !tbaa !5
  %52 = call ptr @ZeroMem(ptr noundef %51, i64 noundef 48)
  %53 = load ptr, ptr %16, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct._ISCSI_BASIC_HEADER, ptr %53, i32 0, i32 0
  store i8 5, ptr %54, align 4, !tbaa !13
  br label %55

55:                                               ; preds = %48
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = lshr i32 %56, 16
  %58 = and i32 %57, 255
  %59 = trunc i32 %58 to i8
  %60 = load ptr, ptr %16, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct._ISCSI_BASIC_HEADER, ptr %60, i32 0, i32 4
  %62 = getelementptr inbounds [3 x i8], ptr %61, i64 0, i64 0
  store i8 %59, ptr %62, align 1, !tbaa !16
  %63 = load i32, ptr %8, align 4, !tbaa !9
  %64 = lshr i32 %63, 8
  %65 = and i32 %64, 255
  %66 = trunc i32 %65 to i8
  %67 = load ptr, ptr %16, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._ISCSI_BASIC_HEADER, ptr %67, i32 0, i32 4
  %69 = getelementptr inbounds [3 x i8], ptr %68, i64 0, i64 1
  store i8 %66, ptr %69, align 1, !tbaa !16
  %70 = load i32, ptr %8, align 4, !tbaa !9
  %71 = and i32 %70, 255
  %72 = trunc i32 %71 to i8
  %73 = load ptr, ptr %16, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._ISCSI_BASIC_HEADER, ptr %73, i32 0, i32 4
  %75 = getelementptr inbounds [3 x i8], ptr %74, i64 0, i64 2
  store i8 %72, ptr %75, align 1, !tbaa !16
  br label %76

76:                                               ; preds = %55
  br label %77

77:                                               ; preds = %76
  %78 = load ptr, ptr %10, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct._ISCSI_TCB, ptr %78, i32 0, i32 8
  %80 = load i32, ptr %79, align 8, !tbaa !17
  %81 = call i32 @SwapBytes32(i32 noundef %80)
  %82 = load ptr, ptr %16, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_OUT, ptr %82, i32 0, i32 5
  store i32 %81, ptr %83, align 4, !tbaa !21
  %84 = load ptr, ptr %17, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._ISCSI_XFER_CONTEXT, ptr %84, i32 0, i32 0
  %86 = load i32, ptr %85, align 4, !tbaa !23
  %87 = call i32 @SwapBytes32(i32 noundef %86)
  %88 = load ptr, ptr %16, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_OUT, ptr %88, i32 0, i32 6
  store i32 %87, ptr %89, align 4, !tbaa !24
  %90 = load ptr, ptr %10, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._ISCSI_TCB, ptr %90, i32 0, i32 12
  %92 = load ptr, ptr %91, align 8, !tbaa !25
  %93 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %92, i32 0, i32 12
  %94 = load i32, ptr %93, align 4, !tbaa !26
  %95 = call i32 @SwapBytes32(i32 noundef %94)
  %96 = load ptr, ptr %16, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_OUT, ptr %96, i32 0, i32 8
  store i32 %95, ptr %97, align 4, !tbaa !33
  %98 = load i32, ptr %9, align 4, !tbaa !9
  %99 = call i32 @SwapBytes32(i32 noundef %98)
  %100 = load ptr, ptr %16, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_OUT, ptr %100, i32 0, i32 10
  store i32 %99, ptr %101, align 4, !tbaa !34
  %102 = load ptr, ptr %17, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct._ISCSI_XFER_CONTEXT, ptr %102, i32 0, i32 1
  %104 = load i32, ptr %103, align 4, !tbaa !35
  %105 = call i32 @SwapBytes32(i32 noundef %104)
  %106 = load ptr, ptr %16, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_OUT, ptr %106, i32 0, i32 11
  store i32 %105, ptr %107, align 4, !tbaa !36
  %108 = load ptr, ptr %17, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._ISCSI_XFER_CONTEXT, ptr %108, i32 0, i32 0
  %110 = load i32, ptr %109, align 4, !tbaa !23
  %111 = icmp ne i32 %110, -1
  br i1 %111, label %112, label %116

112:                                              ; preds = %77
  %113 = load ptr, ptr %16, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_OUT, ptr %113, i32 0, i32 4
  %115 = call ptr @CopyMem(ptr noundef %114, ptr noundef %11, i64 noundef 8)
  br label %116

116:                                              ; preds = %112, %77
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = load i32, ptr %8, align 4, !tbaa !9
  %119 = call ptr @IScsiNewDataSegment(ptr noundef %117, i32 noundef %118, i8 noundef zeroext 0)
  store ptr %119, ptr %14, align 8, !tbaa !5
  %120 = load ptr, ptr %14, align 8, !tbaa !5
  %121 = icmp eq ptr %120, null
  br i1 %121, label %122, label %124

122:                                              ; preds = %116
  %123 = load ptr, ptr %12, align 8, !tbaa !5
  call void @IScsiFreeNbufList(ptr noundef %123)
  store ptr null, ptr %6, align 8
  store i32 1, ptr %18, align 4
  br label %138

124:                                              ; preds = %116
  %125 = load ptr, ptr %12, align 8, !tbaa !5
  %126 = load ptr, ptr %14, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.NET_BUF, ptr %126, i32 0, i32 2
  %128 = call ptr @InsertTailList(ptr noundef %125, ptr noundef %127)
  %129 = load ptr, ptr %12, align 8, !tbaa !5
  %130 = load ptr, ptr %12, align 8, !tbaa !5
  %131 = call ptr @NetbufFromBufList(ptr noundef %129, i32 noundef 0, i32 noundef 0, ptr noundef @IScsiFreeNbufList, ptr noundef %130)
  store ptr %131, ptr %15, align 8, !tbaa !5
  %132 = load ptr, ptr %15, align 8, !tbaa !5
  %133 = icmp eq ptr %132, null
  br i1 %133, label %134, label %136

134:                                              ; preds = %124
  %135 = load ptr, ptr %12, align 8, !tbaa !5
  call void @IScsiFreeNbufList(ptr noundef %135)
  br label %136

136:                                              ; preds = %134, %124
  %137 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %137, ptr %6, align 8
  store i32 1, ptr %18, align 4
  br label %138

138:                                              ; preds = %136, %122, %29, %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  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
  %139 = load ptr, ptr %6, align 8
  ret ptr %139
}

attributes #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 = { 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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !7, i64 0}
!14 = !{!"_ISCSI_BASIC_HEADER", !7, i64 0, !7, i64 1, !15, i64 2, !7, i64 4, !7, i64 5, !7, i64 8, !10, i64 16, !7, i64 20}
!15 = !{!"short", !7, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !10, i64 48}
!18 = !{!"_ISCSI_TCB", !19, i64 0, !7, i64 16, !10, i64 20, !7, i64 24, !7, i64 25, !10, i64 28, !10, i64 32, !6, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !20, i64 60, !6, i64 80}
!19 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!20 = !{!"_ISCSI_XFER_CONTEXT", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!21 = !{!22, !10, i64 16}
!22 = !{!"_ISCSI_SCSI_DATA_OUT", !7, i64 0, !7, i64 1, !7, i64 4, !7, i64 5, !7, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44}
!23 = !{!20, !10, i64 0}
!24 = !{!22, !10, i64 20}
!25 = !{!18, !6, i64 80}
!26 = !{!27, !10, i64 52}
!27 = !{!"_ISCSI_CONNECTION", !10, i64 0, !19, 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, !15, i64 48, !10, i64 52, !28, i64 56, !29, i64 112, !10, i64 240, !10, i64 244, !10, i64 248}
!28 = !{!"", !10, i64 0, !12, i64 8, !19, i64 16, !19, i64 32, !10, i64 48, !10, i64 52}
!29 = !{!"_TCP4_IO", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !30, i64 32, !32, i64 48, !32, i64 72, !32, i64 96, !7, i64 120, !7, i64 121, !7, i64 122, !7, i64 123}
!30 = !{!"", !31, i64 0}
!31 = !{!"", !6, i64 0, !12, i64 8}
!32 = !{!"", !31, i64 0, !7, i64 16}
!33 = !{!22, !10, i64 28}
!34 = !{!22, !10, i64 36}
!35 = !{!20, !10, i64 4}
!36 = !{!22, !10, i64 40}


; 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 [154 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [27 x i8], align 1

declare ptr @InsertTailList(ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @AllocatePool(i64 noundef) local_unnamed_addr #0

declare void @FreePool(ptr noundef) local_unnamed_addr #0

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #0

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

declare ptr @NetbufAllocSpace(ptr noundef, i32 noundef, i8 noundef zeroext) local_unnamed_addr #0

declare ptr @NetbufAlloc(i32 noundef) local_unnamed_addr #0

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

declare i32 @SwapBytes32(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @IScsiFreeNbufList(ptr noundef) #1

declare ptr @InitializeListHead(ptr noundef) local_unnamed_addr #0

declare ptr @NetbufFromBufList(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @IScsiNewDataSegment(ptr noundef, i32 noundef, i8 noundef zeroext) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local ptr @IScsiNewDataOutPdu(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr nocapture noundef readonly %3, i64 noundef %4) local_unnamed_addr #1 {
  %6 = alloca i64, align 8
  store i64 %4, ptr %6, align 8, !tbaa !5
  %7 = tail call ptr @AllocatePool(i64 noundef 16) #2
  %8 = icmp eq ptr %7, null
  br i1 %8, label %66, label %9

9:                                                ; preds = %5
  %10 = tail call ptr @InitializeListHead(ptr noundef nonnull %7) #2
  %11 = tail call ptr @NetbufAlloc(i32 noundef 48) #2
  %12 = icmp eq ptr %11, null
  br i1 %12, label %13, label %14

13:                                               ; preds = %9
  tail call void @FreePool(ptr noundef nonnull %7) #2
  br label %66

14:                                               ; preds = %9
  %15 = getelementptr inbounds i8, ptr %11, i64 16
  %16 = tail call ptr @InsertTailList(ptr noundef nonnull %7, ptr noundef nonnull %15) #2
  %17 = tail call ptr @NetbufAllocSpace(ptr noundef nonnull %11, i32 noundef 48, i8 noundef zeroext 0) #2
  %18 = tail call zeroext i8 @DebugAssertEnabled() #2
  %19 = icmp eq i8 %18, 0
  %20 = icmp ne ptr %17, null
  %or.cond = select i1 %19, i1 true, i1 %20
  br i1 %or.cond, label %22, label %21

21:                                               ; preds = %14
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 2017, ptr noundef nonnull @.str.33) #2
  br label %22

22:                                               ; preds = %21, %14
  %23 = getelementptr inbounds i8, ptr %3, i64 60
  %24 = tail call ptr @ZeroMem(ptr noundef %17, i64 noundef 48) #2
  store i8 5, ptr %17, align 4, !tbaa !9
  %25 = lshr i32 %1, 16
  %26 = trunc i32 %25 to i8
  %27 = getelementptr inbounds i8, ptr %17, i64 5
  store i8 %26, ptr %27, align 1, !tbaa !13
  %28 = lshr i32 %1, 8
  %29 = trunc i32 %28 to i8
  %30 = getelementptr inbounds i8, ptr %17, i64 6
  store i8 %29, ptr %30, align 1, !tbaa !13
  %31 = trunc i32 %1 to i8
  %32 = getelementptr inbounds i8, ptr %17, i64 7
  store i8 %31, ptr %32, align 1, !tbaa !13
  %33 = getelementptr inbounds i8, ptr %3, i64 48
  %34 = load i32, ptr %33, align 8, !tbaa !14
  %35 = tail call i32 @SwapBytes32(i32 noundef %34) #2
  %36 = getelementptr inbounds i8, ptr %17, i64 16
  store i32 %35, ptr %36, align 4, !tbaa !19
  %37 = load i32, ptr %23, align 4, !tbaa !21
  %38 = tail call i32 @SwapBytes32(i32 noundef %37) #2
  %39 = getelementptr inbounds i8, ptr %17, i64 20
  store i32 %38, ptr %39, align 4, !tbaa !22
  %40 = getelementptr inbounds i8, ptr %3, i64 80
  %41 = load ptr, ptr %40, align 8, !tbaa !23
  %42 = getelementptr inbounds i8, ptr %41, i64 52
  %43 = load i32, ptr %42, align 4, !tbaa !24
  %44 = tail call i32 @SwapBytes32(i32 noundef %43) #2
  %45 = getelementptr inbounds i8, ptr %17, i64 28
  store i32 %44, ptr %45, align 4, !tbaa !31
  %46 = tail call i32 @SwapBytes32(i32 noundef %2) #2
  %47 = getelementptr inbounds i8, ptr %17, i64 36
  store i32 %46, ptr %47, align 4, !tbaa !32
  %48 = getelementptr inbounds i8, ptr %3, i64 64
  %49 = load i32, ptr %48, align 4, !tbaa !33
  %50 = tail call i32 @SwapBytes32(i32 noundef %49) #2
  %51 = getelementptr inbounds i8, ptr %17, i64 40
  store i32 %50, ptr %51, align 4, !tbaa !34
  %52 = load i32, ptr %23, align 4, !tbaa !21
  %.not = icmp eq i32 %52, -1
  br i1 %.not, label %56, label %53

53:                                               ; preds = %22
  %54 = getelementptr inbounds i8, ptr %17, i64 8
  %55 = call ptr @CopyMem(ptr noundef nonnull %54, ptr noundef nonnull %6, i64 noundef 8) #2
  br label %56

56:                                               ; preds = %53, %22
  %57 = call ptr @IScsiNewDataSegment(ptr noundef %0, i32 noundef %1, i8 noundef zeroext 0)
  %58 = icmp eq ptr %57, null
  br i1 %58, label %59, label %60

59:                                               ; preds = %56
  call void @IScsiFreeNbufList(ptr noundef nonnull %7)
  br label %66

60:                                               ; preds = %56
  %61 = getelementptr inbounds i8, ptr %57, i64 16
  %62 = call ptr @InsertTailList(ptr noundef nonnull %7, ptr noundef nonnull %61) #2
  %63 = call ptr @NetbufFromBufList(ptr noundef nonnull %7, i32 noundef 0, i32 noundef 0, ptr noundef nonnull @IScsiFreeNbufList, ptr noundef nonnull %7) #2
  %64 = icmp eq ptr %63, null
  br i1 %64, label %65, label %66

65:                                               ; preds = %60
  call void @IScsiFreeNbufList(ptr noundef nonnull %7)
  br label %66

66:                                               ; preds = %60, %65, %5, %59, %13
  %.0 = phi ptr [ null, %13 ], [ null, %59 ], [ null, %5 ], [ null, %65 ], [ %63, %60 ]
  ret ptr %.0
}

attributes #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 = { 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 #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 = !{!10, !7, i64 0}
!10 = !{!"_ISCSI_BASIC_HEADER", !7, i64 0, !7, i64 1, !11, i64 2, !7, i64 4, !7, i64 5, !7, i64 8, !12, i64 16, !7, i64 20}
!11 = !{!"short", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !12, i64 48}
!15 = !{!"_ISCSI_TCB", !16, i64 0, !7, i64 16, !12, i64 20, !7, i64 24, !7, i64 25, !12, i64 28, !12, i64 32, !17, i64 40, !12, i64 48, !12, i64 52, !12, i64 56, !18, i64 60, !17, i64 80}
!16 = !{!"_LIST_ENTRY", !17, i64 0, !17, i64 8}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!"_ISCSI_XFER_CONTEXT", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12}
!19 = !{!20, !12, i64 16}
!20 = !{!"_ISCSI_SCSI_DATA_OUT", !7, i64 0, !7, i64 1, !7, i64 4, !7, i64 5, !7, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44}
!21 = !{!18, !12, i64 0}
!22 = !{!20, !12, i64 20}
!23 = !{!15, !17, i64 80}
!24 = !{!25, !12, i64 52}
!25 = !{!"_ISCSI_CONNECTION", !12, i64 0, !16, i64 8, !17, i64 24, !17, i64 32, !7, i64 40, !7, i64 41, !7, i64 42, !7, i64 43, !7, i64 44, !7, i64 45, !7, i64 46, !11, i64 48, !12, i64 52, !26, i64 56, !27, i64 112, !12, i64 240, !12, i64 244, !12, i64 248}
!26 = !{!"", !12, i64 0, !6, i64 8, !16, i64 16, !16, i64 32, !12, i64 48, !12, i64 52}
!27 = !{!"_TCP4_IO", !17, i64 0, !17, i64 8, !17, i64 16, !17, i64 24, !28, i64 32, !30, i64 48, !30, i64 72, !30, i64 96, !7, i64 120, !7, i64 121, !7, i64 122, !7, i64 123}
!28 = !{!"", !29, i64 0}
!29 = !{!"", !17, i64 0, !6, i64 8}
!30 = !{!"", !29, i64 0, !7, i64 16}
!31 = !{!20, !12, i64 28}
!32 = !{!20, !12, i64 36}
!33 = !{!18, !12, i64 4}
!34 = !{!20, !12, i64 40}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass