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

; 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, i16, i32, %struct.NET_BUF_QUEUE, %struct._TCP4_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._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_SESSION = type { i32, %struct._ISCSI_SESSION_CONFIG_DATA, %struct._ISCSI_CHAP_AUTH_DATA, [224 x i8], i64, 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 }
%struct._ISCSI_SESSION_CONFIG_DATA = type { %struct.ISCSI_SESSION_CONFIG_NVDATA, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS }
%struct.ISCSI_SESSION_CONFIG_NVDATA = type <{ i8, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i8, [224 x i8], %struct.EFI_IPv4_ADDRESS, i16, [8 x i8], [6 x i8] }>
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct._ISCSI_CHAP_AUTH_DATA = type { %struct._ISCSI_CHAP_AUTH_CONFIG_NVDATA, i32, [1024 x i8], i32, [16 x i8], i32, [1024 x i8], i32 }
%struct._ISCSI_CHAP_AUTH_CONFIG_NVDATA = type { i8, [127 x i8], [17 x i8], [127 x i8], [17 x i8] }

@.str = external hidden unnamed_addr constant [153 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i64 @IScsiCHAPCalculateResponse(i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 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

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

declare i64 @AsciiStrLen(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i64 @IScsiCHAPOnRspReceived(ptr noundef %0) #0 {
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %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 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 [16 x i8], align 16
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  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 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  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 16, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  br label %19

19:                                               ; preds = %1
  %20 = call zeroext i8 @DebugAssertEnabled()
  %21 = icmp ne i8 %20, 0
  br i1 %21, label %22, label %30

22:                                               ; preds = %19
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %23, i32 0, i32 5
  %25 = load i8, ptr %24, align 1, !tbaa !9
  %26 = zext i8 %25 to i32
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %29, label %28

28:                                               ; preds = %22
  call void @DebugAssert(ptr noundef @.str, i64 noundef 145, ptr noundef @.str.1)
  br label %29

29:                                               ; preds = %28, %22
  br label %30

30:                                               ; preds = %29, %19
  br label %31

31:                                               ; preds = %30
  br label %32

32:                                               ; preds = %31
  br label %33

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

36:                                               ; preds = %33
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %37, i32 0, i32 13
  %39 = getelementptr inbounds %struct.NET_BUF_QUEUE, ptr %38, i32 0, i32 5
  %40 = load i32, ptr %39, align 4, !tbaa !20
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %43, label %42

42:                                               ; preds = %36
  call void @DebugAssert(ptr noundef @.str, i64 noundef 146, ptr noundef @.str.2)
  br label %43

43:                                               ; preds = %42, %36
  br label %44

44:                                               ; preds = %43, %33
  br label %45

45:                                               ; preds = %44
  br label %46

46:                                               ; preds = %45
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %47, i32 0, i32 3
  %49 = load ptr, ptr %48, align 8, !tbaa !21
  store ptr %49, ptr %5, align 8, !tbaa !5
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %50, i32 0, i32 2
  store ptr %51, ptr %6, align 8, !tbaa !5
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %52, i32 0, i32 13
  %54 = getelementptr inbounds %struct.NET_BUF_QUEUE, ptr %53, i32 0, i32 4
  %55 = load i32, ptr %54, align 8, !tbaa !22
  store i32 %55, ptr %9, align 4, !tbaa !23
  %56 = load i32, ptr %9, align 4, !tbaa !23
  %57 = zext i32 %56 to i64
  %58 = call ptr @AllocatePool(i64 noundef %57)
  store ptr %58, ptr %8, align 8, !tbaa !5
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = icmp eq ptr %59, null
  br i1 %60, label %61, label %62

61:                                               ; preds = %46
  store i64 -9223372036854775799, ptr %2, align 8
  store i32 1, ptr %18, align 4
  br label %227

62:                                               ; preds = %46
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %63, i32 0, i32 13
  %65 = load i32, ptr %9, align 4, !tbaa !23
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = call i32 @NetbufQueCopy(ptr noundef %64, i32 noundef 0, i32 noundef %65, ptr noundef %66)
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = load i32, ptr %9, align 4, !tbaa !23
  %70 = call ptr @IScsiBuildKeyValueList(ptr noundef %68, i32 noundef %69)
  store ptr %70, ptr %10, align 8, !tbaa !5
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  %72 = icmp eq ptr %71, null
  br i1 %72, label %73, label %75

73:                                               ; preds = %62
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  call void @FreePool(ptr noundef %74)
  store i64 -9223372036854775799, ptr %2, align 8
  store i32 1, ptr %18, align 4
  br label %227

75:                                               ; preds = %62
  store i64 -9223372036854775784, ptr %4, align 8, !tbaa !24
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %76, i32 0, i32 7
  %78 = load i8, ptr %77, align 1, !tbaa !25
  %79 = zext i8 %78 to i32
  switch i32 %79, label %221 [
    i32 0, label %80
    i32 2, label %122
    i32 3, label %186
    i32 4, label %187
  ]

80:                                               ; preds = %75
  %81 = load ptr, ptr %10, align 8, !tbaa !5
  %82 = call ptr @IScsiGetValueByKeyFromList(ptr noundef %81, ptr noundef @.str.3)
  store ptr %82, ptr %7, align 8, !tbaa !5
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = icmp eq ptr %83, null
  br i1 %84, label %85, label %86

85:                                               ; preds = %80
  br label %223

86:                                               ; preds = %80
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = call i64 @AsciiStrDecimalToUintn(ptr noundef %87)
  %89 = trunc i64 %88 to i16
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._ISCSI_SESSION, ptr %90, i32 0, i32 16
  store i16 %89, ptr %91, align 8, !tbaa !26
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  %93 = call ptr @IScsiGetValueByKeyFromList(ptr noundef %92, ptr noundef @.str.4)
  store ptr %93, ptr %7, align 8, !tbaa !5
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = icmp eq ptr %94, null
  br i1 %95, label %96, label %97

96:                                               ; preds = %86
  br label %223

97:                                               ; preds = %86
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = call i64 @AsciiStrCmp(ptr noundef %98, ptr noundef @.str.5)
  %100 = icmp eq i64 %99, 0
  br i1 %100, label %101, label %110

101:                                              ; preds = %97
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct._ISCSI_CHAP_AUTH_DATA, ptr %102, i32 0, i32 0
  %104 = getelementptr inbounds %struct._ISCSI_CHAP_AUTH_CONFIG_NVDATA, ptr %103, i32 0, i32 0
  %105 = load i8, ptr %104, align 4, !tbaa !33
  %106 = zext i8 %105 to i32
  %107 = icmp eq i32 %106, 0
  br i1 %107, label %108, label %109

108:                                              ; preds = %101
  br label %223

109:                                              ; preds = %101
  br label %119

110:                                              ; preds = %97
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._ISCSI_CHAP_AUTH_DATA, ptr %111, i32 0, i32 0
  %113 = getelementptr inbounds %struct._ISCSI_CHAP_AUTH_CONFIG_NVDATA, ptr %112, i32 0, i32 0
  %114 = load i8, ptr %113, align 4, !tbaa !33
  %115 = zext i8 %114 to i32
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %118

117:                                              ; preds = %110
  br label %223

118:                                              ; preds = %110
  br label %119

119:                                              ; preds = %118, %109
  %120 = load ptr, ptr %3, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %120, i32 0, i32 7
  store i8 1, ptr %121, align 1, !tbaa !25
  store i64 0, ptr %4, align 8, !tbaa !24
  br label %222

122:                                              ; preds = %75
  %123 = load ptr, ptr %10, align 8, !tbaa !5
  %124 = call ptr @IScsiGetValueByKeyFromList(ptr noundef %123, ptr noundef @.str.6)
  store ptr %124, ptr %7, align 8, !tbaa !5
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = icmp eq ptr %125, null
  br i1 %126, label %127, label %128

127:                                              ; preds = %122
  br label %223

128:                                              ; preds = %122
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = call i64 @AsciiStrDecimalToUintn(ptr noundef %129)
  store i64 %130, ptr %11, align 8, !tbaa !24
  %131 = load i64, ptr %11, align 8, !tbaa !24
  %132 = icmp ne i64 %131, 5
  br i1 %132, label %133, label %134

133:                                              ; preds = %128
  br label %223

134:                                              ; preds = %128
  %135 = load ptr, ptr %10, align 8, !tbaa !5
  %136 = call ptr @IScsiGetValueByKeyFromList(ptr noundef %135, ptr noundef @.str.7)
  store ptr %136, ptr %12, align 8, !tbaa !5
  %137 = load ptr, ptr %12, align 8, !tbaa !5
  %138 = icmp eq ptr %137, null
  br i1 %138, label %139, label %140

139:                                              ; preds = %134
  br label %223

140:                                              ; preds = %134
  %141 = load ptr, ptr %10, align 8, !tbaa !5
  %142 = call ptr @IScsiGetValueByKeyFromList(ptr noundef %141, ptr noundef @.str.8)
  store ptr %142, ptr %13, align 8, !tbaa !5
  %143 = load ptr, ptr %13, align 8, !tbaa !5
  %144 = icmp eq ptr %143, null
  br i1 %144, label %145, label %146

145:                                              ; preds = %140
  br label %223

146:                                              ; preds = %140
  %147 = load ptr, ptr %12, align 8, !tbaa !5
  %148 = call i64 @AsciiStrDecimalToUintn(ptr noundef %147)
  %149 = trunc i64 %148 to i32
  %150 = load ptr, ptr %6, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct._ISCSI_CHAP_AUTH_DATA, ptr %150, i32 0, i32 1
  store i32 %149, ptr %151, align 4, !tbaa !34
  %152 = load ptr, ptr %6, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct._ISCSI_CHAP_AUTH_DATA, ptr %152, i32 0, i32 3
  store i32 1024, ptr %153, align 4, !tbaa !35
  %154 = load ptr, ptr %6, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct._ISCSI_CHAP_AUTH_DATA, ptr %154, i32 0, i32 2
  %156 = getelementptr inbounds [1024 x i8], ptr %155, i64 0, i64 0
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct._ISCSI_CHAP_AUTH_DATA, ptr %157, i32 0, i32 3
  %159 = load ptr, ptr %13, align 8, !tbaa !5
  %160 = call i64 @IScsiHexToBin(ptr noundef %156, ptr noundef %158, ptr noundef %159)
  %161 = load ptr, ptr %6, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct._ISCSI_CHAP_AUTH_DATA, ptr %161, i32 0, i32 1
  %163 = load i32, ptr %162, align 4, !tbaa !34
  %164 = load ptr, ptr %6, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct._ISCSI_CHAP_AUTH_DATA, ptr %164, i32 0, i32 0
  %166 = getelementptr inbounds %struct._ISCSI_CHAP_AUTH_CONFIG_NVDATA, ptr %165, i32 0, i32 2
  %167 = getelementptr inbounds [17 x i8], ptr %166, i64 0, i64 0
  %168 = load ptr, ptr %6, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct._ISCSI_CHAP_AUTH_DATA, ptr %168, i32 0, i32 0
  %170 = getelementptr inbounds %struct._ISCSI_CHAP_AUTH_CONFIG_NVDATA, ptr %169, i32 0, i32 2
  %171 = getelementptr inbounds [17 x i8], ptr %170, i64 0, i64 0
  %172 = call i64 @AsciiStrLen(ptr noundef %171)
  %173 = trunc i64 %172 to i32
  %174 = load ptr, ptr %6, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct._ISCSI_CHAP_AUTH_DATA, ptr %174, i32 0, i32 2
  %176 = getelementptr inbounds [1024 x i8], ptr %175, i64 0, i64 0
  %177 = load ptr, ptr %6, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct._ISCSI_CHAP_AUTH_DATA, ptr %177, i32 0, i32 3
  %179 = load i32, ptr %178, align 4, !tbaa !35
  %180 = load ptr, ptr %6, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct._ISCSI_CHAP_AUTH_DATA, ptr %180, i32 0, i32 4
  %182 = getelementptr inbounds [16 x i8], ptr %181, i64 0, i64 0
  %183 = call i64 @IScsiCHAPCalculateResponse(i32 noundef %163, ptr noundef %167, i32 noundef %173, ptr noundef %176, i32 noundef %179, ptr noundef %182)
  store i64 %183, ptr %4, align 8, !tbaa !24
  %184 = load ptr, ptr %3, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct._ISCSI_CONNECTION, ptr %184, i32 0, i32 7
  store i8 3, ptr %185, align 1, !tbaa !25
  br label %222

186:                                              ; preds = %75
  store i64 0, ptr %4, align 8, !tbaa !24
  br label %222

187:                                              ; preds = %75
  br label %188

188:                                              ; preds = %187
  %189 = call zeroext i8 @DebugAssertEnabled()
  %190 = icmp ne i8 %189, 0
  br i1 %190, label %191, label %200

191:                                              ; preds = %188
  %192 = load ptr, ptr %6, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct._ISCSI_CHAP_AUTH_DATA, ptr %192, i32 0, i32 0
  %194 = getelementptr inbounds %struct._ISCSI_CHAP_AUTH_CONFIG_NVDATA, ptr %193, i32 0, i32 0
  %195 = load i8, ptr %194, align 4, !tbaa !33
  %196 = zext i8 %195 to i32
  %197 = icmp eq i32 %196, 2
  br i1 %197, label %199, label %198

198:                                              ; preds = %191
  call void @DebugAssert(ptr noundef @.str, i64 noundef 265, ptr noundef @.str.9)
  br label %199

199:                                              ; preds = %198, %191
  br label %200

200:                                              ; preds = %199, %188
  br label %201

201:                                              ; preds = %200
  br label %202

202:                                              ; preds = %201
  %203 = load ptr, ptr %10, align 8, !tbaa !5
  %204 = call ptr @IScsiGetValueByKeyFromList(ptr noundef %203, ptr noundef @.str.10)
  store ptr %204, ptr %14, align 8, !tbaa !5
  %205 = load ptr, ptr %14, align 8, !tbaa !5
  %206 = icmp eq ptr %205, null
  br i1 %206, label %207, label %208

207:                                              ; preds = %202
  br label %223

208:                                              ; preds = %202
  %209 = load ptr, ptr %10, align 8, !tbaa !5
  %210 = call ptr @IScsiGetValueByKeyFromList(ptr noundef %209, ptr noundef @.str.11)
  store ptr %210, ptr %15, align 8, !tbaa !5
  %211 = load ptr, ptr %15, align 8, !tbaa !5
  %212 = icmp eq ptr %211, null
  br i1 %212, label %213, label %214

213:                                              ; preds = %208
  br label %223

214:                                              ; preds = %208
  store i32 16, ptr %17, align 4, !tbaa !23
  %215 = getelementptr inbounds [16 x i8], ptr %16, i64 0, i64 0
  %216 = load ptr, ptr %15, align 8, !tbaa !5
  %217 = call i64 @IScsiHexToBin(ptr noundef %215, ptr noundef %17, ptr noundef %216)
  %218 = load ptr, ptr %6, align 8, !tbaa !5
  %219 = getelementptr inbounds [16 x i8], ptr %16, i64 0, i64 0
  %220 = call i64 @IScsiCHAPAuthTarget(ptr noundef %218, ptr noundef %219)
  store i64 %220, ptr %4, align 8, !tbaa !24
  br label %222

221:                                              ; preds = %75
  br label %222

222:                                              ; preds = %221, %214, %186, %146, %119
  br label %223

223:                                              ; preds = %222, %213, %207, %145, %139, %133, %127, %117, %108, %96, %85
  %224 = load ptr, ptr %10, align 8, !tbaa !5
  call void @IScsiFreeKeyValueList(ptr noundef %224)
  %225 = load ptr, ptr %8, align 8, !tbaa !5
  call void @FreePool(ptr noundef %225)
  %226 = load i64, ptr %4, align 8, !tbaa !24
  store i64 %226, ptr %2, align 8
  store i32 1, ptr %18, align 4
  br label %227

227:                                              ; preds = %223, %73, %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 16, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %228 = load i64, ptr %2, align 8
  ret i64 %228
}

declare zeroext i8 @DebugAssertEnabled() #2

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

declare ptr @AllocatePool(i64 noundef) #2

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

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

declare void @FreePool(ptr noundef) #2

declare ptr @IScsiGetValueByKeyFromList(ptr noundef, ptr noundef) #2

declare i64 @AsciiStrDecimalToUintn(ptr noundef) #2

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

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

declare void @IScsiFreeKeyValueList(ptr noundef) #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !7, i64 41}
!10 = !{!"_ISCSI_CONNECTION", !11, i64 0, !12, 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, !13, i64 48, !11, i64 52, !14, i64 56, !16, i64 112, !11, i64 240, !11, i64 244, !11, i64 248}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!13 = !{!"short", !7, i64 0}
!14 = !{!"", !11, i64 0, !15, i64 8, !12, i64 16, !12, i64 32, !11, i64 48, !11, i64 52}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"_TCP4_IO", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !17, i64 32, !19, i64 48, !19, i64 72, !19, i64 96, !7, i64 120, !7, i64 121, !7, i64 122, !7, i64 123}
!17 = !{!"", !18, i64 0}
!18 = !{!"", !6, i64 0, !15, i64 8}
!19 = !{!"", !18, i64 0, !7, i64 16}
!20 = !{!10, !11, i64 108}
!21 = !{!10, !6, i64 32}
!22 = !{!10, !11, i64 104}
!23 = !{!11, !11, i64 0}
!24 = !{!15, !15, i64 0}
!25 = !{!10, !7, i64 43}
!26 = !{!27, !13, i64 2952}
!27 = !{!"_ISCSI_SESSION", !11, i64 0, !28, i64 4, !31, i64 276, !7, i64 2648, !15, i64 2872, !7, i64 2880, !7, i64 2881, !13, i64 2888, !11, i64 2892, !11, i64 2896, !11, i64 2900, !11, i64 2904, !13, i64 2908, !12, i64 2912, !11, i64 2928, !12, i64 2936, !13, i64 2952, !11, i64 2956, !7, i64 2960, !7, i64 2961, !11, i64 2964, !11, i64 2968, !11, i64 2972, !11, i64 2976, !13, i64 2980, !7, i64 2982, !7, i64 2983, !7, i64 2984}
!28 = !{!"_ISCSI_SESSION_CONFIG_DATA", !29, i64 0, !30, i64 259, !30, i64 263, !30, i64 267}
!29 = !{!"", !7, i64 0, !7, i64 1, !30, i64 2, !30, i64 6, !30, i64 10, !7, i64 14, !7, i64 15, !30, i64 239, !13, i64 243, !7, i64 245, !7, i64 253}
!30 = !{!"", !7, i64 0}
!31 = !{!"_ISCSI_CHAP_AUTH_DATA", !32, i64 0, !11, i64 292, !7, i64 296, !11, i64 1320, !7, i64 1324, !11, i64 1340, !7, i64 1344, !11, i64 2368}
!32 = !{!"_ISCSI_CHAP_AUTH_CONFIG_NVDATA", !7, i64 0, !7, i64 1, !7, i64 128, !7, i64 145, !7, i64 272}
!33 = !{!31, !7, i64 0}
!34 = !{!31, !11, i64 292}
!35 = !{!31, !11, i64 1320}


; 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 [153 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [7 x i8], align 1

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

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

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

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

declare i64 @AsciiStrLen(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i64 @IScsiCHAPOnRspReceived(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca [16 x i8], align 16
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  %4 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %4, 0
  br i1 %.not, label %10, label %5

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %0, i64 41
  %7 = load i8, ptr %6, align 1, !tbaa !5
  %8 = icmp eq i8 %7, 0
  br i1 %8, label %10, label %9

9:                                                ; preds = %5
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 145, ptr noundef nonnull @.str.1) #3
  br label %10

10:                                               ; preds = %1, %9, %5
  %11 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not65 = icmp eq i8 %11, 0
  br i1 %.not65, label %16, label %12

12:                                               ; preds = %10
  %13 = getelementptr inbounds i8, ptr %0, i64 108
  %14 = load i32, ptr %13, align 4, !tbaa !19
  %.not66 = icmp eq i32 %14, 0
  br i1 %.not66, label %15, label %16

15:                                               ; preds = %12
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 146, ptr noundef nonnull @.str.2) #3
  br label %16

16:                                               ; preds = %12, %15, %10
  %17 = getelementptr inbounds i8, ptr %0, i64 32
  %18 = load ptr, ptr %17, align 8, !tbaa !20
  %19 = getelementptr inbounds i8, ptr %18, i64 276
  %20 = getelementptr inbounds i8, ptr %0, i64 104
  %21 = load i32, ptr %20, align 8, !tbaa !21
  %22 = zext i32 %21 to i64
  %23 = tail call ptr @AllocatePool(i64 noundef %22) #3
  %24 = icmp eq ptr %23, null
  br i1 %24, label %93, label %25

25:                                               ; preds = %16
  %26 = getelementptr inbounds i8, ptr %0, i64 56
  %27 = tail call i32 @NetbufQueCopy(ptr noundef nonnull %26, i32 noundef 0, i32 noundef %21, ptr noundef nonnull %23) #3
  %28 = tail call ptr @IScsiBuildKeyValueList(ptr noundef nonnull %23, i32 noundef %21) #3
  %29 = icmp eq ptr %28, null
  br i1 %29, label %30, label %31

30:                                               ; preds = %25
  tail call void @FreePool(ptr noundef nonnull %23) #3
  br label %93

31:                                               ; preds = %25
  %32 = getelementptr inbounds i8, ptr %0, i64 43
  %33 = load i8, ptr %32, align 1, !tbaa !22
  switch i8 %33, label %92 [
    i8 0, label %34
    i8 2, label %51
    i8 3, label %76
    i8 4, label %77
  ]

34:                                               ; preds = %31
  %35 = tail call ptr @IScsiGetValueByKeyFromList(ptr noundef nonnull %28, ptr noundef nonnull @.str.3) #3
  %36 = icmp eq ptr %35, null
  br i1 %36, label %92, label %37

37:                                               ; preds = %34
  %38 = tail call i64 @AsciiStrDecimalToUintn(ptr noundef nonnull %35) #3
  %39 = trunc i64 %38 to i16
  %40 = getelementptr inbounds i8, ptr %18, i64 2952
  store i16 %39, ptr %40, align 8, !tbaa !23
  %41 = tail call ptr @IScsiGetValueByKeyFromList(ptr noundef nonnull %28, ptr noundef nonnull @.str.4) #3
  %42 = icmp eq ptr %41, null
  br i1 %42, label %92, label %43

43:                                               ; preds = %37
  %44 = tail call i64 @AsciiStrCmp(ptr noundef nonnull %41, ptr noundef nonnull @.str.5) #3
  %45 = icmp eq i64 %44, 0
  %46 = load i8, ptr %19, align 4, !tbaa !30
  %47 = icmp eq i8 %46, 0
  br i1 %45, label %48, label %49

48:                                               ; preds = %43
  br i1 %47, label %92, label %50

49:                                               ; preds = %43
  br i1 %47, label %50, label %92

50:                                               ; preds = %49, %48
  store i8 1, ptr %32, align 1, !tbaa !22
  br label %92

51:                                               ; preds = %31
  %52 = tail call ptr @IScsiGetValueByKeyFromList(ptr noundef nonnull %28, ptr noundef nonnull @.str.6) #3
  %53 = icmp eq ptr %52, null
  br i1 %53, label %92, label %54

54:                                               ; preds = %51
  %55 = tail call i64 @AsciiStrDecimalToUintn(ptr noundef nonnull %52) #3
  %.not68 = icmp eq i64 %55, 5
  br i1 %.not68, label %56, label %92

56:                                               ; preds = %54
  %57 = tail call ptr @IScsiGetValueByKeyFromList(ptr noundef nonnull %28, ptr noundef nonnull @.str.7) #3
  %58 = icmp eq ptr %57, null
  br i1 %58, label %92, label %59

59:                                               ; preds = %56
  %60 = tail call ptr @IScsiGetValueByKeyFromList(ptr noundef nonnull %28, ptr noundef nonnull @.str.8) #3
  %61 = icmp eq ptr %60, null
  br i1 %61, label %92, label %62

62:                                               ; preds = %59
  %63 = tail call i64 @AsciiStrDecimalToUintn(ptr noundef nonnull %57) #3
  %64 = trunc i64 %63 to i32
  %65 = getelementptr inbounds i8, ptr %18, i64 568
  store i32 %64, ptr %65, align 4, !tbaa !31
  %66 = getelementptr inbounds i8, ptr %18, i64 1596
  store i32 1024, ptr %66, align 4, !tbaa !32
  %67 = getelementptr inbounds i8, ptr %18, i64 572
  %68 = tail call i64 @IScsiHexToBin(ptr noundef nonnull %67, ptr noundef nonnull %66, ptr noundef nonnull %60) #3
  %69 = load i32, ptr %65, align 4, !tbaa !31
  %70 = getelementptr inbounds i8, ptr %18, i64 404
  %71 = tail call i64 @AsciiStrLen(ptr noundef nonnull %70) #3
  %72 = trunc i64 %71 to i32
  %73 = load i32, ptr %66, align 4, !tbaa !32
  %74 = getelementptr inbounds i8, ptr %18, i64 1600
  %75 = tail call i64 @IScsiCHAPCalculateResponse(i32 noundef %69, ptr noundef nonnull %70, i32 noundef %72, ptr noundef nonnull %67, i32 noundef %73, ptr noundef nonnull %74)
  store i8 3, ptr %32, align 1, !tbaa !22
  br label %92

76:                                               ; preds = %31
  br label %92

77:                                               ; preds = %31
  %78 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not67 = icmp eq i8 %78, 0
  br i1 %.not67, label %83, label %79

79:                                               ; preds = %77
  %80 = load i8, ptr %19, align 4, !tbaa !30
  %81 = icmp eq i8 %80, 2
  br i1 %81, label %83, label %82

82:                                               ; preds = %79
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 265, ptr noundef nonnull @.str.9) #3
  br label %83

83:                                               ; preds = %79, %82, %77
  %84 = tail call ptr @IScsiGetValueByKeyFromList(ptr noundef nonnull %28, ptr noundef nonnull @.str.10) #3
  %85 = icmp eq ptr %84, null
  br i1 %85, label %92, label %86

86:                                               ; preds = %83
  %87 = tail call ptr @IScsiGetValueByKeyFromList(ptr noundef nonnull %28, ptr noundef nonnull @.str.11) #3
  %88 = icmp eq ptr %87, null
  br i1 %88, label %92, label %89

89:                                               ; preds = %86
  store i32 16, ptr %3, align 4, !tbaa !33
  %90 = call i64 @IScsiHexToBin(ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %87) #3
  %91 = call i64 @IScsiCHAPAuthTarget(ptr noundef nonnull %19, ptr noundef nonnull %2)
  br label %92

92:                                               ; preds = %50, %62, %76, %89, %31, %86, %83, %59, %56, %54, %51, %49, %48, %37, %34
  %.056 = phi i64 [ -9223372036854775784, %31 ], [ -9223372036854775784, %83 ], [ -9223372036854775784, %86 ], [ %91, %89 ], [ 0, %76 ], [ -9223372036854775784, %51 ], [ -9223372036854775784, %54 ], [ -9223372036854775784, %56 ], [ -9223372036854775784, %59 ], [ %75, %62 ], [ -9223372036854775784, %34 ], [ -9223372036854775784, %37 ], [ -9223372036854775784, %48 ], [ 0, %50 ], [ -9223372036854775784, %49 ]
  call void @IScsiFreeKeyValueList(ptr noundef nonnull %28) #3
  call void @FreePool(ptr noundef nonnull %23) #3
  br label %93

93:                                               ; preds = %16, %92, %30
  %.0 = phi i64 [ -9223372036854775799, %30 ], [ %.056, %92 ], [ -9223372036854775799, %16 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #3
  ret i64 %.0
}

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #2

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

declare ptr @AllocatePool(i64 noundef) local_unnamed_addr #2

declare i32 @NetbufQueCopy(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare ptr @IScsiBuildKeyValueList(ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @FreePool(ptr noundef) local_unnamed_addr #2

declare ptr @IScsiGetValueByKeyFromList(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i64 @AsciiStrDecimalToUintn(ptr noundef) local_unnamed_addr #2

declare i64 @AsciiStrCmp(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i64 @IScsiHexToBin(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @IScsiFreeKeyValueList(ptr noundef) local_unnamed_addr #2

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 = { mustprogress 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, !8, i64 41}
!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, !12, i64 48, !7, i64 52, !13, i64 56, !15, i64 112, !7, i64 240, !7, i64 244, !7, i64 248}
!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 = !{!"_TCP4_IO", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !16, i64 32, !18, i64 48, !18, i64 72, !18, i64 96, !8, i64 120, !8, i64 121, !8, i64 122, !8, i64 123}
!16 = !{!"", !17, i64 0}
!17 = !{!"", !11, i64 0, !14, i64 8}
!18 = !{!"", !17, i64 0, !8, i64 16}
!19 = !{!6, !7, i64 108}
!20 = !{!6, !11, i64 32}
!21 = !{!6, !7, i64 104}
!22 = !{!6, !8, i64 43}
!23 = !{!24, !12, i64 2952}
!24 = !{!"_ISCSI_SESSION", !7, i64 0, !25, i64 4, !28, i64 276, !8, i64 2648, !14, i64 2872, !8, i64 2880, !8, i64 2881, !12, i64 2888, !7, i64 2892, !7, i64 2896, !7, i64 2900, !7, i64 2904, !12, i64 2908, !10, i64 2912, !7, i64 2928, !10, i64 2936, !12, i64 2952, !7, i64 2956, !8, i64 2960, !8, i64 2961, !7, i64 2964, !7, i64 2968, !7, i64 2972, !7, i64 2976, !12, i64 2980, !8, i64 2982, !8, i64 2983, !8, i64 2984}
!25 = !{!"_ISCSI_SESSION_CONFIG_DATA", !26, i64 0, !27, i64 259, !27, i64 263, !27, i64 267}
!26 = !{!"", !8, i64 0, !8, i64 1, !27, i64 2, !27, i64 6, !27, i64 10, !8, i64 14, !8, i64 15, !27, i64 239, !12, i64 243, !8, i64 245, !8, i64 253}
!27 = !{!"", !8, i64 0}
!28 = !{!"_ISCSI_CHAP_AUTH_DATA", !29, i64 0, !7, i64 292, !8, i64 296, !7, i64 1320, !8, i64 1324, !7, i64 1340, !8, i64 1344, !7, i64 2368}
!29 = !{!"_ISCSI_CHAP_AUTH_CONFIG_NVDATA", !8, i64 0, !8, i64 1, !8, i64 128, !8, i64 145, !8, i64 272}
!30 = !{!28, !8, i64 0}
!31 = !{!28, !7, i64 292}
!32 = !{!28, !7, i64 1320}
!33 = !{!7, !7, i64 0}


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