; LLVM IR from ryanlayer/giggle :: src (metadata_index)

; 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.metadata_index = type { ptr, ptr, ptr, i8, i16, i64, ptr, ptr, ptr, i64 }
%struct.metadata_type = type { i32, i8, [32 x i8] }

@.str.37 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [65 x i8], align 1

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #1

; Function Attrs: noreturn
declare void @err(i32 noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @data_type_char_to_enum(i8 noundef signext) #3

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #4

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #5

declare void @check_file_read(ptr noundef, ptr noundef, i64 noundef, i64 noundef) #5

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @khash_str2int_init() #7

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @khash_str2int_set(ptr noundef, ptr noundef, i32 noundef) #7

; Function Attrs: nounwind
declare noalias ptr @strdup(ptr noundef) #9

declare i64 @ftell(ptr noundef) #5

; Function Attrs: nounwind uwtable
define dso_local void @read_metadata_index_header(ptr noundef %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca [7 x i8], align 1
  %8 = alloca [3 x i8], align 1
  %9 = alloca [6 x i8], align 1
  %10 = alloca i16, align 2
  %11 = alloca ptr, align 8
  %12 = alloca i8, align 1
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #10
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.metadata_index, ptr %13, i32 0, i32 1
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  store ptr %15, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #10
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.metadata_index, ptr %16, i32 0, i32 2
  %18 = load ptr, ptr %17, align 8, !tbaa !13
  store ptr %18, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #10
  call void @llvm.lifetime.start.p0(i64 7, ptr %7) #10
  call void @llvm.lifetime.start.p0(i64 3, ptr %8) #10
  call void @llvm.lifetime.start.p0(i64 6, ptr %9) #10
  call void @llvm.memset.p0.i64(ptr align 1 %9, i8 0, i64 6, i1 false)
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #10
  store i16 0, ptr %10, align 2, !tbaa !14
  %19 = call ptr @khash_str2int_init()
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.metadata_index, ptr %20, i32 0, i32 6
  store ptr %19, ptr %21, align 8, !tbaa !15
  %22 = getelementptr inbounds [7 x i8], ptr %7, i64 0, i64 0
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = call i64 @fread(ptr noundef %22, i64 noundef 1, i64 noundef 7, ptr noundef %23)
  store i64 %24, ptr %6, align 8, !tbaa !16
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = load i64, ptr %6, align 8, !tbaa !16
  call void @check_file_read(ptr noundef %25, ptr noundef %26, i64 noundef 7, i64 noundef %27)
  %28 = getelementptr inbounds [7 x i8], ptr %7, i64 0, i64 0
  %29 = call i32 @strcmp(ptr noundef %28, ptr noundef @.str.37) #11
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %1
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.48) #12
  unreachable

32:                                               ; preds = %1
  %33 = getelementptr inbounds [3 x i8], ptr %8, i64 0, i64 0
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = call i64 @fread(ptr noundef %33, i64 noundef 1, i64 noundef 3, ptr noundef %34)
  store i64 %35, ptr %6, align 8, !tbaa !16
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = load i64, ptr %6, align 8, !tbaa !16
  call void @check_file_read(ptr noundef %36, ptr noundef %37, i64 noundef 3, i64 noundef %38)
  %39 = getelementptr inbounds [3 x i8], ptr %8, i64 0, i64 0
  %40 = call i32 @strcmp(ptr noundef %39, ptr noundef @.str.39) #11
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %43

42:                                               ; preds = %32
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.49) #12
  unreachable

43:                                               ; preds = %32
  %44 = getelementptr inbounds [6 x i8], ptr %9, i64 0, i64 0
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = call i64 @fread(ptr noundef %44, i64 noundef 1, i64 noundef 6, ptr noundef %45)
  store i64 %46, ptr %6, align 8, !tbaa !16
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = load i64, ptr %6, align 8, !tbaa !16
  call void @check_file_read(ptr noundef %47, ptr noundef %48, i64 noundef 6, i64 noundef %49)
  %50 = load ptr, ptr %2, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.metadata_index, ptr %50, i32 0, i32 3
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = call i64 @fread(ptr noundef %51, i64 noundef 1, i64 noundef 1, ptr noundef %52)
  store i64 %53, ptr %6, align 8, !tbaa !16
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = load i64, ptr %6, align 8, !tbaa !16
  call void @check_file_read(ptr noundef %54, ptr noundef %55, i64 noundef 1, i64 noundef %56)
  %57 = load ptr, ptr %2, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.metadata_index, ptr %57, i32 0, i32 4
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = call i64 @fread(ptr noundef %58, i64 noundef 2, i64 noundef 1, ptr noundef %59)
  store i64 %60, ptr %6, align 8, !tbaa !16
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = load i64, ptr %6, align 8, !tbaa !16
  call void @check_file_read(ptr noundef %61, ptr noundef %62, i64 noundef 1, i64 noundef %63)
  %64 = load ptr, ptr %2, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.metadata_index, ptr %64, i32 0, i32 3
  %66 = load i8, ptr %65, align 8, !tbaa !17
  %67 = zext i8 %66 to i64
  %68 = mul i64 %67, 2
  %69 = call noalias ptr @malloc(i64 noundef %68) #13
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.metadata_index, ptr %70, i32 0, i32 7
  store ptr %69, ptr %71, align 8, !tbaa !18
  %72 = load ptr, ptr %2, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.metadata_index, ptr %72, i32 0, i32 7
  %74 = load ptr, ptr %73, align 8, !tbaa !18
  %75 = icmp eq ptr %74, null
  br i1 %75, label %76, label %77

76:                                               ; preds = %43
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.50) #12
  unreachable

77:                                               ; preds = %43
  %78 = load ptr, ptr %2, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.metadata_index, ptr %78, i32 0, i32 3
  %80 = load i8, ptr %79, align 8, !tbaa !17
  %81 = zext i8 %80 to i64
  %82 = mul i64 %81, 8
  %83 = call noalias ptr @malloc(i64 noundef %82) #13
  %84 = load ptr, ptr %2, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.metadata_index, ptr %84, i32 0, i32 8
  store ptr %83, ptr %85, align 8, !tbaa !19
  %86 = load ptr, ptr %2, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.metadata_index, ptr %86, i32 0, i32 8
  %88 = load ptr, ptr %87, align 8, !tbaa !19
  %89 = icmp eq ptr %88, null
  br i1 %89, label %90, label %91

90:                                               ; preds = %77
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.51) #12
  unreachable

91:                                               ; preds = %77
  store i32 0, ptr %5, align 4, !tbaa !20
  br label %92

92:                                               ; preds = %159, %91
  %93 = load i32, ptr %5, align 4, !tbaa !20
  %94 = load ptr, ptr %2, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.metadata_index, ptr %94, i32 0, i32 3
  %96 = load i8, ptr %95, align 8, !tbaa !17
  %97 = zext i8 %96 to i32
  %98 = icmp slt i32 %93, %97
  br i1 %98, label %99, label %162

99:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #10
  %100 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 40) #14
  store ptr %100, ptr %11, align 8, !tbaa !5
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = icmp eq ptr %101, null
  br i1 %102, label %103, label %104

103:                                              ; preds = %99
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.52) #12
  unreachable

104:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #10
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = call i64 @fread(ptr noundef %12, i64 noundef 1, i64 noundef 1, ptr noundef %105)
  store i64 %106, ptr %6, align 8, !tbaa !16
  %107 = load ptr, ptr %3, align 8, !tbaa !5
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = load i64, ptr %6, align 8, !tbaa !16
  call void @check_file_read(ptr noundef %107, ptr noundef %108, i64 noundef 1, i64 noundef %109)
  %110 = load i8, ptr %12, align 1, !tbaa !22
  %111 = call i32 @data_type_char_to_enum(i8 noundef signext %110)
  %112 = load ptr, ptr %11, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.metadata_type, ptr %112, i32 0, i32 0
  store i32 %111, ptr %113, align 4, !tbaa !23
  %114 = load ptr, ptr %11, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.metadata_type, ptr %114, i32 0, i32 1
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = call i64 @fread(ptr noundef %115, i64 noundef 1, i64 noundef 1, ptr noundef %116)
  store i64 %117, ptr %6, align 8, !tbaa !16
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = load i64, ptr %6, align 8, !tbaa !16
  call void @check_file_read(ptr noundef %118, ptr noundef %119, i64 noundef 1, i64 noundef %120)
  %121 = load ptr, ptr %11, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.metadata_type, ptr %121, i32 0, i32 2
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = call i64 @fread(ptr noundef %122, i64 noundef 1, i64 noundef 32, ptr noundef %123)
  store i64 %124, ptr %6, align 8, !tbaa !16
  %125 = load ptr, ptr %3, align 8, !tbaa !5
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = load i64, ptr %6, align 8, !tbaa !16
  call void @check_file_read(ptr noundef %125, ptr noundef %126, i64 noundef 32, i64 noundef %127)
  %128 = load ptr, ptr %2, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.metadata_index, ptr %128, i32 0, i32 6
  %130 = load ptr, ptr %129, align 8, !tbaa !15
  %131 = load ptr, ptr %11, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.metadata_type, ptr %131, i32 0, i32 2
  %133 = getelementptr inbounds [32 x i8], ptr %132, i64 0, i64 0
  %134 = call noalias ptr @strdup(ptr noundef %133) #10
  %135 = load i32, ptr %5, align 4, !tbaa !20
  %136 = call i32 @khash_str2int_set(ptr noundef %130, ptr noundef %134, i32 noundef %135)
  %137 = load i16, ptr %10, align 2, !tbaa !14
  %138 = load ptr, ptr %2, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.metadata_index, ptr %138, i32 0, i32 7
  %140 = load ptr, ptr %139, align 8, !tbaa !18
  %141 = load i32, ptr %5, align 4, !tbaa !20
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds i16, ptr %140, i64 %142
  store i16 %137, ptr %143, align 2, !tbaa !14
  %144 = load ptr, ptr %11, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.metadata_type, ptr %144, i32 0, i32 1
  %146 = load i8, ptr %145, align 4, !tbaa !25
  %147 = zext i8 %146 to i32
  %148 = load i16, ptr %10, align 2, !tbaa !14
  %149 = zext i16 %148 to i32
  %150 = add nsw i32 %149, %147
  %151 = trunc i32 %150 to i16
  store i16 %151, ptr %10, align 2, !tbaa !14
  %152 = load ptr, ptr %11, align 8, !tbaa !5
  %153 = load ptr, ptr %2, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.metadata_index, ptr %153, i32 0, i32 8
  %155 = load ptr, ptr %154, align 8, !tbaa !19
  %156 = load i32, ptr %5, align 4, !tbaa !20
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds ptr, ptr %155, i64 %157
  store ptr %152, ptr %158, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #10
  br label %159

159:                                              ; preds = %104
  %160 = load i32, ptr %5, align 4, !tbaa !20
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %5, align 4, !tbaa !20
  br label %92, !llvm.loop !26

162:                                              ; preds = %92
  %163 = load ptr, ptr %2, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.metadata_index, ptr %163, i32 0, i32 5
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = call i64 @fread(ptr noundef %164, i64 noundef 8, i64 noundef 1, ptr noundef %165)
  store i64 %166, ptr %6, align 8, !tbaa !16
  %167 = load ptr, ptr %3, align 8, !tbaa !5
  %168 = load ptr, ptr %4, align 8, !tbaa !5
  %169 = load i64, ptr %6, align 8, !tbaa !16
  call void @check_file_read(ptr noundef %167, ptr noundef %168, i64 noundef 1, i64 noundef %169)
  %170 = load ptr, ptr %4, align 8, !tbaa !5
  %171 = call i64 @ftell(ptr noundef %170)
  %172 = load ptr, ptr %2, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.metadata_index, ptr %172, i32 0, i32 9
  store i64 %171, ptr %173, align 8, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #10
  call void @llvm.lifetime.end.p0(i64 6, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 3, ptr %8) #10
  call void @llvm.lifetime.end.p0(i64 7, ptr %7) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #10
  ret void
}

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

!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, !6, i64 8}
!10 = !{!"metadata_index", !6, i64 0, !6, i64 8, !6, i64 16, !7, i64 24, !11, i64 26, !12, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !12, i64 64}
!11 = !{!"short", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!10, !6, i64 16}
!14 = !{!11, !11, i64 0}
!15 = !{!10, !6, i64 40}
!16 = !{!12, !12, i64 0}
!17 = !{!10, !7, i64 24}
!18 = !{!10, !6, i64 48}
!19 = !{!10, !6, i64 56}
!20 = !{!21, !21, i64 0}
!21 = !{!"int", !7, i64 0}
!22 = !{!7, !7, i64 0}
!23 = !{!24, !21, i64 0}
!24 = !{!"metadata_type", !21, i64 0, !7, i64 4, !7, i64 5}
!25 = !{!24, !7, i64 4}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!10, !12, i64 64}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str.37 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [65 x i8], align 1

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

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

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

; Function Attrs: noreturn
declare void @err(i32 noundef, ptr noundef, ...) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @data_type_char_to_enum(i8 noundef signext) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5

declare void @check_file_read(ptr noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #7

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @khash_str2int_init() local_unnamed_addr #8

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @khash_str2int_set(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #8

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias ptr @strdup(ptr nocapture noundef readonly) local_unnamed_addr #10

; Function Attrs: nofree nounwind
declare noundef i64 @ftell(ptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
define dso_local void @read_metadata_index_header(ptr nocapture noundef %0) local_unnamed_addr #3 {
  %2 = alloca [7 x i8], align 1
  %3 = alloca [3 x i8], align 1
  %4 = alloca [6 x i8], align 1
  %5 = alloca i8, align 1
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  %9 = load ptr, ptr %8, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 7, ptr nonnull %2) #11
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %3) #11
  call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %4) #11
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(6) %4, i8 0, i64 6, i1 false)
  %10 = tail call ptr @khash_str2int_init()
  %11 = getelementptr inbounds i8, ptr %0, i64 40
  store ptr %10, ptr %11, align 8, !tbaa !13
  %12 = call i64 @fread(ptr noundef nonnull %2, i64 noundef 1, i64 noundef 7, ptr noundef %9)
  tail call void @check_file_read(ptr noundef %7, ptr noundef %9, i64 noundef 7, i64 noundef %12) #11
  %13 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.37) #12
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %15, label %14

14:                                               ; preds = %1
  tail call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.48) #13
  unreachable

15:                                               ; preds = %1
  %16 = call i64 @fread(ptr noundef nonnull %3, i64 noundef 1, i64 noundef 3, ptr noundef %9)
  tail call void @check_file_read(ptr noundef %7, ptr noundef %9, i64 noundef 3, i64 noundef %16) #11
  %17 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.39) #12
  %.not69 = icmp eq i32 %17, 0
  br i1 %.not69, label %19, label %18

18:                                               ; preds = %15
  tail call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.49) #13
  unreachable

19:                                               ; preds = %15
  %20 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 1, i64 noundef 6, ptr noundef %9)
  tail call void @check_file_read(ptr noundef %7, ptr noundef %9, i64 noundef 6, i64 noundef %20) #11
  %21 = getelementptr inbounds i8, ptr %0, i64 24
  %22 = tail call i64 @fread(ptr noundef nonnull %21, i64 noundef 1, i64 noundef 1, ptr noundef %9)
  tail call void @check_file_read(ptr noundef %7, ptr noundef %9, i64 noundef 1, i64 noundef %22) #11
  %23 = getelementptr inbounds i8, ptr %0, i64 26
  %24 = tail call i64 @fread(ptr noundef nonnull %23, i64 noundef 2, i64 noundef 1, ptr noundef %9)
  tail call void @check_file_read(ptr noundef %7, ptr noundef %9, i64 noundef 1, i64 noundef %24) #11
  %25 = load i8, ptr %21, align 8, !tbaa !14
  %26 = zext i8 %25 to i64
  %27 = shl nuw nsw i64 %26, 1
  %28 = tail call noalias ptr @malloc(i64 noundef %27) #14
  %29 = getelementptr inbounds i8, ptr %0, i64 48
  store ptr %28, ptr %29, align 8, !tbaa !15
  %30 = icmp eq ptr %28, null
  br i1 %30, label %31, label %32

31:                                               ; preds = %19
  tail call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.50) #13
  unreachable

32:                                               ; preds = %19
  %33 = shl nuw nsw i64 %26, 3
  %34 = tail call noalias ptr @malloc(i64 noundef %33) #14
  %35 = getelementptr inbounds i8, ptr %0, i64 56
  store ptr %34, ptr %35, align 8, !tbaa !16
  %36 = icmp eq ptr %34, null
  br i1 %36, label %37, label %.preheader

.preheader:                                       ; preds = %32
  %.not72 = icmp eq i8 %25, 0
  br i1 %.not72, label %._crit_edge, label %.lr.ph

37:                                               ; preds = %32
  tail call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.51) #13
  unreachable

.lr.ph:                                           ; preds = %.preheader, %41
  %indvars.iv = phi i64 [ %indvars.iv.next, %41 ], [ 0, %.preheader ]
  %.06770 = phi i16 [ %57, %41 ], [ 0, %.preheader ]
  %38 = tail call noalias dereferenceable_or_null(40) ptr @calloc(i64 noundef 1, i64 noundef 40) #15
  %39 = icmp eq ptr %38, null
  br i1 %39, label %40, label %41

40:                                               ; preds = %.lr.ph
  tail call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.52) #13
  unreachable

41:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #11
  %42 = call i64 @fread(ptr noundef nonnull %5, i64 noundef 1, i64 noundef 1, ptr noundef %9)
  tail call void @check_file_read(ptr noundef %7, ptr noundef %9, i64 noundef 1, i64 noundef %42) #11
  %43 = load i8, ptr %5, align 1, !tbaa !17
  %44 = tail call i32 @data_type_char_to_enum(i8 noundef signext %43)
  store i32 %44, ptr %38, align 4, !tbaa !18
  %45 = getelementptr inbounds i8, ptr %38, i64 4
  %46 = tail call i64 @fread(ptr noundef nonnull %45, i64 noundef 1, i64 noundef 1, ptr noundef %9)
  tail call void @check_file_read(ptr noundef %7, ptr noundef %9, i64 noundef 1, i64 noundef %46) #11
  %47 = getelementptr inbounds i8, ptr %38, i64 5
  %48 = tail call i64 @fread(ptr noundef nonnull %47, i64 noundef 1, i64 noundef 32, ptr noundef %9)
  tail call void @check_file_read(ptr noundef %7, ptr noundef %9, i64 noundef 32, i64 noundef %48) #11
  %49 = load ptr, ptr %11, align 8, !tbaa !13
  %50 = tail call noalias ptr @strdup(ptr noundef nonnull %47) #11
  %51 = trunc nuw nsw i64 %indvars.iv to i32
  %52 = tail call i32 @khash_str2int_set(ptr noundef %49, ptr noundef %50, i32 noundef %51)
  %53 = load ptr, ptr %29, align 8, !tbaa !15
  %54 = getelementptr inbounds i16, ptr %53, i64 %indvars.iv
  store i16 %.06770, ptr %54, align 2, !tbaa !21
  %55 = load i8, ptr %45, align 4, !tbaa !22
  %56 = zext i8 %55 to i16
  %57 = add i16 %.06770, %56
  %58 = load ptr, ptr %35, align 8, !tbaa !16
  %59 = getelementptr inbounds ptr, ptr %58, i64 %indvars.iv
  store ptr %38, ptr %59, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %60 = load i8, ptr %21, align 8, !tbaa !14
  %61 = zext i8 %60 to i64
  %62 = icmp ult i64 %indvars.iv.next, %61
  br i1 %62, label %.lr.ph, label %._crit_edge, !llvm.loop !24

._crit_edge:                                      ; preds = %41, %.preheader
  %63 = getelementptr inbounds i8, ptr %0, i64 32
  %64 = tail call i64 @fread(ptr noundef nonnull %63, i64 noundef 8, i64 noundef 1, ptr noundef %9)
  tail call void @check_file_read(ptr noundef %7, ptr noundef %9, i64 noundef 1, i64 noundef %64) #11
  %65 = tail call i64 @ftell(ptr noundef %9)
  %66 = getelementptr inbounds i8, ptr %0, i64 64
  store i64 %65, ptr %66, align 8, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %4) #11
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %3) #11
  call void @llvm.lifetime.end.p0(i64 7, ptr nonnull %2) #11
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind 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 allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 #6 = { "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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #8 = { inlinehint 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 #9 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #10 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #11 = { nounwind }
attributes #12 = { nounwind willreturn memory(read) }
attributes #13 = { noreturn nounwind }
attributes #14 = { nounwind allocsize(0) }
attributes #15 = { nounwind allocsize(0,1) }

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass