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

; 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_SCSI_DATA_IN = type { i8, i8, i8, i8, i8, [3 x i8], [8 x i8], i32, i32, i32, i32, i32, i32, i32, i32 }
%struct._ISCSI_TCB = type { %struct._LIST_ENTRY, i8, i32, i8, i8, i32, i32, ptr, i32, i32, i32, %struct._ISCSI_XFER_CONTEXT, ptr }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct._ISCSI_XFER_CONTEXT = type { i32, i32, i32, i32 }
%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._ISCSI_BASIC_HEADER = type { i8, i8, i16, i8, [3 x i8], [8 x i8], i32, [7 x i32] }
%struct.EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET = type { i64, ptr, ptr, ptr, ptr, i32, i32, i8, i8, i8, i8, i8 }

; Function Attrs: nounwind uwtable
declare dso_local i64 @IScsiCheckSN(ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @IScsiUpdateCmdSN(ptr noundef, i32 noundef, i32 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 @NetbufGetByte(ptr noundef, i32 noundef, ptr noundef) #2

declare i32 @SwapBytes32(i32 noundef) #2

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

15:                                               ; preds = %3
  store i64 -9223372036854775784, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %167

16:                                               ; preds = %3
  %17 = load ptr, ptr %8, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_IN, ptr %17, i32 0, i32 7
  %19 = load i32, ptr %18, align 4, !tbaa !9
  %20 = call i32 @SwapBytes32(i32 noundef %19)
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_IN, ptr %21, i32 0, i32 7
  store i32 %20, ptr %22, align 4, !tbaa !9
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_IN, ptr %23, i32 0, i32 10
  %25 = load i32, ptr %24, align 4, !tbaa !12
  %26 = call i32 @SwapBytes32(i32 noundef %25)
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_IN, ptr %27, i32 0, i32 10
  store i32 %26, ptr %28, align 4, !tbaa !12
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_IN, ptr %29, i32 0, i32 11
  %31 = load i32, ptr %30, align 4, !tbaa !13
  %32 = call i32 @SwapBytes32(i32 noundef %31)
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_IN, ptr %33, i32 0, i32 11
  store i32 %32, ptr %34, align 4, !tbaa !13
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_IN, ptr %35, i32 0, i32 12
  %37 = load i32, ptr %36, align 4, !tbaa !14
  %38 = call i32 @SwapBytes32(i32 noundef %37)
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_IN, ptr %39, i32 0, i32 12
  store i32 %38, ptr %40, align 4, !tbaa !14
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._ISCSI_TCB, ptr %41, i32 0, i32 2
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_IN, ptr %43, i32 0, i32 12
  %45 = load i32, ptr %44, align 4, !tbaa !14
  %46 = call i64 @IScsiCheckSN(ptr noundef %42, i32 noundef %45)
  store i64 %46, ptr %9, align 8, !tbaa !15
  %47 = load i64, ptr %9, align 8, !tbaa !15
  %48 = icmp slt i64 %47, 0
  br i1 %48, label %49, label %51

49:                                               ; preds = %16
  %50 = load i64, ptr %9, align 8, !tbaa !15
  store i64 %50, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %167

51:                                               ; preds = %16
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_IN, ptr %52, i32 0, i32 7
  %54 = load i32, ptr %53, align 4, !tbaa !9
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct._ISCSI_TCB, ptr %55, i32 0, i32 8
  %57 = load i32, ptr %56, align 8, !tbaa !17
  %58 = icmp ne i32 %54, %57
  br i1 %58, label %59, label %60

59:                                               ; preds = %51
  store i64 -9223372036854775784, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %167

60:                                               ; preds = %51
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct._ISCSI_TCB, ptr %61, i32 0, i32 12
  %63 = load ptr, ptr %62, align 8, !tbaa !21
  %64 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %63, i32 0, i32 3
  %65 = load ptr, ptr %64, align 8, !tbaa !22
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_IN, ptr %66, i32 0, i32 11
  %68 = load i32, ptr %67, align 4, !tbaa !13
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_IN, ptr %69, i32 0, i32 10
  %71 = load i32, ptr %70, align 4, !tbaa !12
  call void @IScsiUpdateCmdSN(ptr noundef %65, i32 noundef %68, i32 noundef %71)
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct._ISCSI_BASIC_HEADER, ptr %72, i32 0, i32 1
  %74 = load i8, ptr %73, align 1, !tbaa !27
  %75 = zext i8 %74 to i32
  %76 = and i32 %75, 1
  %77 = icmp eq i32 %76, 1
  %78 = zext i1 %77 to i32
  %79 = trunc i32 %78 to i8
  %80 = icmp ne i8 %79, 0
  br i1 %80, label %81, label %165

81:                                               ; preds = %60
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct._ISCSI_BASIC_HEADER, ptr %82, i32 0, i32 1
  %84 = load i8, ptr %83, align 1, !tbaa !27
  %85 = zext i8 %84 to i32
  %86 = and i32 %85, 128
  %87 = icmp eq i32 %86, 128
  %88 = zext i1 %87 to i32
  %89 = trunc i32 %88 to i8
  %90 = icmp ne i8 %89, 0
  br i1 %90, label %92, label %91

91:                                               ; preds = %81
  store i64 -9223372036854775784, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %167

92:                                               ; preds = %81
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct._ISCSI_TCB, ptr %93, i32 0, i32 4
  store i8 1, ptr %94, align 1, !tbaa !29
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._ISCSI_BASIC_HEADER, ptr %95, i32 0, i32 1
  %97 = load i8, ptr %96, align 1, !tbaa !27
  %98 = zext i8 %97 to i32
  %99 = and i32 %98, 6
  %100 = icmp eq i32 %99, 6
  %101 = zext i1 %100 to i32
  %102 = trunc i32 %101 to i8
  %103 = icmp ne i8 %102, 0
  br i1 %103, label %104, label %105

104:                                              ; preds = %92
  store i64 -9223372036854775784, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %167

105:                                              ; preds = %92
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._ISCSI_TCB, ptr %106, i32 0, i32 12
  %108 = load ptr, ptr %107, align 8, !tbaa !21
  %109 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %108, i32 0, i32 13
  %110 = load ptr, ptr %8, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_IN, ptr %110, i32 0, i32 9
  %112 = load i32, ptr %111, align 4, !tbaa !30
  %113 = call i32 @SwapBytes32(i32 noundef %112)
  %114 = call i64 @IScsiCheckSN(ptr noundef %109, i32 noundef %113)
  store i64 %114, ptr %9, align 8, !tbaa !15
  %115 = load i64, ptr %9, align 8, !tbaa !15
  %116 = icmp slt i64 %115, 0
  br i1 %116, label %117, label %119

117:                                              ; preds = %105
  %118 = load i64, ptr %9, align 8, !tbaa !15
  store i64 %118, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %167

119:                                              ; preds = %105
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET, ptr %120, i32 0, i32 9
  store i8 0, ptr %121, align 2, !tbaa !31
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_IN, ptr %122, i32 0, i32 3
  %124 = load i8, ptr %123, align 1, !tbaa !33
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET, ptr %125, i32 0, i32 10
  store i8 %124, ptr %126, align 1, !tbaa !34
  %127 = load ptr, ptr %8, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct._ISCSI_BASIC_HEADER, ptr %127, i32 0, i32 1
  %129 = load i8, ptr %128, align 1, !tbaa !27
  %130 = zext i8 %129 to i32
  %131 = and i32 %130, 4
  %132 = icmp eq i32 %131, 4
  %133 = zext i1 %132 to i32
  %134 = trunc i32 %133 to i8
  %135 = icmp ne i8 %134, 0
  br i1 %135, label %136, label %145

136:                                              ; preds = %119
  %137 = load ptr, ptr %8, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_IN, ptr %137, i32 0, i32 14
  %139 = load i32, ptr %138, align 4, !tbaa !35
  %140 = call i32 @SwapBytes32(i32 noundef %139)
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET, ptr %141, i32 0, i32 5
  %143 = load i32, ptr %142, align 8, !tbaa !36
  %144 = add i32 %143, %140
  store i32 %144, ptr %142, align 8, !tbaa !36
  store i64 -9223372036854775804, ptr %9, align 8, !tbaa !15
  br label %145

145:                                              ; preds = %136, %119
  %146 = load ptr, ptr %8, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct._ISCSI_BASIC_HEADER, ptr %146, i32 0, i32 1
  %148 = load i8, ptr %147, align 1, !tbaa !27
  %149 = zext i8 %148 to i32
  %150 = and i32 %149, 2
  %151 = icmp eq i32 %150, 2
  %152 = zext i1 %151 to i32
  %153 = trunc i32 %152 to i8
  %154 = icmp ne i8 %153, 0
  br i1 %154, label %155, label %164

155:                                              ; preds = %145
  %156 = load ptr, ptr %8, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_IN, ptr %156, i32 0, i32 14
  %158 = load i32, ptr %157, align 4, !tbaa !35
  %159 = call i32 @SwapBytes32(i32 noundef %158)
  %160 = load ptr, ptr %7, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET, ptr %160, i32 0, i32 5
  %162 = load i32, ptr %161, align 8, !tbaa !36
  %163 = sub i32 %162, %159
  store i32 %163, ptr %161, align 8, !tbaa !36
  br label %164

164:                                              ; preds = %155, %145
  br label %165

165:                                              ; preds = %164, %60
  %166 = load i64, ptr %9, align 8, !tbaa !15
  store i64 %166, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %167

167:                                              ; preds = %165, %117, %104, %91, %59, %49, %15
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %168 = load i64, ptr %4, align 8
  ret i64 %168
}

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, !11, i64 16}
!10 = !{!"_ISCSI_SCSI_DATA_IN", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 28}
!13 = !{!10, !11, i64 32}
!14 = !{!10, !11, i64 36}
!15 = !{!16, !16, i64 0}
!16 = !{!"long long", !7, i64 0}
!17 = !{!18, !11, i64 48}
!18 = !{!"_ISCSI_TCB", !19, i64 0, !7, i64 16, !11, i64 20, !7, i64 24, !7, i64 25, !11, i64 28, !11, i64 32, !6, i64 40, !11, i64 48, !11, i64 52, !11, i64 56, !20, i64 60, !6, i64 80}
!19 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!20 = !{!"_ISCSI_XFER_CONTEXT", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12}
!21 = !{!18, !6, i64 80}
!22 = !{!23, !6, i64 32}
!23 = !{!"_ISCSI_CONNECTION", !11, 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, !7, i64 47, !24, i64 48, !11, i64 52, !25, i64 56, !7, i64 112, !26, i64 120, !11, i64 288, !11, i64 292, !11, i64 296}
!24 = !{!"short", !7, i64 0}
!25 = !{!"", !11, i64 0, !16, i64 8, !19, i64 16, !19, i64 32, !11, i64 48, !11, i64 52}
!26 = !{!"", !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}
!27 = !{!28, !7, i64 1}
!28 = !{!"_ISCSI_BASIC_HEADER", !7, i64 0, !7, i64 1, !24, i64 2, !7, i64 4, !7, i64 5, !7, i64 8, !11, i64 16, !7, i64 20}
!29 = !{!18, !7, i64 25}
!30 = !{!10, !11, i64 24}
!31 = !{!32, !7, i64 50}
!32 = !{!"", !16, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !11, i64 44, !7, i64 48, !7, i64 49, !7, i64 50, !7, i64 51, !7, i64 52}
!33 = !{!10, !7, i64 3}
!34 = !{!32, !7, i64 51}
!35 = !{!10, !11, i64 44}
!36 = !{!32, !11, 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"

; Function Attrs: nounwind uwtable
declare dso_local i64 @IScsiCheckSN(ptr noundef, i32 noundef) local_unnamed_addr #0

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

declare ptr @NetbufGetByte(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare i32 @SwapBytes32(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i64 @IScsiOnDataInRcvd(ptr noundef %0, ptr noundef %1, ptr nocapture noundef %2) local_unnamed_addr #0 {
  %4 = tail call ptr @NetbufGetByte(ptr noundef %0, i32 noundef 0, ptr noundef null) #2
  %5 = icmp eq ptr %4, null
  br i1 %5, label %73, label %6

6:                                                ; preds = %3
  %7 = getelementptr inbounds i8, ptr %4, i64 16
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %9 = tail call i32 @SwapBytes32(i32 noundef %8) #2
  store i32 %9, ptr %7, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %4, i64 28
  %11 = load i32, ptr %10, align 4, !tbaa !10
  %12 = tail call i32 @SwapBytes32(i32 noundef %11) #2
  store i32 %12, ptr %10, align 4, !tbaa !10
  %13 = getelementptr inbounds i8, ptr %4, i64 32
  %14 = load i32, ptr %13, align 4, !tbaa !11
  %15 = tail call i32 @SwapBytes32(i32 noundef %14) #2
  store i32 %15, ptr %13, align 4, !tbaa !11
  %16 = getelementptr inbounds i8, ptr %4, i64 36
  %17 = load i32, ptr %16, align 4, !tbaa !12
  %18 = tail call i32 @SwapBytes32(i32 noundef %17) #2
  store i32 %18, ptr %16, align 4, !tbaa !12
  %19 = getelementptr inbounds i8, ptr %1, i64 20
  %20 = tail call i64 @IScsiCheckSN(ptr noundef nonnull %19, i32 noundef %18)
  %21 = icmp slt i64 %20, 0
  br i1 %21, label %73, label %22

22:                                               ; preds = %6
  %23 = load i32, ptr %7, align 4, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %1, i64 48
  %25 = load i32, ptr %24, align 8, !tbaa !13
  %.not = icmp eq i32 %23, %25
  br i1 %.not, label %26, label %73

26:                                               ; preds = %22
  %27 = getelementptr inbounds i8, ptr %1, i64 80
  %28 = load ptr, ptr %27, align 8, !tbaa !18
  %29 = getelementptr inbounds i8, ptr %28, i64 32
  %30 = load ptr, ptr %29, align 8, !tbaa !19
  %31 = load i32, ptr %13, align 4, !tbaa !11
  %32 = load i32, ptr %10, align 4, !tbaa !10
  tail call void @IScsiUpdateCmdSN(ptr noundef %30, i32 noundef %31, i32 noundef %32)
  %33 = getelementptr inbounds i8, ptr %4, i64 1
  %34 = load i8, ptr %33, align 1, !tbaa !25
  %35 = and i8 %34, 1
  %.not43 = icmp eq i8 %35, 0
  br i1 %.not43, label %73, label %36

36:                                               ; preds = %26
  %.not44 = icmp sgt i8 %34, -1
  br i1 %.not44, label %73, label %37

37:                                               ; preds = %36
  %38 = getelementptr inbounds i8, ptr %1, i64 25
  store i8 1, ptr %38, align 1, !tbaa !27
  %39 = and i8 %34, 6
  %40 = icmp eq i8 %39, 6
  br i1 %40, label %73, label %41

41:                                               ; preds = %37
  %42 = load ptr, ptr %27, align 8, !tbaa !18
  %43 = getelementptr inbounds i8, ptr %42, i64 52
  %44 = getelementptr inbounds i8, ptr %4, i64 24
  %45 = load i32, ptr %44, align 4, !tbaa !28
  %46 = tail call i32 @SwapBytes32(i32 noundef %45) #2
  %47 = tail call i64 @IScsiCheckSN(ptr noundef nonnull %43, i32 noundef %46)
  %48 = icmp slt i64 %47, 0
  br i1 %48, label %73, label %49

49:                                               ; preds = %41
  %50 = getelementptr inbounds i8, ptr %2, i64 50
  store i8 0, ptr %50, align 2, !tbaa !29
  %51 = getelementptr inbounds i8, ptr %4, i64 3
  %52 = load i8, ptr %51, align 1, !tbaa !31
  %53 = getelementptr inbounds i8, ptr %2, i64 51
  store i8 %52, ptr %53, align 1, !tbaa !32
  %54 = load i8, ptr %33, align 1, !tbaa !25
  %55 = and i8 %54, 4
  %.not45 = icmp eq i8 %55, 0
  br i1 %.not45, label %63, label %56

56:                                               ; preds = %49
  %57 = getelementptr inbounds i8, ptr %4, i64 44
  %58 = load i32, ptr %57, align 4, !tbaa !33
  %59 = tail call i32 @SwapBytes32(i32 noundef %58) #2
  %60 = getelementptr inbounds i8, ptr %2, i64 40
  %61 = load i32, ptr %60, align 8, !tbaa !34
  %62 = add i32 %61, %59
  store i32 %62, ptr %60, align 8, !tbaa !34
  %.pre = load i8, ptr %33, align 1, !tbaa !25
  br label %63

63:                                               ; preds = %56, %49
  %64 = phi i8 [ %.pre, %56 ], [ %54, %49 ]
  %.0 = phi i64 [ -9223372036854775804, %56 ], [ %47, %49 ]
  %65 = and i8 %64, 2
  %.not46 = icmp eq i8 %65, 0
  br i1 %.not46, label %73, label %66

66:                                               ; preds = %63
  %67 = getelementptr inbounds i8, ptr %4, i64 44
  %68 = load i32, ptr %67, align 4, !tbaa !33
  %69 = tail call i32 @SwapBytes32(i32 noundef %68) #2
  %70 = getelementptr inbounds i8, ptr %2, i64 40
  %71 = load i32, ptr %70, align 8, !tbaa !34
  %72 = sub i32 %71, %69
  store i32 %72, ptr %70, align 8, !tbaa !34
  br label %73

73:                                               ; preds = %26, %66, %63, %41, %37, %36, %22, %6, %3
  %.037 = phi i64 [ -9223372036854775784, %3 ], [ %20, %6 ], [ -9223372036854775784, %22 ], [ -9223372036854775784, %36 ], [ -9223372036854775784, %37 ], [ %47, %41 ], [ %.0, %66 ], [ %.0, %63 ], [ %20, %26 ]
  ret i64 %.037
}

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, !9, i64 16}
!6 = !{!"_ISCSI_SCSI_DATA_IN", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 8, !9, i64 16, !9, i64 20, !9, i64 24, !9, i64 28, !9, i64 32, !9, i64 36, !9, i64 40, !9, i64 44}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!6, !9, i64 28}
!11 = !{!6, !9, i64 32}
!12 = !{!6, !9, i64 36}
!13 = !{!14, !9, i64 48}
!14 = !{!"_ISCSI_TCB", !15, i64 0, !7, i64 16, !9, i64 20, !7, i64 24, !7, i64 25, !9, i64 28, !9, i64 32, !16, i64 40, !9, i64 48, !9, i64 52, !9, i64 56, !17, i64 60, !16, i64 80}
!15 = !{!"_LIST_ENTRY", !16, i64 0, !16, i64 8}
!16 = !{!"any pointer", !7, i64 0}
!17 = !{!"_ISCSI_XFER_CONTEXT", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12}
!18 = !{!14, !16, i64 80}
!19 = !{!20, !16, i64 32}
!20 = !{!"_ISCSI_CONNECTION", !9, i64 0, !15, i64 8, !16, i64 24, !16, 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, !21, i64 48, !9, i64 52, !22, i64 56, !7, i64 112, !24, i64 120, !9, i64 288, !9, i64 292, !9, i64 296}
!21 = !{!"short", !7, i64 0}
!22 = !{!"", !9, i64 0, !23, i64 8, !15, i64 16, !15, i64 32, !9, i64 48, !9, i64 52}
!23 = !{!"long long", !7, i64 0}
!24 = !{!"", !7, i64 0, !16, i64 8, !16, i64 16, !16, 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}
!25 = !{!26, !7, i64 1}
!26 = !{!"_ISCSI_BASIC_HEADER", !7, i64 0, !7, i64 1, !21, i64 2, !7, i64 4, !7, i64 5, !7, i64 8, !9, i64 16, !7, i64 20}
!27 = !{!14, !7, i64 25}
!28 = !{!6, !9, i64 24}
!29 = !{!30, !7, i64 50}
!30 = !{!"", !23, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !9, i64 40, !9, i64 44, !7, i64 48, !7, i64 49, !7, i64 50, !7, i64 51, !7, i64 52}
!31 = !{!6, !7, i64 3}
!32 = !{!30, !7, i64 51}
!33 = !{!6, !9, i64 44}
!34 = !{!30, !9, i64 40}


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