; LLVM IR from AngelPn/DBMS-Simulator :: src (main_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.record = type { i32, [15 x i8], [25 x i8], [50 x i8] }
%struct.SecondaryRecord = type { %struct.record, i32 }
%struct.HT_info = type { i32, i32, i8, ptr, i32, i64, i32 }
%struct.SHT_info = type { i32, i32, ptr, ptr, i32, i64, i32 }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [105 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [114 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca [15 x i8], align 1
  %7 = alloca [25 x i8], align 16
  %8 = alloca [50 x i8], align 16
  %9 = alloca %struct.record, align 8
  %10 = alloca i32, align 4
  %11 = alloca %struct.SecondaryRecord, align 8
  %12 = alloca [25 x i8], align 16
  store i32 0, ptr %1, align 4
  %13 = call i32 @HT_CreateIndex(ptr noundef @.str, i8 noundef signext 105, ptr noundef @.str.1, i32 noundef 4, i32 noundef 150)
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %15, label %17

15:                                               ; preds = %0
  %16 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %19

17:                                               ; preds = %0
  %18 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %19

19:                                               ; preds = %17, %15
  %20 = call i32 @SHT_CreateSecondaryIndex(ptr noundef @.str.4, ptr noundef @.str.5, i32 noundef 25, i32 noundef 150, ptr noundef @.str)
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %22, label %24

22:                                               ; preds = %19
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  br label %26

24:                                               ; preds = %19
  %25 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  br label %26

26:                                               ; preds = %24, %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %27 = call ptr @HT_OpenIndex(ptr noundef @.str)
  store ptr %27, ptr %2, align 8, !tbaa !5
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %48

30:                                               ; preds = %26
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.HT_info, ptr %31, i32 0, i32 1
  %33 = load i32, ptr %32, align 4, !tbaa !9
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.HT_info, ptr %34, i32 0, i32 2
  %36 = load i8, ptr %35, align 8, !tbaa !13
  %37 = sext i8 %36 to i32
  %38 = load ptr, ptr %2, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.HT_info, ptr %38, i32 0, i32 3
  %40 = load ptr, ptr %39, align 8, !tbaa !14
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.HT_info, ptr %41, i32 0, i32 4
  %43 = load i32, ptr %42, align 8, !tbaa !15
  %44 = load ptr, ptr %2, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.HT_info, ptr %44, i32 0, i32 5
  %46 = load i64, ptr %45, align 8, !tbaa !16
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %33, i32 noundef %37, ptr noundef %40, i32 noundef %43, i64 noundef %46)
  br label %50

48:                                               ; preds = %26
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  br label %50

50:                                               ; preds = %48, %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %51 = call ptr @SHT_OpenSecondaryIndex(ptr noundef @.str.4)
  store ptr %51, ptr %3, align 8, !tbaa !5
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %71

54:                                               ; preds = %50
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.SHT_info, ptr %55, i32 0, i32 1
  %57 = load i32, ptr %56, align 4, !tbaa !17
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.SHT_info, ptr %58, i32 0, i32 2
  %60 = load ptr, ptr %59, align 8, !tbaa !19
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.SHT_info, ptr %61, i32 0, i32 3
  %63 = load ptr, ptr %62, align 8, !tbaa !20
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.SHT_info, ptr %64, i32 0, i32 4
  %66 = load i32, ptr %65, align 8, !tbaa !21
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.SHT_info, ptr %67, i32 0, i32 5
  %69 = load i64, ptr %68, align 8, !tbaa !22
  %70 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i32 noundef %57, ptr noundef %60, ptr noundef %63, i32 noundef %66, i64 noundef %69)
  br label %73

71:                                               ; preds = %50
  %72 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  br label %73

73:                                               ; preds = %71, %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %74 = call noalias ptr @fopen(ptr noundef @.str.11, ptr noundef @.str.12)
  store ptr %74, ptr %4, align 8, !tbaa !5
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = icmp eq ptr %75, null
  br i1 %76, label %77, label %79

77:                                               ; preds = %73
  %78 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  call void @exit(i32 noundef 1) #7
  unreachable

79:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 15, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 25, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 50, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 96, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  br label %80

80:                                               ; preds = %118, %79
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds [15 x i8], ptr %6, i64 0, i64 0
  %83 = getelementptr inbounds [25 x i8], ptr %7, i64 0, i64 0
  %84 = getelementptr inbounds [50 x i8], ptr %8, i64 0, i64 0
  %85 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %81, ptr noundef @.str.14, ptr noundef %5, ptr noundef %82, ptr noundef %83, ptr noundef %84)
  %86 = icmp ne i32 %85, -1
  br i1 %86, label %87, label %119

87:                                               ; preds = %80
  %88 = load i32, ptr %5, align 4, !tbaa !23
  %89 = getelementptr inbounds [15 x i8], ptr %6, i64 0, i64 0
  %90 = getelementptr inbounds [25 x i8], ptr %7, i64 0, i64 0
  %91 = getelementptr inbounds [50 x i8], ptr %8, i64 0, i64 0
  call void @init_record(ptr noundef %9, i32 noundef %88, ptr noundef %89, ptr noundef %90, ptr noundef %91)
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = call i32 @HT_InsertEntry(ptr noundef byval(%struct.HT_info) align 8 %92, ptr noundef byval(%struct.record) align 8 %9)
  store i32 %93, ptr %10, align 4, !tbaa !23
  %94 = icmp eq i32 %93, -1
  br i1 %94, label %95, label %98

95:                                               ; preds = %87
  %96 = load i32, ptr %5, align 4, !tbaa !23
  %97 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef %96)
  br label %98

98:                                               ; preds = %95, %87
  call void @llvm.lifetime.start.p0(i64 100, ptr %11) #6
  call void @llvm.memset.p0.i64(ptr align 4 %11, i8 0, i64 100, i1 false)
  %99 = getelementptr inbounds %struct.SecondaryRecord, ptr %11, i32 0, i32 0
  %100 = getelementptr inbounds %struct.SecondaryRecord, ptr %11, i32 0, i32 1
  %101 = load i32, ptr %10, align 4, !tbaa !23
  store i32 %101, ptr %100, align 4, !tbaa !24
  %102 = getelementptr inbounds %struct.SecondaryRecord, ptr %11, i32 0, i32 0
  %103 = getelementptr inbounds %struct.record, ptr %9, i32 0, i32 0
  %104 = load i32, ptr %103, align 4, !tbaa !27
  %105 = getelementptr inbounds %struct.record, ptr %9, i32 0, i32 1
  %106 = getelementptr inbounds [15 x i8], ptr %105, i64 0, i64 0
  %107 = getelementptr inbounds %struct.record, ptr %9, i32 0, i32 2
  %108 = getelementptr inbounds [25 x i8], ptr %107, i64 0, i64 0
  %109 = getelementptr inbounds %struct.record, ptr %9, i32 0, i32 3
  %110 = getelementptr inbounds [50 x i8], ptr %109, i64 0, i64 0
  call void @init_record(ptr noundef %102, i32 noundef %104, ptr noundef %106, ptr noundef %108, ptr noundef %110)
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = call i32 @SHT_SecondaryInsertEntry(ptr noundef byval(%struct.SHT_info) align 8 %111, ptr noundef byval(%struct.SecondaryRecord) align 8 %11)
  %113 = icmp eq i32 %112, -1
  br i1 %113, label %114, label %118

114:                                              ; preds = %98
  %115 = getelementptr inbounds %struct.record, ptr %9, i32 0, i32 2
  %116 = getelementptr inbounds [25 x i8], ptr %115, i64 0, i64 0
  %117 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, ptr noundef %116)
  br label %118

118:                                              ; preds = %114, %98
  call void @llvm.lifetime.end.p0(i64 100, ptr %11) #6
  br label %80, !llvm.loop !28

119:                                              ; preds = %80
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = call i32 @fclose(ptr noundef %120)
  call void @llvm.lifetime.start.p0(i64 25, ptr %12) #6
  %122 = getelementptr inbounds [25 x i8], ptr %12, i64 0, i64 0
  %123 = call ptr @strcpy(ptr noundef %122, ptr noundef @.str.17) #6
  %124 = getelementptr inbounds [25 x i8], ptr %12, i64 0, i64 0
  %125 = call i32 (ptr, ...) @printf(ptr noundef @.str.18, ptr noundef %124)
  %126 = load ptr, ptr %3, align 8, !tbaa !5
  %127 = load ptr, ptr %2, align 8, !tbaa !5
  %128 = call i32 @SHT_SecondaryGetAllEntries(ptr noundef byval(%struct.SHT_info) align 8 %126, ptr noundef byval(%struct.HT_info) align 8 %127, ptr noundef %12)
  %129 = icmp eq i32 %128, -1
  br i1 %129, label %130, label %132

130:                                              ; preds = %119
  %131 = call i32 (ptr, ...) @printf(ptr noundef @.str.19)
  br label %132

132:                                              ; preds = %130, %119
  %133 = getelementptr inbounds [25 x i8], ptr %12, i64 0, i64 0
  %134 = call ptr @strcpy(ptr noundef %133, ptr noundef @.str.20) #6
  %135 = getelementptr inbounds [25 x i8], ptr %12, i64 0, i64 0
  %136 = call i32 (ptr, ...) @printf(ptr noundef @.str.18, ptr noundef %135)
  %137 = load ptr, ptr %3, align 8, !tbaa !5
  %138 = load ptr, ptr %2, align 8, !tbaa !5
  %139 = call i32 @SHT_SecondaryGetAllEntries(ptr noundef byval(%struct.SHT_info) align 8 %137, ptr noundef byval(%struct.HT_info) align 8 %138, ptr noundef %12)
  %140 = icmp eq i32 %139, -1
  br i1 %140, label %141, label %143

141:                                              ; preds = %132
  %142 = call i32 (ptr, ...) @printf(ptr noundef @.str.19)
  br label %143

143:                                              ; preds = %141, %132
  %144 = getelementptr inbounds [25 x i8], ptr %12, i64 0, i64 0
  %145 = call ptr @strcpy(ptr noundef %144, ptr noundef @.str.21) #6
  %146 = getelementptr inbounds [25 x i8], ptr %12, i64 0, i64 0
  %147 = call i32 (ptr, ...) @printf(ptr noundef @.str.18, ptr noundef %146)
  %148 = load ptr, ptr %3, align 8, !tbaa !5
  %149 = load ptr, ptr %2, align 8, !tbaa !5
  %150 = call i32 @SHT_SecondaryGetAllEntries(ptr noundef byval(%struct.SHT_info) align 8 %148, ptr noundef byval(%struct.HT_info) align 8 %149, ptr noundef %12)
  %151 = icmp eq i32 %150, -1
  br i1 %151, label %152, label %154

152:                                              ; preds = %143
  %153 = call i32 (ptr, ...) @printf(ptr noundef @.str.19)
  br label %154

154:                                              ; preds = %152, %143
  %155 = getelementptr inbounds [25 x i8], ptr %12, i64 0, i64 0
  %156 = call ptr @strcpy(ptr noundef %155, ptr noundef @.str.22) #6
  %157 = getelementptr inbounds [25 x i8], ptr %12, i64 0, i64 0
  %158 = call i32 (ptr, ...) @printf(ptr noundef @.str.18, ptr noundef %157)
  %159 = load ptr, ptr %3, align 8, !tbaa !5
  %160 = load ptr, ptr %2, align 8, !tbaa !5
  %161 = call i32 @SHT_SecondaryGetAllEntries(ptr noundef byval(%struct.SHT_info) align 8 %159, ptr noundef byval(%struct.HT_info) align 8 %160, ptr noundef %12)
  %162 = icmp eq i32 %161, -1
  br i1 %162, label %163, label %165

163:                                              ; preds = %154
  %164 = call i32 (ptr, ...) @printf(ptr noundef @.str.19)
  br label %165

165:                                              ; preds = %163, %154
  %166 = call i32 (ptr, ...) @printf(ptr noundef @.str.23)
  %167 = call i32 @HashStatistics(ptr noundef @.str.4)
  %168 = load ptr, ptr %3, align 8, !tbaa !5
  %169 = call i32 @SHT_CloseSecondaryIndex(ptr noundef %168)
  %170 = load ptr, ptr %2, align 8, !tbaa !5
  %171 = call i32 @HT_CloseIndex(ptr noundef %170)
  call void @llvm.lifetime.end.p0(i64 25, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 96, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 50, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 25, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 15, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  ret i32 0
}

declare i32 @HT_CreateIndex(ptr noundef, i8 noundef signext, ptr noundef, i32 noundef, i32 noundef) #1

declare i32 @printf(ptr noundef, ...) #1

declare i32 @SHT_CreateSecondaryIndex(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) #1

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

declare ptr @HT_OpenIndex(ptr noundef) #1

declare ptr @SHT_OpenSecondaryIndex(ptr noundef) #1

declare noalias ptr @fopen(ptr noundef, ptr noundef) #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #3

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) #1

declare void @init_record(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @HT_InsertEntry(ptr noundef byval(%struct.HT_info) align 8, ptr noundef byval(%struct.record) align 8) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

declare i32 @SHT_SecondaryInsertEntry(ptr noundef byval(%struct.SHT_info) align 8, ptr noundef byval(%struct.SecondaryRecord) align 8) #1

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

declare i32 @fclose(ptr noundef) #1

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #5

declare i32 @SHT_SecondaryGetAllEntries(ptr noundef byval(%struct.SHT_info) align 8, ptr noundef byval(%struct.HT_info) align 8, ptr noundef) #1

declare i32 @HashStatistics(ptr noundef) #1

declare i32 @SHT_CloseSecondaryIndex(ptr noundef) #1

declare i32 @HT_CloseIndex(ptr noundef) #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 4}
!10 = !{!"HT_info", !11, i64 0, !11, i64 4, !7, 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 = !{!10, !7, i64 8}
!14 = !{!10, !6, i64 16}
!15 = !{!10, !11, i64 24}
!16 = !{!10, !12, i64 32}
!17 = !{!18, !11, i64 4}
!18 = !{!"SHT_info", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16, !11, i64 24, !12, i64 32, !11, i64 40}
!19 = !{!18, !6, i64 8}
!20 = !{!18, !6, i64 16}
!21 = !{!18, !11, i64 24}
!22 = !{!18, !12, i64 32}
!23 = !{!11, !11, i64 0}
!24 = !{!25, !11, i64 96}
!25 = !{!"", !26, i64 0, !11, i64 96}
!26 = !{!"record", !11, i64 0, !7, i64 4, !7, i64 19, !7, i64 44}
!27 = !{!26, !11, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


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

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [105 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [114 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca [15 x i8], align 1
  %3 = alloca [25 x i8], align 16
  %4 = alloca [50 x i8], align 16
  %5 = alloca %struct.record, align 8
  %6 = alloca %struct.SecondaryRecord, align 8
  %7 = alloca [25 x i8], align 16
  %8 = tail call i32 @HT_CreateIndex(ptr noundef nonnull @.str, i8 noundef signext 105, ptr noundef nonnull @.str.1, i32 noundef 4, i32 noundef 150) #7
  %9 = icmp eq i32 %8, 0
  %.str.2..str.3 = select i1 %9, ptr @.str.2, ptr @.str.3
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.3)
  %11 = tail call i32 @SHT_CreateSecondaryIndex(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.5, i32 noundef 25, i32 noundef 150, ptr noundef nonnull @.str) #7
  %12 = icmp eq i32 %11, 0
  %.str.7.sink = select i1 %12, ptr @.str.6, ptr @.str.7
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.7.sink)
  %14 = tail call ptr @HT_OpenIndex(ptr noundef nonnull @.str) #7
  %.not = icmp eq ptr %14, null
  br i1 %.not, label %28, label %15

15:                                               ; preds = %0
  %16 = getelementptr inbounds i8, ptr %14, i64 4
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %14, i64 8
  %19 = load i8, ptr %18, align 8, !tbaa !12
  %20 = sext i8 %19 to i32
  %21 = getelementptr inbounds i8, ptr %14, i64 16
  %22 = load ptr, ptr %21, align 8, !tbaa !13
  %23 = getelementptr inbounds i8, ptr %14, i64 24
  %24 = load i32, ptr %23, align 8, !tbaa !14
  %25 = getelementptr inbounds i8, ptr %14, i64 32
  %26 = load i64, ptr %25, align 8, !tbaa !15
  %27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %17, i32 noundef %20, ptr noundef %22, i32 noundef %24, i64 noundef %26)
  br label %30

28:                                               ; preds = %0
  %29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  br label %30

30:                                               ; preds = %28, %15
  %31 = tail call ptr @SHT_OpenSecondaryIndex(ptr noundef nonnull @.str.4) #7
  %.not29 = icmp eq ptr %31, null
  br i1 %.not29, label %44, label %32

32:                                               ; preds = %30
  %33 = getelementptr inbounds i8, ptr %31, i64 4
  %34 = load i32, ptr %33, align 4, !tbaa !16
  %35 = getelementptr inbounds i8, ptr %31, i64 8
  %36 = load ptr, ptr %35, align 8, !tbaa !18
  %37 = getelementptr inbounds i8, ptr %31, i64 16
  %38 = load ptr, ptr %37, align 8, !tbaa !19
  %39 = getelementptr inbounds i8, ptr %31, i64 24
  %40 = load i32, ptr %39, align 8, !tbaa !20
  %41 = getelementptr inbounds i8, ptr %31, i64 32
  %42 = load i64, ptr %41, align 8, !tbaa !21
  %43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef %34, ptr noundef %36, ptr noundef %38, i32 noundef %40, i64 noundef %42)
  br label %46

44:                                               ; preds = %30
  %45 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  br label %46

46:                                               ; preds = %44, %32
  %47 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.12)
  %48 = icmp eq ptr %47, null
  br i1 %48, label %49, label %51

49:                                               ; preds = %46
  %50 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  tail call void @exit(i32 noundef 1) #8
  unreachable

51:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 25, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %5) #7
  %52 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %47, ptr noundef nonnull @.str.14, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4) #7
  %.not3031 = icmp eq i32 %52, -1
  br i1 %.not3031, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %51
  %53 = getelementptr inbounds i8, ptr %6, i64 96
  %54 = getelementptr inbounds i8, ptr %5, i64 4
  %55 = getelementptr inbounds i8, ptr %5, i64 19
  %56 = getelementptr inbounds i8, ptr %5, i64 44
  br label %57

57:                                               ; preds = %.lr.ph, %70
  %58 = load i32, ptr %1, align 4, !tbaa !22
  call void @init_record(ptr noundef nonnull %5, i32 noundef %58, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4) #7
  %59 = call i32 @HT_InsertEntry(ptr noundef byval(%struct.HT_info) align 8 %14, ptr noundef nonnull byval(%struct.record) align 8 %5) #7
  %60 = icmp eq i32 %59, -1
  br i1 %60, label %61, label %64

61:                                               ; preds = %57
  %62 = load i32, ptr %1, align 4, !tbaa !22
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef %62)
  br label %64

64:                                               ; preds = %61, %57
  call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %6) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(100) %6, i8 0, i64 96, i1 false)
  store i32 %59, ptr %53, align 8, !tbaa !23
  %65 = load i32, ptr %5, align 8, !tbaa !26
  call void @init_record(ptr noundef nonnull %6, i32 noundef %65, ptr noundef nonnull %54, ptr noundef nonnull %55, ptr noundef nonnull %56) #7
  %66 = call i32 @SHT_SecondaryInsertEntry(ptr noundef byval(%struct.SHT_info) align 8 %31, ptr noundef nonnull byval(%struct.SecondaryRecord) align 8 %6) #7
  %67 = icmp eq i32 %66, -1
  br i1 %67, label %68, label %70

68:                                               ; preds = %64
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef nonnull %55)
  br label %70

70:                                               ; preds = %68, %64
  call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %6) #7
  %71 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %47, ptr noundef nonnull @.str.14, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4) #7
  %.not30 = icmp eq i32 %71, -1
  br i1 %.not30, label %._crit_edge, label %57, !llvm.loop !27

._crit_edge:                                      ; preds = %70, %51
  %72 = call i32 @fclose(ptr noundef nonnull %47)
  call void @llvm.lifetime.start.p0(i64 25, ptr nonnull %7) #7
  %73 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %7, ptr noundef nonnull dereferenceable(1) @.str.17) #7
  %74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18, ptr noundef nonnull %7)
  %75 = call i32 @SHT_SecondaryGetAllEntries(ptr noundef byval(%struct.SHT_info) align 8 %31, ptr noundef byval(%struct.HT_info) align 8 %14, ptr noundef nonnull %7) #7
  %76 = icmp eq i32 %75, -1
  br i1 %76, label %77, label %79

77:                                               ; preds = %._crit_edge
  %78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19)
  br label %79

79:                                               ; preds = %77, %._crit_edge
  %80 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %7, ptr noundef nonnull dereferenceable(1) @.str.20) #7
  %81 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18, ptr noundef nonnull %7)
  %82 = call i32 @SHT_SecondaryGetAllEntries(ptr noundef byval(%struct.SHT_info) align 8 %31, ptr noundef byval(%struct.HT_info) align 8 %14, ptr noundef nonnull %7) #7
  %83 = icmp eq i32 %82, -1
  br i1 %83, label %84, label %86

84:                                               ; preds = %79
  %85 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19)
  br label %86

86:                                               ; preds = %84, %79
  %87 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %7, ptr noundef nonnull dereferenceable(1) @.str.21) #7
  %88 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18, ptr noundef nonnull %7)
  %89 = call i32 @SHT_SecondaryGetAllEntries(ptr noundef byval(%struct.SHT_info) align 8 %31, ptr noundef byval(%struct.HT_info) align 8 %14, ptr noundef nonnull %7) #7
  %90 = icmp eq i32 %89, -1
  br i1 %90, label %91, label %93

91:                                               ; preds = %86
  %92 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19)
  br label %93

93:                                               ; preds = %91, %86
  %94 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %7, ptr noundef nonnull dereferenceable(1) @.str.22) #7
  %95 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18, ptr noundef nonnull %7)
  %96 = call i32 @SHT_SecondaryGetAllEntries(ptr noundef byval(%struct.SHT_info) align 8 %31, ptr noundef byval(%struct.HT_info) align 8 %14, ptr noundef nonnull %7) #7
  %97 = icmp eq i32 %96, -1
  br i1 %97, label %98, label %100

98:                                               ; preds = %93
  %99 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19)
  br label %100

100:                                              ; preds = %98, %93
  %101 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23)
  %102 = call i32 @HashStatistics(ptr noundef nonnull @.str.4) #7
  %103 = call i32 @SHT_CloseSecondaryIndex(ptr noundef %31) #7
  %104 = call i32 @HT_CloseIndex(ptr noundef %14) #7
  call void @llvm.lifetime.end.p0(i64 25, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 25, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

declare i32 @HT_CreateIndex(ptr noundef, i8 noundef signext, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

declare ptr @HT_OpenIndex(ptr noundef) local_unnamed_addr #1

declare ptr @SHT_OpenSecondaryIndex(ptr noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #4

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #1

declare void @init_record(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @HT_InsertEntry(ptr noundef byval(%struct.HT_info) align 8, ptr noundef byval(%struct.record) align 8) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

declare i32 @SHT_SecondaryInsertEntry(ptr noundef byval(%struct.SHT_info) align 8, ptr noundef byval(%struct.SecondaryRecord) align 8) local_unnamed_addr #1

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

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #6

declare i32 @SHT_SecondaryGetAllEntries(ptr noundef byval(%struct.SHT_info) align 8, ptr noundef byval(%struct.HT_info) align 8, ptr noundef) local_unnamed_addr #1

declare i32 @HashStatistics(ptr noundef) local_unnamed_addr #1

declare i32 @SHT_CloseSecondaryIndex(ptr noundef) local_unnamed_addr #1

declare i32 @HT_CloseIndex(ptr noundef) local_unnamed_addr #1

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { noreturn nounwind "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 #7 = { nounwind }
attributes #8 = { noreturn 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, !7, i64 4}
!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, !8, i64 8}
!13 = !{!6, !10, i64 16}
!14 = !{!6, !7, i64 24}
!15 = !{!6, !11, i64 32}
!16 = !{!17, !7, i64 4}
!17 = !{!"SHT_info", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !7, i64 24, !11, i64 32, !7, i64 40}
!18 = !{!17, !10, i64 8}
!19 = !{!17, !10, i64 16}
!20 = !{!17, !7, i64 24}
!21 = !{!17, !11, i64 32}
!22 = !{!7, !7, i64 0}
!23 = !{!24, !7, i64 96}
!24 = !{!"", !25, i64 0, !7, i64 96}
!25 = !{!"record", !7, i64 0, !8, i64 4, !8, i64 19, !8, i64 44}
!26 = !{!25, !7, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass