; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal (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, 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 }
%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 %152

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 %152

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 %152

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 !30
  %75 = zext i8 %74 to i32
  %76 = and i32 %75, 1
  %77 = icmp eq i32 %76, 1
  br i1 %77, label %78, label %150

78:                                               ; preds = %60
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct._ISCSI_BASIC_HEADER, ptr %79, i32 0, i32 1
  %81 = load i8, ptr %80, align 1, !tbaa !30
  %82 = zext i8 %81 to i32
  %83 = and i32 %82, 128
  %84 = icmp eq i32 %83, 128
  br i1 %84, label %86, label %85

85:                                               ; preds = %78
  store i64 -9223372036854775784, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %152

86:                                               ; preds = %78
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._ISCSI_TCB, ptr %87, i32 0, i32 4
  store i8 1, ptr %88, align 1, !tbaa !32
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct._ISCSI_BASIC_HEADER, ptr %89, i32 0, i32 1
  %91 = load i8, ptr %90, align 1, !tbaa !30
  %92 = zext i8 %91 to i32
  %93 = and i32 %92, 6
  %94 = icmp eq i32 %93, 6
  br i1 %94, label %95, label %96

95:                                               ; preds = %86
  store i64 -9223372036854775784, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %152

96:                                               ; preds = %86
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct._ISCSI_TCB, ptr %97, i32 0, i32 12
  %99 = load ptr, ptr %98, align 8, !tbaa !21
  %100 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %99, i32 0, i32 12
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_IN, ptr %101, i32 0, i32 9
  %103 = load i32, ptr %102, align 4, !tbaa !33
  %104 = call i32 @SwapBytes32(i32 noundef %103)
  %105 = call i64 @IScsiCheckSN(ptr noundef %100, i32 noundef %104)
  store i64 %105, ptr %9, align 8, !tbaa !15
  %106 = load i64, ptr %9, align 8, !tbaa !15
  %107 = icmp slt i64 %106, 0
  br i1 %107, label %108, label %110

108:                                              ; preds = %96
  %109 = load i64, ptr %9, align 8, !tbaa !15
  store i64 %109, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %152

110:                                              ; preds = %96
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET, ptr %111, i32 0, i32 9
  store i8 0, ptr %112, align 2, !tbaa !34
  %113 = load ptr, ptr %8, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_IN, ptr %113, i32 0, i32 3
  %115 = load i8, ptr %114, align 1, !tbaa !36
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET, ptr %116, i32 0, i32 10
  store i8 %115, ptr %117, align 1, !tbaa !37
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._ISCSI_BASIC_HEADER, ptr %118, i32 0, i32 1
  %120 = load i8, ptr %119, align 1, !tbaa !30
  %121 = zext i8 %120 to i32
  %122 = and i32 %121, 4
  %123 = icmp eq i32 %122, 4
  br i1 %123, label %124, label %133

124:                                              ; preds = %110
  %125 = load ptr, ptr %8, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_IN, ptr %125, i32 0, i32 14
  %127 = load i32, ptr %126, align 4, !tbaa !38
  %128 = call i32 @SwapBytes32(i32 noundef %127)
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET, ptr %129, i32 0, i32 5
  %131 = load i32, ptr %130, align 8, !tbaa !39
  %132 = add i32 %131, %128
  store i32 %132, ptr %130, align 8, !tbaa !39
  store i64 -9223372036854775804, ptr %9, align 8, !tbaa !15
  br label %133

133:                                              ; preds = %124, %110
  %134 = load ptr, ptr %8, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct._ISCSI_BASIC_HEADER, ptr %134, i32 0, i32 1
  %136 = load i8, ptr %135, align 1, !tbaa !30
  %137 = zext i8 %136 to i32
  %138 = and i32 %137, 2
  %139 = icmp eq i32 %138, 2
  br i1 %139, label %140, label %149

140:                                              ; preds = %133
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct._ISCSI_SCSI_DATA_IN, ptr %141, i32 0, i32 14
  %143 = load i32, ptr %142, align 4, !tbaa !38
  %144 = call i32 @SwapBytes32(i32 noundef %143)
  %145 = load ptr, ptr %7, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET, ptr %145, i32 0, i32 5
  %147 = load i32, ptr %146, align 8, !tbaa !39
  %148 = sub i32 %147, %144
  store i32 %148, ptr %146, align 8, !tbaa !39
  br label %149

149:                                              ; preds = %140, %133
  br label %150

150:                                              ; preds = %149, %60
  %151 = load i64, ptr %9, align 8, !tbaa !15
  store i64 %151, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %152

152:                                              ; preds = %150, %108, %95, %85, %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
  %153 = load i64, ptr %4, align 8
  ret i64 %153
}

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, !24, i64 48, !11, i64 52, !25, i64 56, !26, i64 112, !11, i64 240, !11, i64 244, !11, i64 248}
!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 = !{!"_TCP4_IO", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !27, i64 32, !29, i64 48, !29, i64 72, !29, i64 96, !7, i64 120, !7, i64 121, !7, i64 122, !7, i64 123}
!27 = !{!"", !28, i64 0}
!28 = !{!"", !6, i64 0, !16, i64 8}
!29 = !{!"", !28, i64 0, !7, i64 16}
!30 = !{!31, !7, i64 1}
!31 = !{!"_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}
!32 = !{!18, !7, i64 25}
!33 = !{!10, !11, i64 24}
!34 = !{!35, !7, i64 50}
!35 = !{!"", !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}
!36 = !{!10, !7, i64 3}
!37 = !{!35, !7, i64 51}
!38 = !{!10, !11, i64 44}
!39 = !{!35, !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 !28
  %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 !30
  %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 !31
  %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 !32
  %51 = getelementptr inbounds i8, ptr %4, i64 3
  %52 = load i8, ptr %51, align 1, !tbaa !34
  %53 = getelementptr inbounds i8, ptr %2, i64 51
  store i8 %52, ptr %53, align 1, !tbaa !35
  %54 = load i8, ptr %33, align 1, !tbaa !28
  %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 !36
  %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 !37
  %62 = add i32 %61, %59
  store i32 %62, ptr %60, align 8, !tbaa !37
  %.pre = load i8, ptr %33, align 1, !tbaa !28
  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 !36
  %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 !37
  %72 = sub i32 %71, %69
  store i32 %72, ptr %70, align 8, !tbaa !37
  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, !21, i64 48, !9, i64 52, !22, i64 56, !24, i64 112, !9, i64 240, !9, i64 244, !9, i64 248}
!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 = !{!"_TCP4_IO", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !25, i64 32, !27, i64 48, !27, i64 72, !27, i64 96, !7, i64 120, !7, i64 121, !7, i64 122, !7, i64 123}
!25 = !{!"", !26, i64 0}
!26 = !{!"", !16, i64 0, !23, i64 8}
!27 = !{!"", !26, i64 0, !7, i64 16}
!28 = !{!29, !7, i64 1}
!29 = !{!"_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}
!30 = !{!14, !7, i64 25}
!31 = !{!6, !9, i64 24}
!32 = !{!33, !7, i64 50}
!33 = !{!"", !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}
!34 = !{!6, !7, i64 3}
!35 = !{!33, !7, i64 51}
!36 = !{!6, !9, i64 44}
!37 = !{!33, !9, i64 40}


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