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

@.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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @HT_DeleteEntry(ptr noundef byval(%struct.HT_info) align 8 %0, ptr noundef %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 ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %20 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 5
  %21 = load i64, ptr %20, align 8, !tbaa !9
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = call i32 @hash(i64 noundef %21, ptr noundef %22)
  store i32 %23, ptr %5, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store ptr null, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 1
  %25 = load i32, ptr %24, align 4, !tbaa !14
  %26 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 6
  %27 = load i32, ptr %26, align 8, !tbaa !15
  %28 = call i32 @BF_ReadBlock(i32 noundef %25, i32 noundef %27, ptr noundef %6)
  %29 = icmp slt i32 %28, 0
  br i1 %29, label %30, label %31

30:                                               ; 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 %161

31:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %32, i64 512
  %34 = getelementptr inbounds i8, ptr %33, i64 -4
  %35 = load i32, ptr %34, align 4, !tbaa !13
  store i32 %35, ptr %8, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 127, ptr %10, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 -1, ptr %11, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  br label %36

36:                                               ; preds = %71, %31
  %37 = load i32, ptr %8, align 4, !tbaa !13
  %38 = icmp ne i32 %37, -1
  br i1 %38, label %39, label %76

39:                                               ; preds = %36
  %40 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 1
  %41 = load i32, ptr %40, align 4, !tbaa !14
  %42 = load i32, ptr %8, align 4, !tbaa !13
  %43 = call i32 @BF_ReadBlock(i32 noundef %41, i32 noundef %42, ptr noundef %9)
  %44 = icmp slt i32 %43, 0
  br i1 %44, label %45, label %46

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

46:                                               ; preds = %39
  store i32 0, ptr %12, align 4, !tbaa !13
  br label %47

47:                                               ; preds = %59, %46
  %48 = load i32, ptr %12, align 4, !tbaa !13
  %49 = load i32, ptr %10, align 4, !tbaa !13
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %51, label %62

51:                                               ; preds = %47
  %52 = load i32, ptr %11, align 4, !tbaa !13
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %11, align 4, !tbaa !13
  %54 = load i32, ptr %5, align 4, !tbaa !13
  %55 = load i32, ptr %11, align 4, !tbaa !13
  %56 = icmp eq i32 %54, %55
  br i1 %56, label %57, label %58

57:                                               ; preds = %51
  br label %62

58:                                               ; preds = %51
  br label %59

59:                                               ; preds = %58
  %60 = load i32, ptr %12, align 4, !tbaa !13
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %12, align 4, !tbaa !13
  br label %47, !llvm.loop !16

62:                                               ; preds = %57, %47
  %63 = load i32, ptr %5, align 4, !tbaa !13
  %64 = load i32, ptr %11, align 4, !tbaa !13
  %65 = icmp eq i32 %63, %64
  br i1 %65, label %66, label %71

66:                                               ; preds = %62
  %67 = load i32, ptr %12, align 4, !tbaa !13
  %68 = sext i32 %67 to i64
  %69 = mul i64 %68, 4
  %70 = trunc i64 %69 to i32
  store i32 %70, ptr %5, align 4, !tbaa !13
  br label %76

71:                                               ; preds = %62
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %72, i64 512
  %74 = getelementptr inbounds i8, ptr %73, i64 -4
  %75 = load i32, ptr %74, align 4, !tbaa !13
  store i32 %75, ptr %8, align 4, !tbaa !13
  br label %36, !llvm.loop !18

76:                                               ; preds = %66, %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = load i32, ptr %5, align 4, !tbaa !13
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds i8, ptr %77, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !13
  store i32 %81, ptr %13, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store ptr null, ptr %15, align 8, !tbaa !5
  br label %82

82:                                               ; preds = %153, %76
  %83 = load i32, ptr %13, align 4, !tbaa !13
  %84 = icmp ne i32 %83, -1
  br i1 %84, label %85, label %158

85:                                               ; preds = %82
  %86 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 1
  %87 = load i32, ptr %86, align 4, !tbaa !14
  %88 = load i32, ptr %13, align 4, !tbaa !13
  %89 = call i32 @BF_ReadBlock(i32 noundef %87, i32 noundef %88, ptr noundef %15)
  %90 = icmp slt i32 %89, 0
  br i1 %90, label %91, label %92

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

92:                                               ; preds = %85
  %93 = load ptr, ptr %15, align 8, !tbaa !5
  %94 = getelementptr inbounds i8, ptr %93, i64 512
  %95 = getelementptr inbounds i8, ptr %94, i64 -4
  %96 = load i32, ptr %95, align 4, !tbaa !13
  store i32 %96, ptr %14, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !13
  br label %97

97:                                               ; preds = %148, %92
  %98 = load i32, ptr %16, align 4, !tbaa !13
  %99 = load i32, ptr %14, align 4, !tbaa !13
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %97
  store i32 9, ptr %7, align 4
  br label %151

102:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %103 = load ptr, ptr %15, align 8, !tbaa !5
  %104 = load i32, ptr %16, align 4, !tbaa !13
  %105 = sext i32 %104 to i64
  %106 = mul i64 %105, 96
  %107 = getelementptr inbounds i8, ptr %103, i64 %106
  store ptr %107, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %108 = load ptr, ptr %17, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 3
  %110 = load ptr, ptr %109, align 8, !tbaa !19
  %111 = call ptr @get_key(ptr noundef %108, ptr noundef %110)
  store ptr %111, ptr %18, align 8, !tbaa !5
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = load ptr, ptr %18, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 4
  %115 = load i32, ptr %114, align 8, !tbaa !20
  %116 = sext i32 %115 to i64
  %117 = call i32 @memcmp(ptr noundef %112, ptr noundef %113, i64 noundef %116) #6
  %118 = icmp eq i32 %117, 0
  br i1 %118, label %119, label %144

119:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %120 = load ptr, ptr %15, align 8, !tbaa !5
  %121 = load i32, ptr %14, align 4, !tbaa !13
  %122 = sext i32 %121 to i64
  %123 = mul i64 %122, 96
  %124 = getelementptr inbounds i8, ptr %120, i64 %123
  store ptr %124, ptr %19, align 8, !tbaa !5
  %125 = load i32, ptr %14, align 4, !tbaa !13
  %126 = add nsw i32 %125, -1
  store i32 %126, ptr %14, align 4, !tbaa !13
  %127 = load ptr, ptr %15, align 8, !tbaa !5
  %128 = getelementptr inbounds i8, ptr %127, i64 512
  %129 = getelementptr inbounds i8, ptr %128, i64 -4
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %129, ptr align 4 %14, i64 4, i1 false)
  %130 = load ptr, ptr %15, align 8, !tbaa !5
  %131 = load i32, ptr %16, align 4, !tbaa !13
  %132 = sext i32 %131 to i64
  %133 = mul i64 %132, 96
  %134 = getelementptr inbounds i8, ptr %130, i64 %133
  %135 = load ptr, ptr %19, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %134, ptr align 4 %135, i64 96, i1 false)
  %136 = getelementptr inbounds %struct.HT_info, ptr %0, i32 0, i32 1
  %137 = load i32, ptr %136, align 4, !tbaa !14
  %138 = load i32, ptr %13, align 4, !tbaa !13
  %139 = call i32 @BF_WriteBlock(i32 noundef %137, i32 noundef %138)
  %140 = icmp slt i32 %139, 0
  br i1 %140, label %141, label %142

141:                                              ; preds = %119
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %143

142:                                              ; preds = %119
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %143

143:                                              ; preds = %142, %141
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %145

144:                                              ; preds = %102
  store i32 0, ptr %7, align 4
  br label %145

145:                                              ; preds = %144, %143
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  %146 = load i32, ptr %7, align 4
  switch i32 %146, label %151 [
    i32 0, label %147
  ]

147:                                              ; preds = %145
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %16, align 4, !tbaa !13
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %16, align 4, !tbaa !13
  br label %97, !llvm.loop !21

151:                                              ; preds = %145, %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  %152 = load i32, ptr %7, align 4
  switch i32 %152, label %159 [
    i32 9, label %153
  ]

153:                                              ; preds = %151
  %154 = load ptr, ptr %15, align 8, !tbaa !5
  %155 = getelementptr inbounds i8, ptr %154, i64 512
  %156 = getelementptr inbounds i8, ptr %155, i64 -8
  %157 = load i32, ptr %156, align 4, !tbaa !13
  store i32 %157, ptr %13, align 4, !tbaa !13
  br label %82, !llvm.loop !22

158:                                              ; preds = %82
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %159

159:                                              ; preds = %158, %151, %91
  call void @llvm.lifetime.end.p0(i64 8, 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 %160

160:                                              ; preds = %159, %45
  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 %161

161:                                              ; preds = %160, %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  %162 = load i32, ptr %3, align 4
  ret i32 %162
}

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 = !{!"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 = !{!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 = !{!10, !6, i64 16}
!20 = !{!10, !11, i64 24}
!21 = distinct !{!21, !17}
!22 = distinct !{!22, !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.HT_info = type { i32, i32, i8, ptr, i32, i64, i32 }

@.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

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

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

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

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

16:                                               ; preds = %2
  %17 = load ptr, ptr %3, align 8, !tbaa !12
  %18 = getelementptr inbounds i8, ptr %17, i64 508
  %19 = load i32, ptr %18, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  store ptr null, ptr %4, align 8, !tbaa !12
  %.not58 = icmp ne i32 %19, -1
  call void @llvm.assume(i1 %.not58)
  br label %.lr.ph

.lr.ph:                                           ; preds = %16, %40
  %.03960 = phi i32 [ %27, %40 ], [ -1, %16 ]
  %.04259 = phi i32 [ %43, %40 ], [ %19, %16 ]
  %20 = call i32 @BF_ReadBlock(i32 noundef %10, i32 noundef %.04259, ptr noundef nonnull %4) #6
  %21 = icmp slt i32 %20, 0
  br i1 %21, label %22, label %.preheader

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

.preheader:                                       ; preds = %.lr.ph, %32
  %.03857 = phi i32 [ %33, %32 ], [ 0, %.lr.ph ]
  %.14056 = phi i32 [ %30, %32 ], [ %.03960, %.lr.ph ]
  %23 = add nsw i32 %.14056, 1
  %24 = icmp eq i32 %8, %23
  br i1 %24, label %.thread.loopexit, label %.preheader.1

.preheader.1:                                     ; preds = %.preheader
  %25 = add nsw i32 %.14056, 2
  %26 = icmp eq i32 %8, %25
  br i1 %26, label %.thread.loopexit.split.loop.exit120, label %.preheader.2

.preheader.2:                                     ; preds = %.preheader.1
  %27 = add nsw i32 %.14056, 3
  %28 = icmp eq i32 %8, %27
  br i1 %28, label %.thread.loopexit.split.loop.exit118, label %29

29:                                               ; preds = %.preheader.2
  %exitcond.not.2 = icmp eq i32 %.03857, 124
  br i1 %exitcond.not.2, label %34, label %.preheader.3, !llvm.loop !16

.preheader.3:                                     ; preds = %29
  %30 = add nsw i32 %.14056, 4
  %31 = icmp eq i32 %8, %30
  br i1 %31, label %.thread.loopexit.split.loop.exit, label %32

32:                                               ; preds = %.preheader.3
  %33 = add nuw nsw i32 %.03857, 4
  br label %.preheader

34:                                               ; preds = %29
  %35 = icmp eq i32 %8, %27
  br i1 %35, label %.thread, label %40

.thread.loopexit.split.loop.exit:                 ; preds = %.preheader.3
  %36 = or disjoint i32 %.03857, 3
  br label %.thread.loopexit

.thread.loopexit.split.loop.exit118:              ; preds = %.preheader.2
  %37 = or disjoint i32 %.03857, 2
  br label %.thread.loopexit

.thread.loopexit.split.loop.exit120:              ; preds = %.preheader.1
  %38 = or disjoint i32 %.03857, 1
  br label %.thread.loopexit

.thread.loopexit:                                 ; preds = %.preheader, %.thread.loopexit.split.loop.exit120, %.thread.loopexit.split.loop.exit118, %.thread.loopexit.split.loop.exit
  %.03857.lcssa = phi i32 [ %36, %.thread.loopexit.split.loop.exit ], [ %37, %.thread.loopexit.split.loop.exit118 ], [ %38, %.thread.loopexit.split.loop.exit120 ], [ %.03857, %.preheader ]
  %39 = shl i32 %.03857.lcssa, 2
  br label %.thread

.thread:                                          ; preds = %34, %.thread.loopexit
  %.038.lcssa80 = phi i32 [ %39, %.thread.loopexit ], [ 508, %34 ]
  %.pre = load ptr, ptr %4, align 8, !tbaa !12
  br label %.loopexit52

40:                                               ; preds = %34
  %41 = load ptr, ptr %4, align 8, !tbaa !12
  %42 = getelementptr inbounds i8, ptr %41, i64 508
  %43 = load i32, ptr %42, align 4, !tbaa !15
  %.not = icmp eq i32 %43, -1
  br i1 %.not, label %.loopexit52, label %.lr.ph, !llvm.loop !18

.loopexit52:                                      ; preds = %40, %.thread
  %44 = phi ptr [ %.pre, %.thread ], [ %41, %40 ]
  %.030 = phi i32 [ %.038.lcssa80, %.thread ], [ %8, %40 ]
  %45 = sext i32 %.030 to i64
  %46 = getelementptr inbounds i8, ptr %44, i64 %45
  %47 = load i32, ptr %46, 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
  %.not4564 = icmp eq i32 %47, -1
  br i1 %.not4564, label %.loopexit, label %.lr.ph67

.lr.ph67:                                         ; preds = %.loopexit52
  %48 = getelementptr inbounds i8, ptr %0, i64 16
  %49 = load ptr, ptr %48, align 8
  %50 = getelementptr inbounds i8, ptr %0, i64 24
  %51 = load i32, ptr %50, align 8
  %52 = sext i32 %51 to i64
  br label %53

53:                                               ; preds = %.lr.ph67, %._crit_edge
  %.03765 = phi i32 [ %47, %.lr.ph67 ], [ %75, %._crit_edge ]
  %54 = call i32 @BF_ReadBlock(i32 noundef %10, i32 noundef %.03765, ptr noundef nonnull %5) #6
  %55 = icmp slt i32 %54, 0
  br i1 %55, label %56, label %57

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

57:                                               ; preds = %53
  %58 = load ptr, ptr %5, align 8, !tbaa !12
  %59 = getelementptr inbounds i8, ptr %58, i64 508
  %60 = load i32, ptr %59, align 4, !tbaa !15
  %.not4761 = icmp sgt i32 %60, 0
  br i1 %.not4761, label %.lr.ph63.preheader, label %._crit_edge

.lr.ph63.preheader:                               ; preds = %57
  %wide.trip.count = zext nneg i32 %60 to i64
  br label %.lr.ph63

61:                                               ; preds = %.lr.ph63
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond76.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond76.not, label %._crit_edge.loopexit, label %.lr.ph63, !llvm.loop !19

.lr.ph63:                                         ; preds = %.lr.ph63.preheader, %61
  %indvars.iv = phi i64 [ 0, %.lr.ph63.preheader ], [ %indvars.iv.next, %61 ]
  %62 = load ptr, ptr %5, align 8, !tbaa !12
  %63 = mul nuw nsw i64 %indvars.iv, 96
  %64 = getelementptr inbounds i8, ptr %62, i64 %63
  %65 = call ptr @get_key(ptr noundef %64, ptr noundef %49) #6
  %bcmp = call i32 @bcmp(ptr %1, ptr %65, i64 %52)
  %.not46 = icmp eq i32 %bcmp, 0
  br i1 %.not46, label %.thread50, label %61

.thread50:                                        ; preds = %.lr.ph63
  %66 = load ptr, ptr %5, align 8, !tbaa !12
  %67 = mul nuw nsw i64 %wide.trip.count, 96
  %68 = getelementptr inbounds i8, ptr %66, i64 %67
  %69 = add nsw i32 %60, -1
  %70 = getelementptr inbounds i8, ptr %66, i64 508
  store i32 %69, ptr %70, align 1
  %71 = getelementptr inbounds i8, ptr %66, i64 %63
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(96) %71, ptr noundef nonnull align 4 dereferenceable(96) %68, i64 96, i1 false)
  %72 = call i32 @BF_WriteBlock(i32 noundef %10, i32 noundef %.03765) #6
  %.lobit = ashr i32 %72, 31
  br label %.loopexit

._crit_edge.loopexit:                             ; preds = %61
  %.pre77 = load ptr, ptr %5, align 8, !tbaa !12
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %57
  %73 = phi ptr [ %.pre77, %._crit_edge.loopexit ], [ %58, %57 ]
  %74 = getelementptr inbounds i8, ptr %73, i64 504
  %75 = load i32, ptr %74, align 4, !tbaa !15
  %.not45 = icmp eq i32 %75, -1
  br i1 %.not45, label %.loopexit, label %53, !llvm.loop !20

.loopexit:                                        ; preds = %._crit_edge, %.loopexit52, %.thread50, %56
  %.5 = phi i32 [ -1, %56 ], [ %.lobit, %.thread50 ], [ -1, %.loopexit52 ], [ -1, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %76

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

77:                                               ; preds = %76, %15
  %.7 = phi i32 [ -1, %15 ], [ %.6, %76 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret i32 %.7
}

; 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, !11, i64 32}
!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, !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 = distinct !{!19, !17}
!20 = distinct !{!20, !17}


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