; LLVM IR from AngelPn/DBMS-Simulator :: src (HT)

; 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.HT_info = type { i32, i32, i8, ptr, i32, i64, i32 }
%struct.record = type { i32, [15 x i8], [25 x i8], [50 x i8] }

@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [20 x i8], align 1

declare void @BF_PrintError(ptr noundef) #0

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

declare i32 @BF_AllocateBlock(i32 noundef) #0

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

declare i32 @BF_GetBlockCounter(i32 noundef) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare i32 @BF_WriteBlock(i32 noundef, i32 noundef) #0

; 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 i32 @hash(i64 noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @HT_InsertEntry(ptr noundef byval(%struct.HT_info) align 8 %0, ptr noundef byval(%struct.record) align 8 %1) #3 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %25 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 3
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  %27 = call ptr @get_key(ptr noundef %1, ptr noundef %26)
  store ptr %27, ptr %4, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %28 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 5
  %29 = load i64, ptr %28, align 8, !tbaa !13
  %30 = load ptr, ptr %4, align 8, !tbaa !12
  %31 = call i32 @hash(i64 noundef %29, ptr noundef %30)
  store i32 %31, ptr %5, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store ptr null, ptr %6, align 8, !tbaa !12
  %32 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 1
  %33 = load i32, ptr %32, align 4, !tbaa !15
  %34 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 6
  %35 = load i32, ptr %34, align 8, !tbaa !16
  %36 = call i32 @BF_ReadBlock(i32 noundef %33, i32 noundef %35, ptr noundef %6)
  %37 = icmp slt i32 %36, 0
  br i1 %37, label %38, label %39

38:                                               ; preds = %2
  call void @BF_PrintError(ptr noundef @.str.3)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %237

39:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %40 = load ptr, ptr %6, align 8, !tbaa !12
  %41 = getelementptr inbounds i8, ptr %40, i64 512
  %42 = getelementptr inbounds i8, ptr %41, i64 -4
  %43 = load i32, ptr %42, align 4, !tbaa !14
  store i32 %43, ptr %8, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr null, ptr %9, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 127, ptr %10, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 -1, ptr %11, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  br label %44

44:                                               ; preds = %79, %39
  %45 = load i32, ptr %8, align 4, !tbaa !14
  %46 = icmp ne i32 %45, -1
  br i1 %46, label %47, label %84

47:                                               ; preds = %44
  %48 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 1
  %49 = load i32, ptr %48, align 4, !tbaa !15
  %50 = load i32, ptr %8, align 4, !tbaa !14
  %51 = call i32 @BF_ReadBlock(i32 noundef %49, i32 noundef %50, ptr noundef %9)
  %52 = icmp slt i32 %51, 0
  br i1 %52, label %53, label %54

53:                                               ; preds = %47
  call void @BF_PrintError(ptr noundef @.str.3)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %236

54:                                               ; preds = %47
  store i32 0, ptr %12, align 4, !tbaa !14
  br label %55

55:                                               ; preds = %67, %54
  %56 = load i32, ptr %12, align 4, !tbaa !14
  %57 = load i32, ptr %10, align 4, !tbaa !14
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %59, label %70

59:                                               ; preds = %55
  %60 = load i32, ptr %11, align 4, !tbaa !14
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %11, align 4, !tbaa !14
  %62 = load i32, ptr %5, align 4, !tbaa !14
  %63 = load i32, ptr %11, align 4, !tbaa !14
  %64 = icmp eq i32 %62, %63
  br i1 %64, label %65, label %66

65:                                               ; preds = %59
  br label %70

66:                                               ; preds = %59
  br label %67

67:                                               ; preds = %66
  %68 = load i32, ptr %12, align 4, !tbaa !14
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %12, align 4, !tbaa !14
  br label %55, !llvm.loop !17

70:                                               ; preds = %65, %55
  %71 = load i32, ptr %5, align 4, !tbaa !14
  %72 = load i32, ptr %11, align 4, !tbaa !14
  %73 = icmp eq i32 %71, %72
  br i1 %73, label %74, label %79

74:                                               ; preds = %70
  %75 = load i32, ptr %12, align 4, !tbaa !14
  %76 = sext i32 %75 to i64
  %77 = mul i64 %76, 4
  %78 = trunc i64 %77 to i32
  store i32 %78, ptr %5, align 4, !tbaa !14
  br label %84

79:                                               ; preds = %70
  %80 = load ptr, ptr %9, align 8, !tbaa !12
  %81 = getelementptr inbounds i8, ptr %80, i64 512
  %82 = getelementptr inbounds i8, ptr %81, i64 -4
  %83 = load i32, ptr %82, align 4, !tbaa !14
  store i32 %83, ptr %8, align 4, !tbaa !14
  br label %44, !llvm.loop !19

84:                                               ; preds = %74, %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 -1, ptr %14, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %85 = load i32, ptr %8, align 4, !tbaa !14
  store i32 %85, ptr %15, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %86 = load ptr, ptr %9, align 8, !tbaa !12
  %87 = load i32, ptr %5, align 4, !tbaa !14
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds i8, ptr %86, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !14
  store i32 %90, ptr %16, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store ptr null, ptr %17, align 8, !tbaa !12
  br label %91

91:                                               ; preds = %147, %84
  %92 = load i32, ptr %16, align 4, !tbaa !14
  %93 = icmp ne i32 %92, -1
  br i1 %93, label %94, label %153

94:                                               ; preds = %91
  %95 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 1
  %96 = load i32, ptr %95, align 4, !tbaa !15
  %97 = load i32, ptr %16, align 4, !tbaa !14
  %98 = call i32 @BF_ReadBlock(i32 noundef %96, i32 noundef %97, ptr noundef %17)
  %99 = icmp slt i32 %98, 0
  br i1 %99, label %100, label %101

100:                                              ; preds = %94
  call void @BF_PrintError(ptr noundef @.str.3)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %235

101:                                              ; preds = %94
  %102 = load ptr, ptr %17, align 8, !tbaa !12
  %103 = getelementptr inbounds i8, ptr %102, i64 512
  %104 = getelementptr inbounds i8, ptr %103, i64 -4
  %105 = load i32, ptr %104, align 4, !tbaa !14
  store i32 %105, ptr %13, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !14
  br label %106

106:                                              ; preds = %136, %101
  %107 = load i32, ptr %18, align 4, !tbaa !14
  %108 = load i32, ptr %13, align 4, !tbaa !14
  %109 = icmp slt i32 %107, %108
  br i1 %109, label %111, label %110

110:                                              ; preds = %106
  store i32 9, ptr %7, align 4
  br label %139

111:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %112 = load ptr, ptr %17, align 8, !tbaa !12
  %113 = load i32, ptr %18, align 4, !tbaa !14
  %114 = sext i32 %113 to i64
  %115 = mul i64 %114, 96
  %116 = getelementptr inbounds i8, ptr %112, i64 %115
  store ptr %116, ptr %19, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %117 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 3
  %118 = load ptr, ptr %117, align 8, !tbaa !5
  %119 = call ptr @get_key(ptr noundef %1, ptr noundef %118)
  store ptr %119, ptr %20, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %120 = load ptr, ptr %19, align 8, !tbaa !12
  %121 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 3
  %122 = load ptr, ptr %121, align 8, !tbaa !5
  %123 = call ptr @get_key(ptr noundef %120, ptr noundef %122)
  store ptr %123, ptr %21, align 8, !tbaa !12
  %124 = load ptr, ptr %20, align 8, !tbaa !12
  %125 = load ptr, ptr %21, align 8, !tbaa !12
  %126 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 4
  %127 = load i32, ptr %126, align 8, !tbaa !20
  %128 = sext i32 %127 to i64
  %129 = call i32 @memcmp(ptr noundef %124, ptr noundef %125, i64 noundef %128) #6
  %130 = icmp eq i32 %129, 0
  br i1 %130, label %131, label %132

131:                                              ; preds = %111
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %133

132:                                              ; preds = %111
  store i32 0, ptr %7, align 4
  br label %133

133:                                              ; preds = %132, %131
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  %134 = load i32, ptr %7, align 4
  switch i32 %134, label %139 [
    i32 0, label %135
  ]

135:                                              ; preds = %133
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %18, align 4, !tbaa !14
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %18, align 4, !tbaa !14
  br label %106, !llvm.loop !21

139:                                              ; preds = %133, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  %140 = load i32, ptr %7, align 4
  switch i32 %140, label %235 [
    i32 9, label %141
  ]

141:                                              ; preds = %139
  %142 = load i32, ptr %13, align 4, !tbaa !14
  %143 = sext i32 %142 to i64
  %144 = icmp ult i64 %143, 5
  br i1 %144, label %145, label %147

145:                                              ; preds = %141
  %146 = load i32, ptr %16, align 4, !tbaa !14
  store i32 %146, ptr %14, align 4, !tbaa !14
  br label %147

147:                                              ; preds = %145, %141
  %148 = load i32, ptr %16, align 4, !tbaa !14
  store i32 %148, ptr %15, align 4, !tbaa !14
  %149 = load ptr, ptr %17, align 8, !tbaa !12
  %150 = getelementptr inbounds i8, ptr %149, i64 512
  %151 = getelementptr inbounds i8, ptr %150, i64 -8
  %152 = load i32, ptr %151, align 4, !tbaa !14
  store i32 %152, ptr %16, align 4, !tbaa !14
  store i32 504, ptr %5, align 4, !tbaa !14
  br label %91, !llvm.loop !22

153:                                              ; preds = %91
  %154 = load i32, ptr %14, align 4, !tbaa !14
  %155 = icmp eq i32 %154, -1
  br i1 %155, label %156, label %203

156:                                              ; preds = %153
  %157 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 1
  %158 = load i32, ptr %157, align 4, !tbaa !15
  %159 = call i32 @BF_AllocateBlock(i32 noundef %158)
  %160 = icmp slt i32 %159, 0
  br i1 %160, label %161, label %162

161:                                              ; preds = %156
  call void @BF_PrintError(ptr noundef @.str.2)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %235

162:                                              ; preds = %156
  %163 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 1
  %164 = load i32, ptr %163, align 4, !tbaa !15
  %165 = call i32 @BF_GetBlockCounter(i32 noundef %164)
  %166 = sub nsw i32 %165, 1
  store i32 %166, ptr %16, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %167 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 1
  %168 = load i32, ptr %167, align 4, !tbaa !15
  %169 = load i32, ptr %16, align 4, !tbaa !14
  %170 = call i32 @BF_ReadBlock(i32 noundef %168, i32 noundef %169, ptr noundef %22)
  %171 = icmp slt i32 %170, 0
  br i1 %171, label %172, label %173

172:                                              ; preds = %162
  call void @BF_PrintError(ptr noundef @.str.3)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %200

173:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %174 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 1
  %175 = load i32, ptr %174, align 4, !tbaa !15
  %176 = load i32, ptr %15, align 4, !tbaa !14
  %177 = call i32 @BF_ReadBlock(i32 noundef %175, i32 noundef %176, ptr noundef %23)
  %178 = icmp slt i32 %177, 0
  br i1 %178, label %179, label %180

179:                                              ; preds = %173
  call void @BF_PrintError(ptr noundef @.str.3)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %199

180:                                              ; preds = %173
  %181 = load ptr, ptr %23, align 8, !tbaa !12
  %182 = load i32, ptr %5, align 4, !tbaa !14
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds i8, ptr %181, i64 %183
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %184, ptr align 4 %16, i64 4, i1 false)
  %185 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 1
  %186 = load i32, ptr %185, align 4, !tbaa !15
  %187 = load i32, ptr %15, align 4, !tbaa !14
  %188 = call i32 @BF_WriteBlock(i32 noundef %186, i32 noundef %187)
  %189 = icmp slt i32 %188, 0
  br i1 %189, label %190, label %191

190:                                              ; preds = %180
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %199

191:                                              ; preds = %180
  %192 = load ptr, ptr %22, align 8, !tbaa !12
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %192, ptr align 8 %1, i64 96, i1 false)
  store i32 1, ptr %13, align 4, !tbaa !14
  %193 = load ptr, ptr %22, align 8, !tbaa !12
  %194 = getelementptr inbounds i8, ptr %193, i64 512
  %195 = getelementptr inbounds i8, ptr %194, i64 -4
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %195, ptr align 4 %13, i64 4, i1 false)
  store i32 -1, ptr %13, align 4, !tbaa !14
  %196 = load ptr, ptr %22, align 8, !tbaa !12
  %197 = getelementptr inbounds i8, ptr %196, i64 512
  %198 = getelementptr inbounds i8, ptr %197, i64 -8
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %198, ptr align 4 %13, i64 4, i1 false)
  store i32 0, ptr %7, align 4
  br label %199

199:                                              ; preds = %191, %190, %179
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br label %200

200:                                              ; preds = %199, %172
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  %201 = load i32, ptr %7, align 4
  switch i32 %201, label %235 [
    i32 0, label %202
  ]

202:                                              ; preds = %200
  br label %226

203:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %204 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 1
  %205 = load i32, ptr %204, align 4, !tbaa !15
  %206 = load i32, ptr %14, align 4, !tbaa !14
  %207 = call i32 @BF_ReadBlock(i32 noundef %205, i32 noundef %206, ptr noundef %24)
  %208 = icmp slt i32 %207, 0
  br i1 %208, label %209, label %210

209:                                              ; preds = %203
  call void @BF_PrintError(ptr noundef @.str.3)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %223

210:                                              ; preds = %203
  %211 = load i32, ptr %13, align 4, !tbaa !14
  %212 = add nsw i32 %211, 1
  store i32 %212, ptr %13, align 4, !tbaa !14
  %213 = load ptr, ptr %24, align 8, !tbaa !12
  %214 = getelementptr inbounds i8, ptr %213, i64 512
  %215 = getelementptr inbounds i8, ptr %214, i64 -4
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %215, ptr align 4 %13, i64 4, i1 false)
  %216 = load ptr, ptr %24, align 8, !tbaa !12
  %217 = load i32, ptr %13, align 4, !tbaa !14
  %218 = sub nsw i32 %217, 1
  %219 = sext i32 %218 to i64
  %220 = mul i64 %219, 96
  %221 = getelementptr inbounds i8, ptr %216, i64 %220
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %221, ptr align 8 %1, i64 96, i1 false)
  %222 = load i32, ptr %14, align 4, !tbaa !14
  store i32 %222, ptr %16, align 4, !tbaa !14
  store i32 0, ptr %7, align 4
  br label %223

223:                                              ; preds = %210, %209
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  %224 = load i32, ptr %7, align 4
  switch i32 %224, label %235 [
    i32 0, label %225
  ]

225:                                              ; preds = %223
  br label %226

226:                                              ; preds = %225, %202
  %227 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 1
  %228 = load i32, ptr %227, align 4, !tbaa !15
  %229 = load i32, ptr %16, align 4, !tbaa !14
  %230 = call i32 @BF_WriteBlock(i32 noundef %228, i32 noundef %229)
  %231 = icmp slt i32 %230, 0
  br i1 %231, label %232, label %233

232:                                              ; preds = %226
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %235

233:                                              ; preds = %226
  %234 = load i32, ptr %16, align 4, !tbaa !14
  store i32 %234, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %235

235:                                              ; preds = %233, %232, %223, %200, %161, %139, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %236

236:                                              ; preds = %235, %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %237

237:                                              ; preds = %236, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  %238 = load i32, ptr %3, align 4
  ret i32 %238
}

declare ptr @get_key(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #4

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nounwind willreturn memory(read) "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 #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

!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, !10, i64 16}
!6 = !{!"HT_info", !7, i64 0, !7, i64 4, !8, i64 8, !10, i64 16, !7, i64 24, !11, i64 32, !7, i64 40}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!10, !10, i64 0}
!13 = !{!6, !11, i64 32}
!14 = !{!7, !7, i64 0}
!15 = !{!6, !7, i64 4}
!16 = !{!6, !7, i64 40}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = !{!6, !7, i64 24}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}


; 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"

%struct.HT_info = type { i32, i32, i8, ptr, i32, i64, i32 }
%struct.record = type { i32, [15 x i8], [25 x i8], [50 x i8] }

@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [20 x i8], align 1

declare void @BF_PrintError(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

declare i32 @BF_AllocateBlock(i32 noundef) local_unnamed_addr #0

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

declare i32 @BF_GetBlockCounter(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare i32 @BF_WriteBlock(i32 noundef, i32 noundef) local_unnamed_addr #0

; 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 i32 @hash(i64 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local i32 @HT_InsertEntry(ptr nocapture noundef readonly byval(%struct.HT_info) align 8 %0, ptr noundef byval(%struct.record) align 8 %1) local_unnamed_addr #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = call ptr @get_key(ptr noundef nonnull %1, ptr noundef %10) #6
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  %13 = load i64, ptr %12, align 8, !tbaa !12
  %14 = call i32 @hash(i64 noundef %13, ptr noundef %11)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  store ptr null, ptr %3, align 8, !tbaa !13
  %15 = getelementptr inbounds i8, ptr %0, i64 4
  %16 = load i32, ptr %15, align 4, !tbaa !14
  %17 = getelementptr inbounds i8, ptr %0, i64 40
  %18 = load i32, ptr %17, align 8, !tbaa !15
  %19 = call i32 @BF_ReadBlock(i32 noundef %16, i32 noundef %18, ptr noundef nonnull %3) #6
  %20 = icmp slt i32 %19, 0
  br i1 %20, label %21, label %22

21:                                               ; preds = %2
  call void @BF_PrintError(ptr noundef nonnull @.str.3) #6
  br label %110

22:                                               ; preds = %2
  %23 = load ptr, ptr %3, align 8, !tbaa !13
  %24 = getelementptr inbounds i8, ptr %23, i64 508
  %25 = load i32, ptr %24, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  store ptr null, ptr %4, align 8, !tbaa !13
  %.not91 = icmp ne i32 %25, -1
  call void @llvm.assume(i1 %.not91)
  br label %.lr.ph

.lr.ph:                                           ; preds = %22, %46
  %.06393 = phi i32 [ %33, %46 ], [ -1, %22 ]
  %.06692 = phi i32 [ %49, %46 ], [ %25, %22 ]
  %26 = call i32 @BF_ReadBlock(i32 noundef %16, i32 noundef %.06692, ptr noundef nonnull %4) #6
  %27 = icmp slt i32 %26, 0
  br i1 %27, label %28, label %.preheader

28:                                               ; preds = %.lr.ph
  call void @BF_PrintError(ptr noundef nonnull @.str.3) #6
  br label %109

.preheader:                                       ; preds = %.lr.ph, %38
  %.06290 = phi i32 [ %39, %38 ], [ 0, %.lr.ph ]
  %.16489 = phi i32 [ %36, %38 ], [ %.06393, %.lr.ph ]
  %29 = add nsw i32 %.16489, 1
  %30 = icmp eq i32 %14, %29
  br i1 %30, label %.thread115.loopexit, label %.preheader.1

.preheader.1:                                     ; preds = %.preheader
  %31 = add nsw i32 %.16489, 2
  %32 = icmp eq i32 %14, %31
  br i1 %32, label %.thread115.loopexit.split.loop.exit166, label %.preheader.2

.preheader.2:                                     ; preds = %.preheader.1
  %33 = add nsw i32 %.16489, 3
  %34 = icmp eq i32 %14, %33
  br i1 %34, label %.thread115.loopexit.split.loop.exit163, label %35

35:                                               ; preds = %.preheader.2
  %exitcond.not.2 = icmp eq i32 %.06290, 124
  br i1 %exitcond.not.2, label %40, label %.preheader.3, !llvm.loop !17

.preheader.3:                                     ; preds = %35
  %36 = add nsw i32 %.16489, 4
  %37 = icmp eq i32 %14, %36
  br i1 %37, label %.thread115.loopexit.split.loop.exit, label %38

38:                                               ; preds = %.preheader.3
  %39 = add nuw nsw i32 %.06290, 4
  br label %.preheader

40:                                               ; preds = %35
  %41 = icmp eq i32 %14, %33
  br i1 %41, label %.thread115, label %46

.thread115.loopexit.split.loop.exit:              ; preds = %.preheader.3
  %42 = or disjoint i32 %.06290, 3
  br label %.thread115.loopexit

.thread115.loopexit.split.loop.exit163:           ; preds = %.preheader.2
  %43 = or disjoint i32 %.06290, 2
  br label %.thread115.loopexit

.thread115.loopexit.split.loop.exit166:           ; preds = %.preheader.1
  %44 = or disjoint i32 %.06290, 1
  br label %.thread115.loopexit

.thread115.loopexit:                              ; preds = %.preheader, %.thread115.loopexit.split.loop.exit166, %.thread115.loopexit.split.loop.exit163, %.thread115.loopexit.split.loop.exit
  %.06290.lcssa = phi i32 [ %42, %.thread115.loopexit.split.loop.exit ], [ %43, %.thread115.loopexit.split.loop.exit163 ], [ %44, %.thread115.loopexit.split.loop.exit166 ], [ %.06290, %.preheader ]
  %45 = shl i32 %.06290.lcssa, 2
  br label %.thread115

.thread115:                                       ; preds = %40, %.thread115.loopexit
  %.062.lcssa118 = phi i32 [ %45, %.thread115.loopexit ], [ 508, %40 ]
  %.pre = load ptr, ptr %4, align 8, !tbaa !13
  br label %.loopexit77

46:                                               ; preds = %40
  %47 = load ptr, ptr %4, align 8, !tbaa !13
  %48 = getelementptr inbounds i8, ptr %47, i64 508
  %49 = load i32, ptr %48, align 4, !tbaa !16
  %.not = icmp eq i32 %49, -1
  br i1 %.not, label %.loopexit77, label %.lr.ph, !llvm.loop !19

.loopexit77:                                      ; preds = %46, %.thread115
  %50 = phi ptr [ %.pre, %.thread115 ], [ %47, %46 ]
  %.06688 = phi i32 [ %.06692, %.thread115 ], [ -1, %46 ]
  %.047 = phi i32 [ %.062.lcssa118, %.thread115 ], [ %14, %46 ]
  %51 = sext i32 %.047 to i64
  %52 = getelementptr inbounds i8, ptr %50, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  store ptr null, ptr %5, align 8, !tbaa !13
  %.not6997 = icmp eq i32 %53, -1
  br i1 %.not6997, label %._crit_edge.thread, label %.lr.ph100

.lr.ph100:                                        ; preds = %.loopexit77
  %54 = getelementptr inbounds i8, ptr %0, i64 24
  %55 = load i32, ptr %54, align 8
  %56 = sext i32 %55 to i64
  br label %57

57:                                               ; preds = %.lr.ph100, %.critedge
  %.05599 = phi i32 [ %53, %.lr.ph100 ], [ %74, %.critedge ]
  %.05998 = phi i32 [ -1, %.lr.ph100 ], [ %spec.select, %.critedge ]
  %58 = call i32 @BF_ReadBlock(i32 noundef %16, i32 noundef %.05599, ptr noundef nonnull %5) #6
  %59 = icmp slt i32 %58, 0
  br i1 %59, label %60, label %61

60:                                               ; preds = %57
  call void @BF_PrintError(ptr noundef nonnull @.str.3) #6
  br label %.loopexit

61:                                               ; preds = %57
  %62 = load ptr, ptr %5, align 8, !tbaa !13
  %63 = getelementptr inbounds i8, ptr %62, i64 508
  %64 = load i32, ptr %63, align 4, !tbaa !16
  %.not7194 = icmp sgt i32 %64, 0
  br i1 %.not7194, label %.lr.ph96.preheader, label %.critedge

.lr.ph96.preheader:                               ; preds = %61
  %wide.trip.count = zext nneg i32 %64 to i64
  br label %.lr.ph96

65:                                               ; preds = %.lr.ph96
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond113.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond113.not, label %.critedge.loopexit, label %.lr.ph96, !llvm.loop !20

.lr.ph96:                                         ; preds = %.lr.ph96.preheader, %65
  %indvars.iv = phi i64 [ 0, %.lr.ph96.preheader ], [ %indvars.iv.next, %65 ]
  %66 = load ptr, ptr %5, align 8, !tbaa !13
  %67 = mul nuw nsw i64 %indvars.iv, 96
  %68 = getelementptr inbounds i8, ptr %66, i64 %67
  %69 = call ptr @get_key(ptr noundef nonnull %1, ptr noundef %10) #6
  %70 = call ptr @get_key(ptr noundef %68, ptr noundef %10) #6
  %bcmp = call i32 @bcmp(ptr %69, ptr %70, i64 %56)
  %.not70 = icmp eq i32 %bcmp, 0
  br i1 %.not70, label %.loopexit, label %65

.critedge.loopexit:                               ; preds = %65
  %.pre114 = load ptr, ptr %5, align 8, !tbaa !13
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %61
  %71 = phi ptr [ %.pre114, %.critedge.loopexit ], [ %62, %61 ]
  %72 = icmp ult i32 %64, 5
  %spec.select = select i1 %72, i32 %.05599, i32 %.05998
  %73 = getelementptr inbounds i8, ptr %71, i64 504
  %74 = load i32, ptr %73, align 4, !tbaa !16
  %.not69 = icmp eq i32 %74, -1
  br i1 %.not69, label %._crit_edge, label %57, !llvm.loop !21

._crit_edge:                                      ; preds = %.critedge
  %75 = icmp eq i32 %spec.select, -1
  br i1 %75, label %._crit_edge.thread, label %97

._crit_edge.thread:                               ; preds = %.loopexit77, %._crit_edge
  %.148.lcssa124 = phi i64 [ 504, %._crit_edge ], [ %51, %.loopexit77 ]
  %.058.lcssa123 = phi i32 [ %.05599, %._crit_edge ], [ %.06688, %.loopexit77 ]
  %76 = call i32 @BF_AllocateBlock(i32 noundef %16) #6
  %77 = icmp slt i32 %76, 0
  br i1 %77, label %78, label %79

78:                                               ; preds = %._crit_edge.thread
  call void @BF_PrintError(ptr noundef nonnull @.str.2) #6
  br label %.loopexit

79:                                               ; preds = %._crit_edge.thread
  %80 = call i32 @BF_GetBlockCounter(i32 noundef %16) #6
  %81 = add nsw i32 %80, -1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %82 = call i32 @BF_ReadBlock(i32 noundef %16, i32 noundef %81, ptr noundef nonnull %6) #6
  %83 = icmp slt i32 %82, 0
  br i1 %83, label %.critedge73, label %84

.critedge73:                                      ; preds = %79
  call void @BF_PrintError(ptr noundef nonnull @.str.3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %.loopexit

84:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %85 = call i32 @BF_ReadBlock(i32 noundef %16, i32 noundef %.058.lcssa123, ptr noundef nonnull %7) #6
  %86 = icmp slt i32 %85, 0
  br i1 %86, label %87, label %88

87:                                               ; preds = %84
  call void @BF_PrintError(ptr noundef nonnull @.str.3) #6
  br label %.critedge75

88:                                               ; preds = %84
  %89 = load ptr, ptr %7, align 8, !tbaa !13
  %90 = getelementptr inbounds i8, ptr %89, i64 %.148.lcssa124
  store i32 %81, ptr %90, align 1
  %91 = call i32 @BF_WriteBlock(i32 noundef %16, i32 noundef %.058.lcssa123) #6
  %92 = icmp slt i32 %91, 0
  br i1 %92, label %.critedge75, label %93

93:                                               ; preds = %88
  %94 = load ptr, ptr %6, align 8, !tbaa !13
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(96) %94, ptr noundef nonnull align 8 dereferenceable(96) %1, i64 96, i1 false)
  %95 = getelementptr inbounds i8, ptr %94, i64 508
  store i32 1, ptr %95, align 1
  %96 = getelementptr inbounds i8, ptr %94, i64 504
  store i32 -1, ptr %96, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %107

97:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %98 = call i32 @BF_ReadBlock(i32 noundef %16, i32 noundef %spec.select, ptr noundef nonnull %8) #6
  %99 = icmp sgt i32 %98, -1
  br i1 %99, label %.thread, label %106

.thread:                                          ; preds = %97
  %100 = add nsw i32 %64, 1
  %101 = load ptr, ptr %8, align 8, !tbaa !13
  %102 = getelementptr inbounds i8, ptr %101, i64 508
  store i32 %100, ptr %102, align 1
  %103 = sext i32 %64 to i64
  %104 = mul nsw i64 %103, 96
  %105 = getelementptr inbounds i8, ptr %101, i64 %104
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(96) %105, ptr noundef nonnull align 8 dereferenceable(96) %1, i64 96, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %107

106:                                              ; preds = %97
  call void @BF_PrintError(ptr noundef nonnull @.str.3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %.loopexit

107:                                              ; preds = %.thread, %93
  %.257 = phi i32 [ %81, %93 ], [ %spec.select, %.thread ]
  %108 = call i32 @BF_WriteBlock(i32 noundef %16, i32 noundef %.257) #6
  %.inv = icmp sgt i32 %108, -1
  %..257 = select i1 %.inv, i32 %.257, i32 -1
  br label %.loopexit

.critedge75:                                      ; preds = %88, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph96, %106, %.critedge75, %107, %.critedge73, %78, %60
  %.7 = phi i32 [ -1, %60 ], [ -1, %78 ], [ -1, %106 ], [ -1, %.critedge73 ], [ %..257, %107 ], [ -1, %.critedge75 ], [ -1, %.lr.ph96 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %109

109:                                              ; preds = %.loopexit, %28
  %.8 = phi i32 [ -1, %28 ], [ %.7, %.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %110

110:                                              ; preds = %109, %21
  %.9 = phi i32 [ -1, %21 ], [ %.8, %109 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret i32 %.9
}

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

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #4

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #5

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nofree nounwind willreturn memory(argmem: read) }
attributes #5 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #6 = { 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, !10, i64 16}
!6 = !{!"HT_info", !7, i64 0, !7, i64 4, !8, i64 8, !10, i64 16, !7, i64 24, !11, i64 32, !7, i64 40}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!6, !11, i64 32}
!13 = !{!10, !10, i64 0}
!14 = !{!6, !7, i64 4}
!15 = !{!6, !7, i64 40}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass