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

; 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_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._LIST_ENTRY = type { ptr, ptr }
%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_LOGIN_RESPONSE = type { i8, i8, i8, i8, i8, [3 x i8], [6 x i8], i16, i32, i32, i32, i32, i32, i8, i8, [10 x i8] }
%struct._ISCSI_BASIC_HEADER = type { i8, i8, i16, i8, [3 x i8], [8 x i8], i32, [7 x i32] }
%struct._ISCSI_SESSION = type { i32, ptr, ptr, i8, %union.anon, i8, [6 x i8], i16, i32, i32, i32, i32, i16, %struct._LIST_ENTRY, i32, %struct._LIST_ENTRY, i16, i32, i8, i8, i32, i32, i32, i32, i16, i8, i8, i8 }
%union.anon = type { %struct._ISCSI_CHAP_AUTH_DATA }
%struct._ISCSI_CHAP_AUTH_DATA = type { ptr, i32, [1024 x i8], i32, [16 x i8], i32, [1024 x i8], i32 }
%struct.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] }
%union.NET_IP_HEAD = type { ptr }
%struct.NET_BLOCK_OP = type { ptr, ptr, ptr, ptr, i32 }

; 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 void @NetbufQueFlush(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local i64 @IScsiProcessLoginRsp(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca i8, align 1
  %12 = alloca i8, align 1
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  store i64 0, ptr %6, align 8, !tbaa !9
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %16, i32 0, i32 3
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  store ptr %18, ptr %7, align 8, !tbaa !5
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = call ptr @NetbufGetByte(ptr noundef %19, i32 noundef 0, ptr noundef null)
  store ptr %20, ptr %8, align 8, !tbaa !5
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = icmp eq ptr %21, null
  br i1 %22, label %23, label %24

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

24:                                               ; preds = %2
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %25, i32 0, i32 0
  %27 = load i8, ptr %26, align 4, !tbaa !18
  %28 = zext i8 %27 to i32
  %29 = and i32 %28, 63
  %30 = icmp eq i32 %29, 35
  br i1 %30, label %32, label %31

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

32:                                               ; preds = %24
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct._ISCSI_BASIC_HEADER, ptr %33, i32 0, i32 4
  %35 = getelementptr inbounds [3 x i8], ptr %34, i64 0, i64 0
  %36 = load i8, ptr %35, align 1, !tbaa !20
  %37 = zext i8 %36 to i32
  %38 = shl i32 %37, 16
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._ISCSI_BASIC_HEADER, ptr %39, i32 0, i32 4
  %41 = getelementptr inbounds [3 x i8], ptr %40, i64 0, i64 1
  %42 = load i8, ptr %41, align 1, !tbaa !20
  %43 = zext i8 %42 to i32
  %44 = shl i32 %43, 8
  %45 = or i32 %38, %44
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct._ISCSI_BASIC_HEADER, ptr %46, i32 0, i32 4
  %48 = getelementptr inbounds [3 x i8], ptr %47, i64 0, i64 2
  %49 = load i8, ptr %48, align 1, !tbaa !20
  %50 = zext i8 %49 to i32
  %51 = or i32 %45, %50
  store i32 %51, ptr %14, align 4, !tbaa !21
  %52 = load i32, ptr %14, align 4, !tbaa !21
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %57

54:                                               ; preds = %32
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = call ptr @NetbufGetByte(ptr noundef %55, i32 noundef 48, ptr noundef null)
  store ptr %56, ptr %13, align 8, !tbaa !5
  br label %58

57:                                               ; preds = %32
  store ptr null, ptr %13, align 8, !tbaa !5
  br label %58

58:                                               ; preds = %57, %54
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %59, i32 0, i32 13
  %61 = load i8, ptr %60, align 4, !tbaa !22
  %62 = zext i8 %61 to i32
  switch i32 %62, label %77 [
    i32 0, label %78
    i32 1, label %63
  ]

63:                                               ; preds = %58
  %64 = load ptr, ptr %13, align 8, !tbaa !5
  %65 = icmp eq ptr %64, null
  br i1 %65, label %66, label %67

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

67:                                               ; preds = %63
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = load ptr, ptr %13, align 8, !tbaa !5
  %70 = load i32, ptr %14, align 4, !tbaa !21
  %71 = call i64 @IScsiUpdateTargetAddress(ptr noundef %68, ptr noundef %69, i32 noundef %70)
  store i64 %71, ptr %6, align 8, !tbaa !9
  %72 = load i64, ptr %6, align 8, !tbaa !9
  %73 = icmp slt i64 %72, 0
  br i1 %73, label %74, label %76

74:                                               ; preds = %67
  %75 = load i64, ptr %6, align 8, !tbaa !9
  store i64 %75, ptr %3, align 8
  store i32 1, ptr %15, align 4
  br label %322

76:                                               ; preds = %67
  store i64 -9223372036854775795, ptr %3, align 8
  store i32 1, ptr %15, align 4
  br label %322

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

78:                                               ; preds = %58
  %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 !23
  %82 = zext i8 %81 to i32
  %83 = and i32 %82, 128
  %84 = icmp eq i32 %83, 128
  %85 = zext i1 %84 to i32
  %86 = trunc i32 %85 to i8
  store i8 %86, ptr %9, align 1, !tbaa !20
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._ISCSI_BASIC_HEADER, ptr %87, i32 0, i32 1
  %89 = load i8, ptr %88, align 1, !tbaa !23
  %90 = zext i8 %89 to i32
  %91 = and i32 %90, 64
  %92 = icmp eq i32 %91, 64
  %93 = zext i1 %92 to i32
  %94 = trunc i32 %93 to i8
  store i8 %94, ptr %10, align 1, !tbaa !20
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %95, i32 0, i32 1
  %97 = load i8, ptr %96, align 1, !tbaa !25
  %98 = zext i8 %97 to i32
  %99 = ashr i32 %98, 2
  %100 = and i32 %99, 3
  %101 = trunc i32 %100 to i8
  store i8 %101, ptr %11, align 1, !tbaa !20
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %102, i32 0, i32 1
  %104 = load i8, ptr %103, align 1, !tbaa !25
  %105 = zext i8 %104 to i32
  %106 = and i32 %105, 3
  %107 = trunc i32 %106 to i8
  store i8 %107, ptr %12, align 1, !tbaa !20
  %108 = load ptr, ptr %8, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %108, i32 0, i32 8
  %110 = load i32, ptr %109, align 4, !tbaa !26
  %111 = call i32 @SwapBytes32(i32 noundef %110)
  %112 = load ptr, ptr %8, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %112, i32 0, i32 8
  store i32 %111, ptr %113, align 4, !tbaa !26
  %114 = load i8, ptr %9, align 1, !tbaa !20
  %115 = zext i8 %114 to i32
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %121

117:                                              ; preds = %78
  %118 = load i8, ptr %10, align 1, !tbaa !20
  %119 = zext i8 %118 to i32
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %167, label %121

121:                                              ; preds = %117, %78
  %122 = load i8, ptr %11, align 1, !tbaa !20
  %123 = zext i8 %122 to i32
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %124, i32 0, i32 5
  %126 = load i8, ptr %125, align 1, !tbaa !27
  %127 = zext i8 %126 to i32
  %128 = icmp ne i32 %123, %127
  br i1 %128, label %167, label %129

129:                                              ; preds = %121
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %130, i32 0, i32 10
  %132 = load i8, ptr %131, align 2, !tbaa !28
  %133 = icmp ne i8 %132, 0
  br i1 %133, label %138, label %134

134:                                              ; preds = %129
  %135 = load i8, ptr %9, align 1, !tbaa !20
  %136 = zext i8 %135 to i32
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %167, label %138

138:                                              ; preds = %134, %129
  %139 = load i8, ptr %9, align 1, !tbaa !20
  %140 = zext i8 %139 to i32
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %150

142:                                              ; preds = %138
  %143 = load i8, ptr %12, align 1, !tbaa !20
  %144 = zext i8 %143 to i32
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %145, i32 0, i32 6
  %147 = load i8, ptr %146, align 2, !tbaa !29
  %148 = zext i8 %147 to i32
  %149 = icmp ne i32 %144, %148
  br i1 %149, label %167, label %150

150:                                              ; preds = %142, %138
  %151 = load ptr, ptr %7, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %151, i32 0, i32 6
  %153 = getelementptr inbounds [6 x i8], ptr %152, i64 0, i64 0
  %154 = load ptr, ptr %8, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %154, i32 0, i32 6
  %156 = getelementptr inbounds [6 x i8], ptr %155, i64 0, i64 0
  %157 = call i64 @CompareMem(ptr noundef %153, ptr noundef %156, i64 noundef 6)
  %158 = icmp ne i64 %157, 0
  br i1 %158, label %167, label %159

159:                                              ; preds = %150
  %160 = load ptr, ptr %8, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %160, i32 0, i32 8
  %162 = load i32, ptr %161, align 4, !tbaa !26
  %163 = load ptr, ptr %7, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %163, i32 0, i32 11
  %165 = load i32, ptr %164, align 8, !tbaa !30
  %166 = icmp ne i32 %162, %165
  br i1 %166, label %167, label %168

167:                                              ; preds = %159, %150, %142, %134, %121, %117
  store i64 -9223372036854775784, ptr %3, align 8
  store i32 1, ptr %15, align 4
  br label %322

168:                                              ; preds = %159
  %169 = load ptr, ptr %8, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %169, i32 0, i32 10
  %171 = load i32, ptr %170, align 4, !tbaa !32
  %172 = call i32 @SwapBytes32(i32 noundef %171)
  %173 = load ptr, ptr %8, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %173, i32 0, i32 10
  store i32 %172, ptr %174, align 4, !tbaa !32
  %175 = load ptr, ptr %8, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %175, i32 0, i32 11
  %177 = load i32, ptr %176, align 4, !tbaa !33
  %178 = call i32 @SwapBytes32(i32 noundef %177)
  %179 = load ptr, ptr %8, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %179, i32 0, i32 11
  store i32 %178, ptr %180, align 4, !tbaa !33
  %181 = load ptr, ptr %8, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %181, i32 0, i32 12
  %183 = load i32, ptr %182, align 4, !tbaa !34
  %184 = call i32 @SwapBytes32(i32 noundef %183)
  %185 = load ptr, ptr %8, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %185, i32 0, i32 12
  store i32 %184, ptr %186, align 4, !tbaa !34
  %187 = load ptr, ptr %4, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %187, i32 0, i32 5
  %189 = load i8, ptr %188, align 1, !tbaa !27
  %190 = zext i8 %189 to i32
  %191 = icmp eq i32 %190, 0
  br i1 %191, label %192, label %230

192:                                              ; preds = %168
  %193 = load ptr, ptr %4, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %193, i32 0, i32 7
  %195 = load i8, ptr %194, align 1, !tbaa !35
  %196 = zext i8 %195 to i32
  %197 = icmp eq i32 %196, 0
  br i1 %197, label %198, label %230

198:                                              ; preds = %192
  %199 = load ptr, ptr %7, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %199, i32 0, i32 5
  %201 = load i8, ptr %200, align 8, !tbaa !36
  %202 = zext i8 %201 to i32
  %203 = icmp eq i32 %202, 0
  br i1 %203, label %204, label %213

204:                                              ; preds = %198
  %205 = load ptr, ptr %7, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %205, i32 0, i32 8
  %207 = load i32, ptr %206, align 4, !tbaa !37
  %208 = load ptr, ptr %8, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %208, i32 0, i32 11
  %210 = load i32, ptr %209, align 4, !tbaa !33
  %211 = icmp ne i32 %207, %210
  br i1 %211, label %212, label %213

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

213:                                              ; preds = %204, %198
  %214 = load ptr, ptr %8, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %214, i32 0, i32 10
  %216 = load i32, ptr %215, align 4, !tbaa !32
  %217 = add i32 %216, 1
  %218 = load ptr, ptr %4, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %218, i32 0, i32 13
  store i32 %217, ptr %219, align 4, !tbaa !38
  %220 = load ptr, ptr %8, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %220, i32 0, i32 12
  %222 = load i32, ptr %221, align 4, !tbaa !34
  %223 = load ptr, ptr %7, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %223, i32 0, i32 10
  store i32 %222, ptr %224, align 4, !tbaa !39
  %225 = load ptr, ptr %8, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %225, i32 0, i32 11
  %227 = load i32, ptr %226, align 4, !tbaa !33
  %228 = load ptr, ptr %7, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %228, i32 0, i32 9
  store i32 %227, ptr %229, align 8, !tbaa !40
  br label %250

230:                                              ; preds = %192, %168
  %231 = load ptr, ptr %4, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %231, i32 0, i32 13
  %233 = load ptr, ptr %8, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %233, i32 0, i32 10
  %235 = load i32, ptr %234, align 4, !tbaa !32
  %236 = call i64 @IScsiCheckSN(ptr noundef %232, i32 noundef %235)
  store i64 %236, ptr %6, align 8, !tbaa !9
  %237 = load i64, ptr %6, align 8, !tbaa !9
  %238 = icmp slt i64 %237, 0
  br i1 %238, label %247, label %239

239:                                              ; preds = %230
  %240 = load ptr, ptr %7, align 8, !tbaa !5
  %241 = load ptr, ptr %8, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %241, i32 0, i32 12
  %243 = load i32, ptr %242, align 4, !tbaa !34
  %244 = load ptr, ptr %8, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %244, i32 0, i32 11
  %246 = load i32, ptr %245, align 4, !tbaa !33
  call void @IScsiUpdateCmdSN(ptr noundef %240, i32 noundef %243, i32 noundef %246)
  br label %249

247:                                              ; preds = %230
  %248 = load i64, ptr %6, align 8, !tbaa !9
  store i64 %248, ptr %3, align 8
  store i32 1, ptr %15, align 4
  br label %322

249:                                              ; preds = %239
  br label %250

250:                                              ; preds = %249, %213
  %251 = load ptr, ptr %5, align 8, !tbaa !5
  %252 = call i32 @NetbufTrim(ptr noundef %251, i32 noundef 48, i8 noundef zeroext 1)
  %253 = load ptr, ptr %5, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.NET_BUF, ptr %253, i32 0, i32 1
  %255 = load i64, ptr %254, align 8, !tbaa !41
  %256 = add nsw i64 %255, 1
  store i64 %256, ptr %254, align 8, !tbaa !41
  %257 = load ptr, ptr %4, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %257, i32 0, i32 14
  %259 = load ptr, ptr %5, align 8, !tbaa !5
  call void @NetbufQueAppend(ptr noundef %258, ptr noundef %259)
  %260 = load i8, ptr %10, align 1, !tbaa !20
  %261 = load ptr, ptr %4, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %261, i32 0, i32 9
  store i8 %260, ptr %262, align 1, !tbaa !43
  %263 = load i8, ptr %10, align 1, !tbaa !20
  %264 = icmp ne i8 %263, 0
  br i1 %264, label %265, label %266

265:                                              ; preds = %250
  store i64 0, ptr %3, align 8
  store i32 1, ptr %15, align 4
  br label %322

266:                                              ; preds = %250
  %267 = load i8, ptr %11, align 1, !tbaa !20
  %268 = zext i8 %267 to i32
  switch i32 %268, label %288 [
    i32 0, label %269
    i32 1, label %279
  ]

269:                                              ; preds = %266
  %270 = load ptr, ptr %7, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %270, i32 0, i32 3
  %272 = load i8, ptr %271, align 8, !tbaa !44
  %273 = zext i8 %272 to i32
  %274 = icmp ne i32 %273, 2
  br i1 %274, label %275, label %278

275:                                              ; preds = %269
  %276 = load ptr, ptr %4, align 8, !tbaa !5
  %277 = call i64 @IScsiCHAPOnRspReceived(ptr noundef %276)
  store i64 %277, ptr %6, align 8, !tbaa !9
  br label %278

278:                                              ; preds = %275, %269
  br label %289

279:                                              ; preds = %266
  %280 = load ptr, ptr %4, align 8, !tbaa !5
  %281 = call i64 @IScsiCheckOpParams(ptr noundef %280)
  store i64 %281, ptr %6, align 8, !tbaa !9
  %282 = load i64, ptr %6, align 8, !tbaa !9
  %283 = icmp slt i64 %282, 0
  br i1 %283, label %287, label %284

284:                                              ; preds = %279
  %285 = load ptr, ptr %4, align 8, !tbaa !5
  %286 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %285, i32 0, i32 11
  store i8 1, ptr %286, align 1, !tbaa !45
  br label %287

287:                                              ; preds = %284, %279
  br label %289

288:                                              ; preds = %266
  store i64 -9223372036854775784, ptr %6, align 8, !tbaa !9
  br label %289

289:                                              ; preds = %288, %287, %278
  %290 = load i8, ptr %9, align 1, !tbaa !20
  %291 = zext i8 %290 to i32
  %292 = icmp ne i32 %291, 0
  br i1 %292, label %293, label %318

293:                                              ; preds = %289
  %294 = load i64, ptr %6, align 8, !tbaa !9
  %295 = icmp eq i64 %294, 0
  br i1 %295, label %296, label %318

296:                                              ; preds = %293
  %297 = load ptr, ptr %4, align 8, !tbaa !5
  %298 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %297, i32 0, i32 6
  %299 = load i8, ptr %298, align 2, !tbaa !29
  %300 = load ptr, ptr %4, align 8, !tbaa !5
  %301 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %300, i32 0, i32 5
  store i8 %299, ptr %301, align 1, !tbaa !27
  %302 = load ptr, ptr %4, align 8, !tbaa !5
  %303 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %302, i32 0, i32 5
  %304 = load i8, ptr %303, align 1, !tbaa !27
  %305 = zext i8 %304 to i32
  %306 = icmp eq i32 %305, 1
  br i1 %306, label %307, label %310

307:                                              ; preds = %296
  %308 = load ptr, ptr %4, align 8, !tbaa !5
  %309 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %308, i32 0, i32 6
  store i8 3, ptr %309, align 2, !tbaa !29
  br label %317

310:                                              ; preds = %296
  %311 = load ptr, ptr %8, align 8, !tbaa !5
  %312 = getelementptr inbounds %struct._ISCSI_LOGIN_RESPONSE, ptr %311, i32 0, i32 7
  %313 = load i16, ptr %312, align 2, !tbaa !46
  %314 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %313)
  %315 = load ptr, ptr %7, align 8, !tbaa !5
  %316 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %315, i32 0, i32 7
  store i16 %314, ptr %316, align 8, !tbaa !47
  br label %317

317:                                              ; preds = %310, %307
  br label %318

318:                                              ; preds = %317, %293, %289
  %319 = load ptr, ptr %4, align 8, !tbaa !5
  %320 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %319, i32 0, i32 14
  call void @NetbufQueFlush(ptr noundef %320)
  %321 = load i64, ptr %6, align 8, !tbaa !9
  store i64 %321, ptr %3, align 8
  store i32 1, ptr %15, align 4
  br label %322

322:                                              ; preds = %318, %265, %247, %212, %167, %77, %76, %74, %66, %31, %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %323 = load i64, ptr %3, align 8
  ret i64 %323
}

declare ptr @NetbufGetByte(ptr noundef, i32 noundef, ptr noundef) #2

declare zeroext i16 @SwapBytes16(i16 noundef zeroext) #2

declare i32 @SwapBytes32(i32 noundef) #2

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

declare i32 @NetbufTrim(ptr noundef, i32 noundef, i8 noundef zeroext) #2

declare void @NetbufQueAppend(ptr noundef, ptr noundef) #2

declare i64 @IScsiCHAPOnRspReceived(ptr noundef) #2

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !6, i64 32}
!12 = !{!"_ISCSI_CONNECTION", !13, i64 0, !14, 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, !15, i64 48, !13, i64 52, !16, i64 56, !7, i64 112, !17, i64 120, !13, i64 288, !13, i64 292, !13, i64 296}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!15 = !{!"short", !7, i64 0}
!16 = !{!"", !13, i64 0, !10, i64 8, !14, i64 16, !14, i64 32, !13, i64 48, !13, i64 52}
!17 = !{!"", !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}
!18 = !{!19, !7, i64 0}
!19 = !{!"_ISCSI_LOGIN_RESPONSE", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 8, !15, i64 14, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !7, i64 36, !7, i64 37, !7, i64 38}
!20 = !{!7, !7, i64 0}
!21 = !{!13, !13, i64 0}
!22 = !{!19, !7, i64 36}
!23 = !{!24, !7, i64 1}
!24 = !{!"_ISCSI_BASIC_HEADER", !7, i64 0, !7, i64 1, !15, i64 2, !7, i64 4, !7, i64 5, !7, i64 8, !13, i64 16, !7, i64 20}
!25 = !{!19, !7, i64 1}
!26 = !{!19, !13, i64 16}
!27 = !{!12, !7, i64 41}
!28 = !{!12, !7, i64 46}
!29 = !{!12, !7, i64 42}
!30 = !{!31, !13, i64 2144}
!31 = !{!"_ISCSI_SESSION", !13, i64 0, !6, i64 8, !6, i64 16, !7, i64 24, !7, i64 32, !7, i64 2120, !7, i64 2121, !15, i64 2128, !13, i64 2132, !13, i64 2136, !13, i64 2140, !13, i64 2144, !15, i64 2148, !14, i64 2152, !13, i64 2168, !14, i64 2176, !15, i64 2192, !13, i64 2196, !7, i64 2200, !7, i64 2201, !13, i64 2204, !13, i64 2208, !13, i64 2212, !13, i64 2216, !15, i64 2220, !7, i64 2222, !7, i64 2223, !7, i64 2224}
!32 = !{!19, !13, i64 24}
!33 = !{!19, !13, i64 28}
!34 = !{!19, !13, i64 32}
!35 = !{!12, !7, i64 43}
!36 = !{!31, !7, i64 2120}
!37 = !{!31, !13, i64 2132}
!38 = !{!12, !13, i64 52}
!39 = !{!31, !13, i64 2140}
!40 = !{!31, !13, i64 2136}
!41 = !{!42, !10, i64 8}
!42 = !{!"", !13, i64 0, !10, i64 8, !14, i64 16, !7, i64 32, !6, i64 40, !6, i64 48, !7, i64 56, !6, i64 120, !13, i64 128, !13, i64 132, !7, i64 136}
!43 = !{!12, !7, i64 45}
!44 = !{!31, !7, i64 24}
!45 = !{!12, !7, i64 47}
!46 = !{!19, !15, i64 14}
!47 = !{!31, !15, i64 2128}


; 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 void @NetbufQueFlush(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local i64 @IScsiProcessLoginRsp(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 32
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = tail call ptr @NetbufGetByte(ptr noundef %1, i32 noundef 0, ptr noundef null) #2
  %6 = icmp eq ptr %5, null
  br i1 %6, label %133, label %7

7:                                                ; preds = %2
  %8 = load i8, ptr %5, align 4, !tbaa !16
  %9 = and i8 %8, 63
  %10 = icmp eq i8 %9, 35
  br i1 %10, label %11, label %133

11:                                               ; preds = %7
  %12 = getelementptr inbounds i8, ptr %5, i64 5
  %13 = load i8, ptr %12, align 1, !tbaa !18
  %14 = zext i8 %13 to i32
  %15 = shl nuw nsw i32 %14, 16
  %16 = getelementptr inbounds i8, ptr %5, i64 6
  %17 = load i8, ptr %16, align 1, !tbaa !18
  %18 = zext i8 %17 to i32
  %19 = shl nuw nsw i32 %18, 8
  %20 = or disjoint i32 %19, %15
  %21 = getelementptr inbounds i8, ptr %5, i64 7
  %22 = load i8, ptr %21, align 1, !tbaa !18
  %23 = zext i8 %22 to i32
  %24 = or disjoint i32 %20, %23
  %.not = icmp eq i32 %24, 0
  br i1 %.not, label %27, label %25

25:                                               ; preds = %11
  %26 = tail call ptr @NetbufGetByte(ptr noundef %1, i32 noundef 48, ptr noundef null) #2
  br label %27

27:                                               ; preds = %11, %25
  %.089 = phi ptr [ %26, %25 ], [ null, %11 ]
  %28 = getelementptr inbounds i8, ptr %5, i64 36
  %29 = load i8, ptr %28, align 4, !tbaa !19
  switch i8 %29, label %133 [
    i8 0, label %35
    i8 1, label %30
  ]

30:                                               ; preds = %27
  %31 = icmp eq ptr %.089, null
  br i1 %31, label %133, label %32

32:                                               ; preds = %30
  %33 = tail call i64 @IScsiUpdateTargetAddress(ptr noundef %4, ptr noundef nonnull %.089, i32 noundef %24)
  %34 = icmp slt i64 %33, 0
  %. = select i1 %34, i64 %33, i64 -9223372036854775795
  br label %133

35:                                               ; preds = %27
  %36 = getelementptr inbounds i8, ptr %5, i64 1
  %37 = load i8, ptr %36, align 1, !tbaa !18
  %38 = lshr i8 %37, 6
  %.lobit98 = and i8 %38, 1
  %39 = and i8 %37, 3
  %40 = getelementptr inbounds i8, ptr %5, i64 16
  %41 = load i32, ptr %40, align 4, !tbaa !20
  %42 = tail call i32 @SwapBytes32(i32 noundef %41) #2
  store i32 %42, ptr %40, align 4, !tbaa !20
  %43 = icmp slt i8 %37, 0
  %44 = icmp ne i8 %.lobit98, 0
  %or.cond = select i1 %43, i1 %44, i1 false
  br i1 %or.cond, label %133, label %45

45:                                               ; preds = %35
  %46 = lshr i8 %37, 2
  %47 = and i8 %46, 3
  %48 = getelementptr inbounds i8, ptr %0, i64 41
  %49 = load i8, ptr %48, align 1, !tbaa !21
  %.not99 = icmp eq i8 %47, %49
  br i1 %.not99, label %50, label %133

50:                                               ; preds = %45
  %51 = getelementptr inbounds i8, ptr %0, i64 46
  %52 = load i8, ptr %51, align 2, !tbaa !22
  %53 = icmp eq i8 %52, 0
  %or.cond5 = and i1 %43, %53
  br i1 %or.cond5, label %133, label %54

54:                                               ; preds = %50
  br i1 %43, label %55, label %58

55:                                               ; preds = %54
  %56 = getelementptr inbounds i8, ptr %0, i64 42
  %57 = load i8, ptr %56, align 2, !tbaa !23
  %.not100 = icmp eq i8 %39, %57
  br i1 %.not100, label %58, label %133

58:                                               ; preds = %55, %54
  %59 = getelementptr inbounds i8, ptr %4, i64 2121
  %60 = getelementptr inbounds i8, ptr %5, i64 8
  %61 = tail call i64 @CompareMem(ptr noundef nonnull %59, ptr noundef nonnull %60, i64 noundef 6) #2
  %.not101 = icmp eq i64 %61, 0
  br i1 %.not101, label %62, label %133

62:                                               ; preds = %58
  %63 = load i32, ptr %40, align 4, !tbaa !20
  %64 = getelementptr inbounds i8, ptr %4, i64 2144
  %65 = load i32, ptr %64, align 8, !tbaa !24
  %.not102 = icmp eq i32 %63, %65
  br i1 %.not102, label %66, label %133

66:                                               ; preds = %62
  %67 = getelementptr inbounds i8, ptr %5, i64 24
  %68 = load i32, ptr %67, align 4, !tbaa !26
  %69 = tail call i32 @SwapBytes32(i32 noundef %68) #2
  store i32 %69, ptr %67, align 4, !tbaa !26
  %70 = getelementptr inbounds i8, ptr %5, i64 28
  %71 = load i32, ptr %70, align 4, !tbaa !27
  %72 = tail call i32 @SwapBytes32(i32 noundef %71) #2
  store i32 %72, ptr %70, align 4, !tbaa !27
  %73 = getelementptr inbounds i8, ptr %5, i64 32
  %74 = load i32, ptr %73, align 4, !tbaa !28
  %75 = tail call i32 @SwapBytes32(i32 noundef %74) #2
  store i32 %75, ptr %73, align 4, !tbaa !28
  %76 = load i8, ptr %48, align 1, !tbaa !21
  %77 = icmp eq i8 %76, 0
  br i1 %77, label %78, label %95

78:                                               ; preds = %66
  %79 = getelementptr inbounds i8, ptr %0, i64 43
  %80 = load i8, ptr %79, align 1, !tbaa !29
  %81 = icmp eq i8 %80, 0
  br i1 %81, label %82, label %95

82:                                               ; preds = %78
  %83 = getelementptr inbounds i8, ptr %4, i64 2120
  %84 = load i8, ptr %83, align 8, !tbaa !30
  %85 = icmp eq i8 %84, 0
  %.pre = load i32, ptr %70, align 4, !tbaa !27
  br i1 %85, label %86, label %89

86:                                               ; preds = %82
  %87 = getelementptr inbounds i8, ptr %4, i64 2132
  %88 = load i32, ptr %87, align 4, !tbaa !31
  %.not103 = icmp eq i32 %88, %.pre
  br i1 %.not103, label %89, label %133

89:                                               ; preds = %86, %82
  %90 = load i32, ptr %67, align 4, !tbaa !26
  %91 = add i32 %90, 1
  %92 = getelementptr inbounds i8, ptr %0, i64 52
  store i32 %91, ptr %92, align 4, !tbaa !32
  %93 = getelementptr inbounds i8, ptr %4, i64 2140
  store i32 %75, ptr %93, align 4, !tbaa !33
  %94 = getelementptr inbounds i8, ptr %4, i64 2136
  store i32 %.pre, ptr %94, align 8, !tbaa !34
  br label %103

95:                                               ; preds = %78, %66
  %96 = getelementptr inbounds i8, ptr %0, i64 52
  %97 = load i32, ptr %67, align 4, !tbaa !26
  %98 = tail call i64 @IScsiCheckSN(ptr noundef nonnull %96, i32 noundef %97)
  %99 = icmp slt i64 %98, 0
  br i1 %99, label %133, label %100

100:                                              ; preds = %95
  %101 = load i32, ptr %73, align 4, !tbaa !28
  %102 = load i32, ptr %70, align 4, !tbaa !27
  tail call void @IScsiUpdateCmdSN(ptr noundef nonnull %4, i32 noundef %101, i32 noundef %102)
  br label %103

103:                                              ; preds = %100, %89
  %.090 = phi i64 [ 0, %89 ], [ %98, %100 ]
  %104 = tail call i32 @NetbufTrim(ptr noundef %1, i32 noundef 48, i8 noundef zeroext 1) #2
  %105 = getelementptr inbounds i8, ptr %1, i64 8
  %106 = load i64, ptr %105, align 8, !tbaa !35
  %107 = add nsw i64 %106, 1
  store i64 %107, ptr %105, align 8, !tbaa !35
  %108 = getelementptr inbounds i8, ptr %0, i64 56
  tail call void @NetbufQueAppend(ptr noundef nonnull %108, ptr noundef %1) #2
  %109 = getelementptr inbounds i8, ptr %0, i64 45
  store i8 %.lobit98, ptr %109, align 1, !tbaa !37
  %.not104 = icmp eq i8 %.lobit98, 0
  br i1 %.not104, label %110, label %133

110:                                              ; preds = %103
  switch i8 %47, label %.thread [
    i8 0, label %111
    i8 1, label %116
  ]

111:                                              ; preds = %110
  %112 = getelementptr inbounds i8, ptr %4, i64 24
  %113 = load i8, ptr %112, align 8, !tbaa !38
  %.not105 = icmp eq i8 %113, 2
  br i1 %.not105, label %121, label %114

114:                                              ; preds = %111
  %115 = tail call i64 @IScsiCHAPOnRspReceived(ptr noundef nonnull %0) #2
  br label %121

116:                                              ; preds = %110
  %117 = tail call i64 @IScsiCheckOpParams(ptr noundef nonnull %0)
  %118 = icmp slt i64 %117, 0
  br i1 %118, label %.thread, label %119

119:                                              ; preds = %116
  %120 = getelementptr inbounds i8, ptr %0, i64 47
  store i8 1, ptr %120, align 1, !tbaa !39
  br label %121

121:                                              ; preds = %119, %111, %114
  %.1 = phi i64 [ %117, %119 ], [ %115, %114 ], [ %.090, %111 ]
  %122 = icmp eq i64 %.1, 0
  %or.cond7 = select i1 %43, i1 %122, i1 false
  br i1 %or.cond7, label %123, label %.thread

123:                                              ; preds = %121
  %124 = getelementptr inbounds i8, ptr %0, i64 42
  %125 = load i8, ptr %124, align 2, !tbaa !23
  store i8 %125, ptr %48, align 1, !tbaa !21
  %126 = icmp eq i8 %125, 1
  br i1 %126, label %127, label %128

127:                                              ; preds = %123
  store i8 3, ptr %124, align 2, !tbaa !23
  br label %.thread

128:                                              ; preds = %123
  %129 = getelementptr inbounds i8, ptr %5, i64 14
  %130 = load i16, ptr %129, align 2, !tbaa !40
  %131 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %130) #2
  %132 = getelementptr inbounds i8, ptr %4, i64 2128
  store i16 %131, ptr %132, align 8, !tbaa !41
  br label %.thread

.thread:                                          ; preds = %110, %116, %127, %128, %121
  %.1108 = phi i64 [ 0, %127 ], [ 0, %128 ], [ %.1, %121 ], [ -9223372036854775784, %110 ], [ %117, %116 ]
  tail call void @NetbufQueFlush(ptr noundef nonnull %108) #2
  br label %133

133:                                              ; preds = %103, %95, %86, %45, %55, %58, %62, %35, %50, %27, %32, %30, %7, %2, %.thread
  %.0 = phi i64 [ %.1108, %.thread ], [ -9223372036854775784, %2 ], [ -9223372036854775784, %7 ], [ -9223372036854775784, %30 ], [ %., %32 ], [ -9223372036854775784, %27 ], [ -9223372036854775784, %50 ], [ -9223372036854775784, %35 ], [ -9223372036854775784, %62 ], [ -9223372036854775784, %58 ], [ -9223372036854775784, %55 ], [ -9223372036854775784, %45 ], [ -9223372036854775784, %86 ], [ %98, %95 ], [ 0, %103 ]
  ret i64 %.0
}

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

declare zeroext i16 @SwapBytes16(i16 noundef zeroext) local_unnamed_addr #1

declare i32 @SwapBytes32(i32 noundef) local_unnamed_addr #1

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

declare i32 @NetbufTrim(ptr noundef, i32 noundef, i8 noundef zeroext) local_unnamed_addr #1

declare void @NetbufQueAppend(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i64 @IScsiCHAPOnRspReceived(ptr noundef) local_unnamed_addr #1

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

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, !11, i64 32}
!6 = !{!"_ISCSI_CONNECTION", !7, i64 0, !10, i64 8, !11, i64 24, !11, 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, !12, i64 48, !7, i64 52, !13, i64 56, !8, i64 112, !15, i64 120, !7, i64 288, !7, i64 292, !7, i64 296}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_LIST_ENTRY", !11, i64 0, !11, i64 8}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!"", !7, i64 0, !14, i64 8, !10, i64 16, !10, i64 32, !7, i64 48, !7, i64 52}
!14 = !{!"long long", !8, i64 0}
!15 = !{!"", !8, i64 0, !11, i64 8, !11, i64 16, !11, 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}
!16 = !{!17, !8, i64 0}
!17 = !{!"_ISCSI_LOGIN_RESPONSE", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 8, !12, i64 14, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !8, i64 36, !8, i64 37, !8, i64 38}
!18 = !{!8, !8, i64 0}
!19 = !{!17, !8, i64 36}
!20 = !{!17, !7, i64 16}
!21 = !{!6, !8, i64 41}
!22 = !{!6, !8, i64 46}
!23 = !{!6, !8, i64 42}
!24 = !{!25, !7, i64 2144}
!25 = !{!"_ISCSI_SESSION", !7, i64 0, !11, i64 8, !11, i64 16, !8, i64 24, !8, i64 32, !8, i64 2120, !8, i64 2121, !12, i64 2128, !7, i64 2132, !7, i64 2136, !7, i64 2140, !7, i64 2144, !12, i64 2148, !10, i64 2152, !7, i64 2168, !10, i64 2176, !12, i64 2192, !7, i64 2196, !8, i64 2200, !8, i64 2201, !7, i64 2204, !7, i64 2208, !7, i64 2212, !7, i64 2216, !12, i64 2220, !8, i64 2222, !8, i64 2223, !8, i64 2224}
!26 = !{!17, !7, i64 24}
!27 = !{!17, !7, i64 28}
!28 = !{!17, !7, i64 32}
!29 = !{!6, !8, i64 43}
!30 = !{!25, !8, i64 2120}
!31 = !{!25, !7, i64 2132}
!32 = !{!6, !7, i64 52}
!33 = !{!25, !7, i64 2140}
!34 = !{!25, !7, i64 2136}
!35 = !{!36, !14, i64 8}
!36 = !{!"", !7, i64 0, !14, i64 8, !10, i64 16, !8, i64 32, !11, i64 40, !11, i64 48, !8, i64 56, !11, i64 120, !7, i64 128, !7, i64 132, !8, i64 136}
!37 = !{!6, !8, i64 45}
!38 = !{!25, !8, i64 24}
!39 = !{!6, !8, i64 47}
!40 = !{!17, !12, i64 14}
!41 = !{!25, !12, i64 2128}


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