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

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

@.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_ReadBlock(i32 noundef, i32 noundef, ptr 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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @SHT_SecondaryGetAllEntries(ptr noundef byval(%struct.SHT_info) align 8 %0, ptr noundef byval(%struct.HT_info) align 8 %1, ptr noundef %2) #3 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %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 i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca %struct.record, align 8
  store ptr %2, ptr %5, align 8, !tbaa !5
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = icmp eq ptr %28, null
  br i1 %29, label %30, label %32

30:                                               ; preds = %3
  %31 = call i32 @HT_GetAllEntries(ptr noundef byval(%struct.HT_info) align 8 %1, ptr noundef null)
  store i32 %31, ptr %4, align 4
  br label %208

32:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %33 = getelementptr inbounds %struct.SHT_info, ptr %0, i32 0, i32 5
  %34 = load i64, ptr %33, align 8, !tbaa !9
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = call i32 @sht_hash(i64 noundef %34, ptr noundef %35)
  store i32 %36, ptr %6, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store ptr null, ptr %7, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.SHT_info, ptr %0, i32 0, i32 1
  %38 = load i32, ptr %37, align 4, !tbaa !14
  %39 = getelementptr inbounds %struct.SHT_info, ptr %0, i32 0, i32 6
  %40 = load i32, ptr %39, align 8, !tbaa !15
  %41 = call i32 @BF_ReadBlock(i32 noundef %38, i32 noundef %40, ptr noundef %7)
  %42 = icmp slt i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %32
  call void @BF_PrintError(ptr noundef @.str.3)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %8, align 4
  br label %207

44:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %45, i64 512
  %47 = getelementptr inbounds i8, ptr %46, i64 -4
  %48 = load i32, ptr %47, align 4, !tbaa !13
  store i32 %48, ptr %10, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 127, ptr %12, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 -1, ptr %13, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !13
  br label %49

49:                                               ; preds = %84, %44
  %50 = load i32, ptr %10, align 4, !tbaa !13
  %51 = icmp ne i32 %50, -1
  br i1 %51, label %52, label %89

52:                                               ; preds = %49
  %53 = getelementptr inbounds %struct.SHT_info, ptr %0, i32 0, i32 1
  %54 = load i32, ptr %53, align 4, !tbaa !14
  %55 = load i32, ptr %10, align 4, !tbaa !13
  %56 = call i32 @BF_ReadBlock(i32 noundef %54, i32 noundef %55, ptr noundef %11)
  %57 = icmp slt i32 %56, 0
  br i1 %57, label %58, label %59

58:                                               ; preds = %52
  call void @BF_PrintError(ptr noundef @.str.3)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %8, align 4
  br label %206

59:                                               ; preds = %52
  store i32 0, ptr %14, align 4, !tbaa !13
  br label %60

60:                                               ; preds = %72, %59
  %61 = load i32, ptr %14, align 4, !tbaa !13
  %62 = load i32, ptr %12, align 4, !tbaa !13
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %64, label %75

64:                                               ; preds = %60
  %65 = load i32, ptr %13, align 4, !tbaa !13
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %13, align 4, !tbaa !13
  %67 = load i32, ptr %6, align 4, !tbaa !13
  %68 = load i32, ptr %13, align 4, !tbaa !13
  %69 = icmp eq i32 %67, %68
  br i1 %69, label %70, label %71

70:                                               ; preds = %64
  br label %75

71:                                               ; preds = %64
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %14, align 4, !tbaa !13
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %14, align 4, !tbaa !13
  br label %60, !llvm.loop !16

75:                                               ; preds = %70, %60
  %76 = load i32, ptr %6, align 4, !tbaa !13
  %77 = load i32, ptr %13, align 4, !tbaa !13
  %78 = icmp eq i32 %76, %77
  br i1 %78, label %79, label %84

79:                                               ; preds = %75
  %80 = load i32, ptr %14, align 4, !tbaa !13
  %81 = sext i32 %80 to i64
  %82 = mul i64 %81, 4
  %83 = trunc i64 %82 to i32
  store i32 %83, ptr %6, align 4, !tbaa !13
  br label %89

84:                                               ; preds = %75
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = getelementptr inbounds i8, ptr %85, i64 512
  %87 = getelementptr inbounds i8, ptr %86, i64 -4
  %88 = load i32, ptr %87, align 4, !tbaa !13
  store i32 %88, ptr %10, align 4, !tbaa !13
  br label %49, !llvm.loop !18

89:                                               ; preds = %79, %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  %91 = load i32, ptr %6, align 4, !tbaa !13
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds i8, ptr %90, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !13
  store i32 %94, ptr %16, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  store ptr null, ptr %18, align 8, !tbaa !5
  br label %95

95:                                               ; preds = %194, %89
  %96 = load i32, ptr %16, align 4, !tbaa !13
  %97 = icmp ne i32 %96, -1
  br i1 %97, label %98, label %199

98:                                               ; preds = %95
  %99 = getelementptr inbounds %struct.SHT_info, ptr %0, i32 0, i32 1
  %100 = load i32, ptr %99, align 4, !tbaa !14
  %101 = load i32, ptr %16, align 4, !tbaa !13
  %102 = call i32 @BF_ReadBlock(i32 noundef %100, i32 noundef %101, ptr noundef %18)
  %103 = icmp slt i32 %102, 0
  br i1 %103, label %104, label %105

104:                                              ; preds = %98
  call void @BF_PrintError(ptr noundef @.str.3)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %8, align 4
  br label %205

105:                                              ; preds = %98
  %106 = load i32, ptr %15, align 4, !tbaa !13
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %15, align 4, !tbaa !13
  %108 = load ptr, ptr %18, align 8, !tbaa !5
  %109 = getelementptr inbounds i8, ptr %108, i64 512
  %110 = getelementptr inbounds i8, ptr %109, i64 -4
  %111 = load i32, ptr %110, align 4, !tbaa !13
  store i32 %111, ptr %17, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !13
  br label %112

112:                                              ; preds = %182, %105
  %113 = load i32, ptr %19, align 4, !tbaa !13
  %114 = load i32, ptr %17, align 4, !tbaa !13
  %115 = icmp slt i32 %113, %114
  br i1 %115, label %117, label %116

116:                                              ; preds = %112
  store i32 9, ptr %8, align 4
  br label %185

117:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %118 = load ptr, ptr %18, align 8, !tbaa !5
  %119 = load i32, ptr %19, align 4, !tbaa !13
  %120 = sext i32 %119 to i64
  %121 = mul i64 %120, 32
  %122 = getelementptr inbounds i8, ptr %118, i64 %121
  store ptr %122, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %123 = load ptr, ptr %20, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.SHTrecord, ptr %123, i32 0, i32 0
  %125 = getelementptr inbounds [25 x i8], ptr %124, i64 0, i64 0
  store ptr %125, ptr %21, align 8, !tbaa !5
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = load ptr, ptr %21, align 8, !tbaa !5
  %128 = call i32 @strncmp(ptr noundef %126, ptr noundef %127, i64 noundef 25) #6
  %129 = icmp eq i32 %128, 0
  br i1 %129, label %130, label %178

130:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %131 = getelementptr inbounds %struct.HT_info, ptr %1, i32 0, i32 1
  %132 = load i32, ptr %131, align 4, !tbaa !19
  %133 = load ptr, ptr %20, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.SHTrecord, ptr %133, i32 0, i32 1
  %135 = load i32, ptr %134, align 4, !tbaa !21
  %136 = call i32 @BF_ReadBlock(i32 noundef %132, i32 noundef %135, ptr noundef %22)
  %137 = icmp slt i32 %136, 0
  br i1 %137, label %138, label %139

138:                                              ; preds = %130
  call void @BF_PrintError(ptr noundef @.str.3)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %8, align 4
  br label %175

139:                                              ; preds = %130
  %140 = load i32, ptr %15, align 4, !tbaa !13
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %15, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %142 = load ptr, ptr %22, align 8, !tbaa !5
  %143 = getelementptr inbounds i8, ptr %142, i64 512
  %144 = getelementptr inbounds i8, ptr %143, i64 -4
  %145 = load i32, ptr %144, align 4, !tbaa !13
  store i32 %145, ptr %23, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store i32 0, ptr %24, align 4, !tbaa !13
  br label %146

146:                                              ; preds = %171, %139
  %147 = load i32, ptr %24, align 4, !tbaa !13
  %148 = load i32, ptr %23, align 4, !tbaa !13
  %149 = icmp slt i32 %147, %148
  br i1 %149, label %151, label %150

150:                                              ; preds = %146
  store i32 12, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %174

151:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %152 = load ptr, ptr %22, align 8, !tbaa !5
  %153 = load i32, ptr %24, align 4, !tbaa !13
  %154 = sext i32 %153 to i64
  %155 = mul i64 %154, 96
  %156 = getelementptr inbounds i8, ptr %152, i64 %155
  store ptr %156, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %157 = load ptr, ptr %25, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.SHT_info, ptr %0, i32 0, i32 3
  %159 = load ptr, ptr %158, align 8, !tbaa !23
  %160 = call ptr @get_key(ptr noundef %157, ptr noundef %159)
  store ptr %160, ptr %26, align 8, !tbaa !5
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = load ptr, ptr %26, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.SHT_info, ptr %0, i32 0, i32 4
  %164 = load i32, ptr %163, align 8, !tbaa !24
  %165 = sext i32 %164 to i64
  %166 = call i32 @strncmp(ptr noundef %161, ptr noundef %162, i64 noundef %165) #6
  %167 = icmp eq i32 %166, 0
  br i1 %167, label %168, label %170

168:                                              ; preds = %151
  %169 = load ptr, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 96, ptr %27) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %27, ptr align 4 %169, i64 96, i1 false), !tbaa.struct !25
  call void @print_record(ptr noundef byval(%struct.record) align 8 %27)
  call void @llvm.lifetime.end.p0(i64 96, ptr %27) #5
  store i32 1, ptr %9, align 4, !tbaa !13
  br label %170

170:                                              ; preds = %168, %151
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %171

171:                                              ; preds = %170
  %172 = load i32, ptr %24, align 4, !tbaa !13
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %24, align 4, !tbaa !13
  br label %146, !llvm.loop !27

174:                                              ; preds = %150
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  store i32 0, ptr %8, align 4
  br label %175

175:                                              ; preds = %174, %138
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  %176 = load i32, ptr %8, align 4
  switch i32 %176, label %179 [
    i32 0, label %177
  ]

177:                                              ; preds = %175
  br label %178

178:                                              ; preds = %177, %117
  store i32 0, ptr %8, align 4
  br label %179

179:                                              ; preds = %178, %175
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  %180 = load i32, ptr %8, align 4
  switch i32 %180, label %185 [
    i32 0, label %181
  ]

181:                                              ; preds = %179
  br label %182

182:                                              ; preds = %181
  %183 = load i32, ptr %19, align 4, !tbaa !13
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %19, align 4, !tbaa !13
  br label %112, !llvm.loop !28

185:                                              ; preds = %179, %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  %186 = load i32, ptr %8, align 4
  switch i32 %186, label %205 [
    i32 9, label %187
  ]

187:                                              ; preds = %185
  %188 = getelementptr inbounds %struct.SHT_info, ptr %0, i32 0, i32 1
  %189 = load i32, ptr %188, align 4, !tbaa !14
  %190 = load i32, ptr %16, align 4, !tbaa !13
  %191 = call i32 @BF_ReadBlock(i32 noundef %189, i32 noundef %190, ptr noundef %18)
  %192 = icmp slt i32 %191, 0
  br i1 %192, label %193, label %194

193:                                              ; preds = %187
  call void @BF_PrintError(ptr noundef @.str.3)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %8, align 4
  br label %205

194:                                              ; preds = %187
  %195 = load ptr, ptr %18, align 8, !tbaa !5
  %196 = getelementptr inbounds i8, ptr %195, i64 512
  %197 = getelementptr inbounds i8, ptr %196, i64 -8
  %198 = load i32, ptr %197, align 4, !tbaa !13
  store i32 %198, ptr %16, align 4, !tbaa !13
  br label %95, !llvm.loop !29

199:                                              ; preds = %95
  %200 = load i32, ptr %9, align 4, !tbaa !13
  %201 = icmp eq i32 %200, 1
  br i1 %201, label %202, label %204

202:                                              ; preds = %199
  %203 = load i32, ptr %15, align 4, !tbaa !13
  store i32 %203, ptr %4, align 4
  store i32 1, ptr %8, align 4
  br label %205

204:                                              ; preds = %199
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %8, align 4
  br label %205

205:                                              ; preds = %204, %202, %193, %185, %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %206

206:                                              ; preds = %205, %58
  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
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %207

207:                                              ; preds = %206, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %208

208:                                              ; preds = %207, %30
  %209 = load i32, ptr %4, align 4
  ret i32 %209
}

declare i32 @HT_GetAllEntries(ptr noundef byval(%struct.HT_info) align 8, ptr noundef) #0

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

declare void @print_record(ptr noundef byval(%struct.record) align 8) #0

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


; 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.SHT_info = type { i32, i32, ptr, ptr, i32, i64, i32 }
%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.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_ReadBlock(i32 noundef, i32 noundef, ptr 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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @SHT_SecondaryGetAllEntries(ptr nocapture noundef readonly byval(%struct.SHT_info) align 8 %0, ptr noundef byval(%struct.HT_info) align 8 %1, ptr noundef %2) local_unnamed_addr #3 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %struct.record, align 8
  %9 = icmp eq ptr %2, null
  br i1 %9, label %10, label %12

10:                                               ; preds = %3
  %11 = tail call i32 @HT_GetAllEntries(ptr noundef nonnull byval(%struct.HT_info) align 8 %1, ptr noundef null) #6
  br label %105

12:                                               ; preds = %3
  %13 = getelementptr inbounds i8, ptr %0, i64 32
  %14 = load i64, ptr %13, align 8, !tbaa !5
  %15 = tail call i32 @sht_hash(i64 noundef %14, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  store ptr null, ptr %4, align 8, !tbaa !12
  %16 = getelementptr inbounds i8, ptr %0, i64 4
  %17 = load i32, ptr %16, align 4, !tbaa !13
  %18 = getelementptr inbounds i8, ptr %0, i64 40
  %19 = load i32, ptr %18, align 8, !tbaa !14
  %20 = call i32 @BF_ReadBlock(i32 noundef %17, i32 noundef %19, ptr noundef nonnull %4) #6
  %21 = icmp slt i32 %20, 0
  br i1 %21, label %22, label %23

22:                                               ; preds = %12
  call void @BF_PrintError(ptr noundef nonnull @.str.3) #6
  br label %104

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

.lr.ph:                                           ; preds = %23, %47
  %.055106 = phi i32 [ %50, %47 ], [ %26, %23 ]
  %.065105 = phi i32 [ %34, %47 ], [ -1, %23 ]
  %27 = call i32 @BF_ReadBlock(i32 noundef %17, i32 noundef %.055106, ptr noundef nonnull %5) #6
  %28 = icmp slt i32 %27, 0
  br i1 %28, label %29, label %.preheader

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

.preheader:                                       ; preds = %.lr.ph, %39
  %.064103 = phi i32 [ %40, %39 ], [ 0, %.lr.ph ]
  %.166102 = phi i32 [ %37, %39 ], [ %.065105, %.lr.ph ]
  %30 = add nsw i32 %.166102, 1
  %31 = icmp eq i32 %15, %30
  br i1 %31, label %.thread136.loopexit, label %.preheader.1

.preheader.1:                                     ; preds = %.preheader
  %32 = add nsw i32 %.166102, 2
  %33 = icmp eq i32 %15, %32
  br i1 %33, label %.thread136.loopexit.split.loop.exit160, label %.preheader.2

.preheader.2:                                     ; preds = %.preheader.1
  %34 = add nsw i32 %.166102, 3
  %35 = icmp eq i32 %15, %34
  br i1 %35, label %.thread136.loopexit.split.loop.exit158, label %36

36:                                               ; preds = %.preheader.2
  %exitcond.not.2 = icmp eq i32 %.064103, 124
  br i1 %exitcond.not.2, label %41, label %.preheader.3, !llvm.loop !16

.preheader.3:                                     ; preds = %36
  %37 = add nsw i32 %.166102, 4
  %38 = icmp eq i32 %15, %37
  br i1 %38, label %.thread136.loopexit.split.loop.exit, label %39

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

41:                                               ; preds = %36
  %42 = icmp eq i32 %15, %34
  br i1 %42, label %.thread136, label %47

.thread136.loopexit.split.loop.exit:              ; preds = %.preheader.3
  %43 = or disjoint i32 %.064103, 3
  br label %.thread136.loopexit

.thread136.loopexit.split.loop.exit158:           ; preds = %.preheader.2
  %44 = or disjoint i32 %.064103, 2
  br label %.thread136.loopexit

.thread136.loopexit.split.loop.exit160:           ; preds = %.preheader.1
  %45 = or disjoint i32 %.064103, 1
  br label %.thread136.loopexit

.thread136.loopexit:                              ; preds = %.preheader, %.thread136.loopexit.split.loop.exit160, %.thread136.loopexit.split.loop.exit158, %.thread136.loopexit.split.loop.exit
  %.064103.lcssa = phi i32 [ %43, %.thread136.loopexit.split.loop.exit ], [ %44, %.thread136.loopexit.split.loop.exit158 ], [ %45, %.thread136.loopexit.split.loop.exit160 ], [ %.064103, %.preheader ]
  %46 = shl i32 %.064103.lcssa, 2
  br label %.thread136

.thread136:                                       ; preds = %41, %.thread136.loopexit
  %.064.lcssa139 = phi i32 [ %46, %.thread136.loopexit ], [ 508, %41 ]
  %.pre = load ptr, ptr %5, align 8, !tbaa !12
  br label %.loopexit89

47:                                               ; preds = %41
  %48 = load ptr, ptr %5, align 8, !tbaa !12
  %49 = getelementptr inbounds i8, ptr %48, i64 508
  %50 = load i32, ptr %49, align 4, !tbaa !15
  %.not = icmp eq i32 %50, -1
  br i1 %.not, label %.loopexit89, label %.lr.ph, !llvm.loop !18

.loopexit89:                                      ; preds = %47, %.thread136
  %51 = phi ptr [ %.pre, %.thread136 ], [ %48, %47 ]
  %.042 = phi i32 [ %.064.lcssa139, %.thread136 ], [ %15, %47 ]
  %52 = sext i32 %.042 to i64
  %53 = getelementptr inbounds i8, ptr %51, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  store ptr null, ptr %6, align 8, !tbaa !12
  %.not71118 = icmp eq i32 %54, -1
  br i1 %.not71118, label %._crit_edge123, label %.lr.ph122

.lr.ph122:                                        ; preds = %.loopexit89
  %55 = getelementptr inbounds i8, ptr %1, i64 4
  %56 = getelementptr inbounds i8, ptr %0, i64 16
  %57 = load ptr, ptr %56, align 8
  %58 = getelementptr inbounds i8, ptr %0, i64 24
  %59 = load i32, ptr %58, align 8
  %60 = sext i32 %59 to i64
  br label %61

61:                                               ; preds = %.lr.ph122, %97
  %.047121 = phi i32 [ 0, %.lr.ph122 ], [ %.148.lcssa, %97 ]
  %.057120 = phi i32 [ %54, %.lr.ph122 ], [ %100, %97 ]
  %.058119 = phi i32 [ 0, %.lr.ph122 ], [ %.159.lcssa, %97 ]
  %62 = call i32 @BF_ReadBlock(i32 noundef %17, i32 noundef %.057120, ptr noundef nonnull %6) #6
  %63 = icmp slt i32 %62, 0
  br i1 %63, label %64, label %.split

64:                                               ; preds = %61
  call void @BF_PrintError(ptr noundef nonnull @.str.3) #6
  br label %._crit_edge123

.split:                                           ; preds = %61
  %65 = add nsw i32 %.058119, 1
  %66 = load ptr, ptr %6, align 8, !tbaa !12
  %67 = getelementptr inbounds i8, ptr %66, i64 508
  %68 = load i32, ptr %67, align 4, !tbaa !15
  %.not72110 = icmp sgt i32 %68, 0
  br i1 %.not72110, label %.lr.ph114.preheader, label %.thread84.loopexit

.lr.ph114.preheader:                              ; preds = %.split
  %wide.trip.count134 = zext nneg i32 %68 to i64
  br label %.lr.ph114

.lr.ph114:                                        ; preds = %.lr.ph114.preheader, %.thread
  %indvars.iv131 = phi i64 [ 0, %.lr.ph114.preheader ], [ %indvars.iv.next132, %.thread ]
  %.148113 = phi i32 [ %.047121, %.lr.ph114.preheader ], [ %.65377, %.thread ]
  %.159111 = phi i32 [ %65, %.lr.ph114.preheader ], [ %.46276, %.thread ]
  %69 = load ptr, ptr %6, align 8, !tbaa !12
  %70 = shl nuw nsw i64 %indvars.iv131, 5
  %71 = getelementptr inbounds i8, ptr %69, i64 %70
  %72 = call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %71, i64 noundef 25) #7
  %73 = icmp eq i32 %72, 0
  br i1 %73, label %74, label %.thread

74:                                               ; preds = %.lr.ph114
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %75 = load i32, ptr %55, align 4, !tbaa !19
  %76 = getelementptr inbounds i8, ptr %71, i64 28
  %77 = load i32, ptr %76, align 4, !tbaa !21
  %78 = call i32 @BF_ReadBlock(i32 noundef %75, i32 noundef %77, ptr noundef nonnull %7) #6
  %79 = icmp sgt i32 %78, -1
  br i1 %79, label %80, label %.thread81

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

80:                                               ; preds = %74
  %81 = add nsw i32 %.159111, 1
  %82 = load ptr, ptr %7, align 8, !tbaa !12
  %83 = getelementptr inbounds i8, ptr %82, i64 508
  %84 = load i32, ptr %83, align 4, !tbaa !15
  %85 = icmp sgt i32 %84, 0
  br i1 %85, label %.lr.ph109.preheader, label %._crit_edge

.lr.ph109.preheader:                              ; preds = %80
  %wide.trip.count = zext nneg i32 %84 to i64
  br label %.lr.ph109

.lr.ph109:                                        ; preds = %.lr.ph109.preheader, %93
  %indvars.iv = phi i64 [ 0, %.lr.ph109.preheader ], [ %indvars.iv.next, %93 ]
  %.249107 = phi i32 [ %.148113, %.lr.ph109.preheader ], [ %.350, %93 ]
  %86 = load ptr, ptr %7, align 8, !tbaa !12
  %87 = mul nuw nsw i64 %indvars.iv, 96
  %88 = getelementptr inbounds i8, ptr %86, i64 %87
  %89 = call ptr @get_key(ptr noundef %88, ptr noundef %57) #6
  %90 = call i32 @strncmp(ptr noundef nonnull %2, ptr noundef %89, i64 noundef %60) #7
  %91 = icmp eq i32 %90, 0
  br i1 %91, label %92, label %93

92:                                               ; preds = %.lr.ph109
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %8) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(96) %8, ptr noundef nonnull align 4 dereferenceable(96) %88, i64 96, i1 false), !tbaa.struct !23
  call void @print_record(ptr noundef nonnull byval(%struct.record) align 8 %8) #6
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %8) #6
  br label %93

93:                                               ; preds = %92, %.lr.ph109
  %.350 = phi i32 [ 1, %92 ], [ %.249107, %.lr.ph109 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond130.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond130.not, label %._crit_edge, label %.lr.ph109, !llvm.loop !25

._crit_edge:                                      ; preds = %93, %80
  %.249.lcssa = phi i32 [ %.148113, %80 ], [ %.350, %93 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %.thread

.thread:                                          ; preds = %._crit_edge, %.lr.ph114
  %.65377 = phi i32 [ %.249.lcssa, %._crit_edge ], [ %.148113, %.lr.ph114 ]
  %.46276 = phi i32 [ %81, %._crit_edge ], [ %.159111, %.lr.ph114 ]
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %exitcond135.not = icmp eq i64 %indvars.iv.next132, %wide.trip.count134
  br i1 %exitcond135.not, label %.thread84.loopexit, label %.lr.ph114, !llvm.loop !26

.thread84.loopexit:                               ; preds = %.thread, %.split
  %.159.lcssa = phi i32 [ %65, %.split ], [ %.46276, %.thread ]
  %.148.lcssa = phi i32 [ %.047121, %.split ], [ %.65377, %.thread ]
  %94 = call i32 @BF_ReadBlock(i32 noundef %17, i32 noundef %.057120, ptr noundef nonnull %6) #6
  %95 = icmp slt i32 %94, 0
  br i1 %95, label %96, label %97

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

97:                                               ; preds = %.thread84.loopexit
  %98 = load ptr, ptr %6, align 8, !tbaa !12
  %99 = getelementptr inbounds i8, ptr %98, i64 504
  %100 = load i32, ptr %99, align 4, !tbaa !15
  %.not71 = icmp eq i32 %100, -1
  br i1 %.not71, label %._crit_edge123.loopexit, label %61, !llvm.loop !27

._crit_edge123.loopexit:                          ; preds = %97
  %101 = icmp eq i32 %.148.lcssa, 1
  %102 = select i1 %101, i32 %.159.lcssa, i32 -1
  br label %._crit_edge123

._crit_edge123:                                   ; preds = %.loopexit89, %._crit_edge123.loopexit, %.thread81, %96, %64
  %.6 = phi i32 [ -1, %64 ], [ -1, %96 ], [ -1, %.thread81 ], [ -1, %.loopexit89 ], [ %102, %._crit_edge123.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %103

103:                                              ; preds = %._crit_edge123, %29
  %.7 = phi i32 [ -1, %29 ], [ %.6, %._crit_edge123 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %104

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

105:                                              ; preds = %104, %10
  %.9 = phi i32 [ %11, %10 ], [ %.8, %104 ]
  ret i32 %.9
}

declare i32 @HT_GetAllEntries(ptr noundef byval(%struct.HT_info) align 8, ptr noundef) local_unnamed_addr #0

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

declare void @print_record(ptr noundef byval(%struct.record) align 8) local_unnamed_addr #0

; 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 = { mustprogress nofree nounwind willreturn memory(argmem: 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 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #6 = { nounwind }
attributes #7 = { 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, !11, i64 32}
!6 = !{!"SHT_info", !7, i64 0, !7, i64 4, !10, 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, !7, i64 4}
!14 = !{!6, !7, i64 40}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{!20, !7, i64 4}
!20 = !{!"HT_info", !7, i64 0, !7, i64 4, !8, i64 8, !10, i64 16, !7, i64 24, !11, i64 32, !7, i64 40}
!21 = !{!22, !7, i64 28}
!22 = !{!"", !8, i64 0, !7, i64 28}
!23 = !{i64 0, i64 4, !15, i64 4, i64 15, !24, i64 19, i64 25, !24, i64 44, i64 50, !24}
!24 = !{!8, !8, i64 0}
!25 = distinct !{!25, !17}
!26 = distinct !{!26, !17}
!27 = distinct !{!27, !17}


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