; LLVM IR from pmwkaa/monotone :: monotone/engine/io (index_op)

; 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.Runtime = type { %struct.ExceptionMgr, %struct.Error, ptr }
%struct.ExceptionMgr = type { ptr }
%struct.Error = type { [256 x i8], i32, ptr, ptr, i32, ptr, ptr }
%struct.Buf = type { ptr, ptr, ptr }
%struct.Guard = type { ptr, ptr, ptr }
%struct.Index = type <{ i32, i32, i32, i32, %struct.Id, i32, i32, i64, i64, i64, i64, i32, i64, i64, i64, i32, i64, i8, i8, [4 x i32] }>
%struct.Id = type { i64, i64 }
%struct.File = type { i32, i64, %struct.Str, %struct.List }
%struct.Str = type { ptr, ptr, i8 }
%struct.List = type { ptr, ptr }
%struct.Context = type { ptr, ptr, ptr }
%struct.Global = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.Exception = type { ptr, i8, ptr, [1 x %struct.__jmp_buf_tag] }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }

@mn_runtime = external thread_local global %struct.Runtime, align 8
@.str = external hidden unnamed_addr constant [79 x i8], align 1
@__func__.index_read = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [45 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: inlinehint noreturn nounwind uwtable
declare hidden void @error_throw_as(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ...) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @str_of(ptr noundef) #3

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

; Function Attrs: nounwind uwtable
define dso_local void @index_read(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i1 noundef zeroext %4) #4 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i8, align 1
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca %struct.Buf, align 8
  %16 = alloca %struct.Guard, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca %struct.Buf, align 8
  %21 = alloca %struct.Guard, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %25 = zext i1 %4 to i8
  store i8 %25, ptr %10, align 1, !tbaa !9
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.Index, ptr %27, i32 0, i32 5
  %29 = load i32, ptr %28, align 1, !tbaa !11
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %5
  br label %132

32:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.File, ptr %33, i32 0, i32 1
  %35 = load i64, ptr %34, align 8, !tbaa !16
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.Index, ptr %36, i32 0, i32 5
  %38 = load i32, ptr %37, align 1, !tbaa !11
  %39 = zext i32 %38 to i64
  %40 = add i64 130, %39
  %41 = sub i64 %35, %40
  store i64 %41, ptr %11, align 8, !tbaa !20
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.Index, ptr %44, i32 0, i32 5
  %46 = load i32, ptr %45, align 1, !tbaa !11
  %47 = load i64, ptr %11, align 8, !tbaa !20
  call void @file_pread_buf(ptr noundef %42, ptr noundef %43, i32 noundef %46, i64 noundef %47)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %48 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %49 = getelementptr inbounds %struct.Runtime, ptr %48, i32 0, i32 2
  %50 = load ptr, ptr %49, align 8, !tbaa !21
  %51 = getelementptr inbounds %struct.Context, ptr %50, i32 0, i32 2
  %52 = load ptr, ptr %51, align 8, !tbaa !25
  %53 = getelementptr inbounds %struct.Global, ptr %52, i32 0, i32 4
  %54 = load ptr, ptr %53, align 8, !tbaa !27
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.Buf, ptr %55, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !29
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = call i32 @buf_size(ptr noundef %58)
  %60 = call i32 %54(i32 noundef 0, ptr noundef %57, i32 noundef %59)
  store i32 %60, ptr %12, align 4, !tbaa !31
  %61 = load i32, ptr %12, align 4, !tbaa !31
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.Index, ptr %62, i32 0, i32 1
  %64 = load i32, ptr %63, align 1, !tbaa !32
  %65 = icmp ne i32 %61, %64
  br i1 %65, label %66, label %74

66:                                               ; preds = %32
  %67 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %68 = getelementptr inbounds %struct.Runtime, ptr %67, i32 0, i32 1
  %69 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %70 = getelementptr inbounds %struct.Runtime, ptr %69, i32 0, i32 0
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.File, ptr %71, i32 0, i32 2
  %73 = call ptr @str_of(ptr noundef %72)
  call void (ptr, ptr, ptr, ptr, i32, ptr, ...) @error_throw_as(ptr noundef %68, ptr noundef %70, ptr noundef @.str, ptr noundef @__func__.index_read, i32 noundef 157, ptr noundef @.str.6, ptr noundef %73) #7
  unreachable

74:                                               ; preds = %32
  %75 = load i8, ptr %10, align 1, !tbaa !9, !range !33, !noundef !34
  %76 = trunc i8 %75 to i1
  br i1 %76, label %77, label %78

77:                                               ; preds = %74
  store i32 1, ptr %13, align 4
  br label %130

78:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %79, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #6
  call void @buf_init(ptr noundef %15)
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #6
  %80 = getelementptr inbounds %struct.Guard, ptr %16, i32 0, i32 0
  store ptr @buf_free, ptr %80, align 8, !tbaa !35
  %81 = getelementptr inbounds %struct.Guard, ptr %16, i32 0, i32 1
  store ptr %15, ptr %81, align 8, !tbaa !37
  %82 = getelementptr inbounds %struct.Guard, ptr %16, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %83 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %84 = getelementptr inbounds %struct.Runtime, ptr %83, i32 0, i32 0
  %85 = getelementptr inbounds %struct.ExceptionMgr, ptr %84, i32 0, i32 0
  %86 = load ptr, ptr %85, align 8, !tbaa !38
  store ptr %86, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %87 = load ptr, ptr %17, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.Exception, ptr %87, i32 0, i32 2
  %89 = load ptr, ptr %88, align 8, !tbaa !39
  store ptr %89, ptr %18, align 8, !tbaa !5
  %90 = load ptr, ptr %17, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.Exception, ptr %90, i32 0, i32 2
  store ptr %16, ptr %91, align 8, !tbaa !39
  %92 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %92, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  %93 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %93, ptr %82, align 8, !tbaa !41
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = load ptr, ptr %14, align 8, !tbaa !5
  %98 = call ptr @index_decrypt(ptr noundef %94, ptr noundef %95, ptr noundef %96, ptr noundef %97, ptr noundef %15)
  store ptr %98, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #6
  call void @buf_init(ptr noundef %20)
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #6
  %99 = getelementptr inbounds %struct.Guard, ptr %21, i32 0, i32 0
  store ptr @buf_free, ptr %99, align 8, !tbaa !35
  %100 = getelementptr inbounds %struct.Guard, ptr %21, i32 0, i32 1
  store ptr %20, ptr %100, align 8, !tbaa !37
  %101 = getelementptr inbounds %struct.Guard, ptr %21, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %102 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %103 = getelementptr inbounds %struct.Runtime, ptr %102, i32 0, i32 0
  %104 = getelementptr inbounds %struct.ExceptionMgr, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !38
  store ptr %105, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %106 = load ptr, ptr %22, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.Exception, ptr %106, i32 0, i32 2
  %108 = load ptr, ptr %107, align 8, !tbaa !39
  store ptr %108, ptr %23, align 8, !tbaa !5
  %109 = load ptr, ptr %22, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.Exception, ptr %109, i32 0, i32 2
  store ptr %21, ptr %110, align 8, !tbaa !39
  %111 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %111, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  %112 = load ptr, ptr %24, align 8, !tbaa !5
  store ptr %112, ptr %101, align 8, !tbaa !41
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  %115 = load ptr, ptr %8, align 8, !tbaa !5
  %116 = load ptr, ptr %14, align 8, !tbaa !5
  %117 = call ptr @index_decompress(ptr noundef %113, ptr noundef %114, ptr noundef %115, ptr noundef %116, ptr noundef %20)
  store ptr %117, ptr %14, align 8, !tbaa !5
  %118 = load ptr, ptr %14, align 8, !tbaa !5
  %119 = load ptr, ptr %9, align 8, !tbaa !5
  %120 = icmp ne ptr %118, %119
  br i1 %120, label %121, label %129

121:                                              ; preds = %78
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  call void @buf_reset(ptr noundef %122)
  %123 = load ptr, ptr %9, align 8, !tbaa !5
  %124 = load ptr, ptr %14, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.Buf, ptr %124, i32 0, i32 0
  %126 = load ptr, ptr %125, align 8, !tbaa !29
  %127 = load ptr, ptr %14, align 8, !tbaa !5
  %128 = call i32 @buf_size(ptr noundef %127)
  call void @buf_write(ptr noundef %123, ptr noundef %126, i32 noundef %128)
  br label %129

129:                                              ; preds = %121, %78
  call void @guard_runner(ptr noundef %21)
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #6
  call void @guard_runner(ptr noundef %16)
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  store i32 0, ptr %13, align 4
  br label %130

130:                                              ; preds = %129, %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  %131 = load i32, ptr %13, align 4
  switch i32 %131, label %133 [
    i32 0, label %132
    i32 1, label %132
  ]

132:                                              ; preds = %130, %130, %31
  ret void

133:                                              ; preds = %130
  unreachable
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @file_pread_buf(ptr noundef, ptr noundef, i32 noundef, i64 noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @buf_size(ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @buf_init(ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @buf_free(ptr noundef) #3

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @guard_runner(ptr noundef) #5

; Function Attrs: nounwind uwtable
declare hidden ptr @index_decrypt(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden ptr @index_decompress(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @buf_reset(ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @buf_write(ptr noundef, ptr noundef, i32 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint noreturn 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 #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { 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 #5 = { alwaysinline 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 #6 = { nounwind }
attributes #7 = { noreturn }

!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, !10, i64 0}
!10 = !{!"_Bool", !7, i64 0}
!11 = !{!12, !13, i64 32}
!12 = !{!"Index", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !14, i64 16, !13, i64 32, !13, i64 36, !15, i64 40, !15, i64 48, !15, i64 56, !15, i64 64, !13, i64 72, !15, i64 76, !15, i64 84, !15, i64 92, !13, i64 100, !15, i64 104, !7, i64 112, !7, i64 113, !7, i64 114}
!13 = !{!"int", !7, i64 0}
!14 = !{!"Id", !15, i64 0, !15, i64 8}
!15 = !{!"long", !7, i64 0}
!16 = !{!17, !15, i64 8}
!17 = !{!"File", !13, i64 0, !15, i64 8, !18, i64 16, !19, i64 40}
!18 = !{!"Str", !6, i64 0, !6, i64 8, !10, i64 16}
!19 = !{!"List", !6, i64 0, !6, i64 8}
!20 = !{!15, !15, i64 0}
!21 = !{!22, !6, i64 312}
!22 = !{!"Runtime", !23, i64 0, !24, i64 8, !6, i64 312}
!23 = !{!"ExceptionMgr", !6, i64 0}
!24 = !{!"Error", !7, i64 0, !13, i64 256, !6, i64 264, !6, i64 272, !13, i64 280, !6, i64 288, !6, i64 296}
!25 = !{!26, !6, i64 16}
!26 = !{!"Context", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!28, !6, i64 32}
!28 = !{!"Global", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!29 = !{!30, !6, i64 0}
!30 = !{!"Buf", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!13, !13, i64 0}
!32 = !{!12, !13, i64 4}
!33 = !{i8 0, i8 2}
!34 = !{}
!35 = !{!36, !6, i64 0}
!36 = !{!"Guard", !6, i64 0, !6, i64 8, !6, i64 16}
!37 = !{!36, !6, i64 8}
!38 = !{!22, !6, i64 0}
!39 = !{!40, !6, i64 16}
!40 = !{!"Exception", !6, i64 0, !10, i64 8, !6, i64 16, !7, i64 24}
!41 = !{!36, !6, i64 16}


; 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.Runtime = type { %struct.ExceptionMgr, %struct.Error, ptr }
%struct.ExceptionMgr = type { ptr }
%struct.Error = type { [256 x i8], i32, ptr, ptr, i32, ptr, ptr }
%struct.Buf = type { ptr, ptr, ptr }
%struct.Guard = type { ptr, ptr, ptr }

@mn_runtime = external thread_local global %struct.Runtime, align 8
@.str = external hidden unnamed_addr constant [79 x i8], align 1
@__func__.index_read = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [45 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: inlinehint noreturn nounwind uwtable
declare hidden void @error_throw_as(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @str_of(ptr noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
define dso_local void @index_read(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i1 noundef zeroext %4) local_unnamed_addr #4 {
  %6 = alloca %struct.Buf, align 8
  %7 = alloca %struct.Guard, align 8
  %8 = alloca %struct.Buf, align 8
  %9 = alloca %struct.Guard, align 8
  %10 = getelementptr inbounds i8, ptr %2, i64 32
  %11 = load i32, ptr %10, align 1, !tbaa !5
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %52, label %13

13:                                               ; preds = %5
  %14 = getelementptr inbounds i8, ptr %0, i64 8
  %15 = load i64, ptr %14, align 8, !tbaa !12
  %16 = zext i32 %11 to i64
  %reass.sub = sub i64 %15, %16
  %17 = add i64 %reass.sub, -130
  tail call void @file_pread_buf(ptr noundef %0, ptr noundef %3, i32 noundef %11, i64 noundef %17)
  %18 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %19 = getelementptr inbounds i8, ptr %18, i64 312
  %20 = load ptr, ptr %19, align 8, !tbaa !18
  %21 = getelementptr inbounds i8, ptr %20, i64 16
  %22 = load ptr, ptr %21, align 8, !tbaa !22
  %23 = getelementptr inbounds i8, ptr %22, i64 32
  %24 = load ptr, ptr %23, align 8, !tbaa !24
  %25 = load ptr, ptr %3, align 8, !tbaa !26
  %26 = tail call i32 @buf_size(ptr noundef nonnull %3)
  %27 = tail call i32 %24(i32 noundef 0, ptr noundef %25, i32 noundef %26) #6
  %28 = getelementptr inbounds i8, ptr %2, i64 4
  %29 = load i32, ptr %28, align 1, !tbaa !28
  %.not = icmp eq i32 %27, %29
  br i1 %.not, label %34, label %30

30:                                               ; preds = %13
  %31 = getelementptr inbounds i8, ptr %18, i64 8
  %32 = getelementptr inbounds i8, ptr %0, i64 16
  %33 = tail call ptr @str_of(ptr noundef nonnull %32)
  tail call void (ptr, ptr, ptr, ptr, i32, ptr, ...) @error_throw_as(ptr noundef nonnull %31, ptr noundef nonnull %18, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.index_read, i32 noundef 157, ptr noundef nonnull @.str.6, ptr noundef %33) #7
  unreachable

34:                                               ; preds = %13
  br i1 %4, label %52, label %35

35:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  call void @buf_init(ptr noundef nonnull %6)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  store ptr @buf_free, ptr %7, align 8, !tbaa !29
  %36 = getelementptr inbounds i8, ptr %7, i64 8
  store ptr %6, ptr %36, align 8, !tbaa !31
  %37 = getelementptr inbounds i8, ptr %7, i64 16
  %38 = load ptr, ptr %18, align 8, !tbaa !32
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  %40 = load ptr, ptr %39, align 8, !tbaa !33
  store ptr %7, ptr %39, align 8, !tbaa !33
  store ptr %40, ptr %37, align 8, !tbaa !35
  %41 = call ptr @index_decrypt(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %6)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  call void @buf_init(ptr noundef nonnull %8)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  store ptr @buf_free, ptr %9, align 8, !tbaa !29
  %42 = getelementptr inbounds i8, ptr %9, i64 8
  store ptr %8, ptr %42, align 8, !tbaa !31
  %43 = getelementptr inbounds i8, ptr %9, i64 16
  %44 = load ptr, ptr %18, align 8, !tbaa !32
  %45 = getelementptr inbounds i8, ptr %44, i64 16
  %46 = load ptr, ptr %45, align 8, !tbaa !33
  store ptr %9, ptr %45, align 8, !tbaa !33
  store ptr %46, ptr %43, align 8, !tbaa !35
  %47 = call ptr @index_decompress(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %2, ptr noundef %41, ptr noundef nonnull %8)
  %.not38 = icmp eq ptr %47, %3
  br i1 %.not38, label %51, label %48

48:                                               ; preds = %35
  call void @buf_reset(ptr noundef nonnull %3)
  %49 = load ptr, ptr %47, align 8, !tbaa !26
  %50 = call i32 @buf_size(ptr noundef nonnull %47)
  call void @buf_write(ptr noundef nonnull %3, ptr noundef %49, i32 noundef %50)
  br label %51

51:                                               ; preds = %48, %35
  call void @guard_runner(ptr noundef nonnull %9)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  call void @guard_runner(ptr noundef nonnull %7)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  br label %52

52:                                               ; preds = %51, %34, %5
  ret void
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @file_pread_buf(ptr noundef, ptr noundef, i32 noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @buf_size(ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @buf_init(ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @buf_free(ptr noundef) #3

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @guard_runner(ptr noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare hidden ptr @index_decrypt(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden ptr @index_decompress(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @buf_reset(ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @buf_write(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint noreturn 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 #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { 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 #5 = { alwaysinline 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 #6 = { nounwind }
attributes #7 = { noreturn }

!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 32}
!6 = !{!"Index", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !7, i64 32, !7, i64 36, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !7, i64 72, !11, i64 76, !11, i64 84, !11, i64 92, !7, i64 100, !11, i64 104, !8, i64 112, !8, i64 113, !8, i64 114}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"Id", !11, i64 0, !11, i64 8}
!11 = !{!"long", !8, i64 0}
!12 = !{!13, !11, i64 8}
!13 = !{!"File", !7, i64 0, !11, i64 8, !14, i64 16, !17, i64 40}
!14 = !{!"Str", !15, i64 0, !15, i64 8, !16, i64 16}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!"_Bool", !8, i64 0}
!17 = !{!"List", !15, i64 0, !15, i64 8}
!18 = !{!19, !15, i64 312}
!19 = !{!"Runtime", !20, i64 0, !21, i64 8, !15, i64 312}
!20 = !{!"ExceptionMgr", !15, i64 0}
!21 = !{!"Error", !8, i64 0, !7, i64 256, !15, i64 264, !15, i64 272, !7, i64 280, !15, i64 288, !15, i64 296}
!22 = !{!23, !15, i64 16}
!23 = !{!"Context", !15, i64 0, !15, i64 8, !15, i64 16}
!24 = !{!25, !15, i64 32}
!25 = !{!"Global", !15, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !15, i64 32, !15, i64 40, !15, i64 48}
!26 = !{!27, !15, i64 0}
!27 = !{!"Buf", !15, i64 0, !15, i64 8, !15, i64 16}
!28 = !{!6, !7, i64 4}
!29 = !{!30, !15, i64 0}
!30 = !{!"Guard", !15, i64 0, !15, i64 8, !15, i64 16}
!31 = !{!30, !15, i64 8}
!32 = !{!19, !15, i64 0}
!33 = !{!34, !15, i64 16}
!34 = !{!"Exception", !15, i64 0, !16, i64 8, !15, i64 16, !8, i64 24}
!35 = !{!30, !15, i64 16}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass