; LLVM IR from ibr-ds/STANlite :: Enclave/sqlite (analyze)

; 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.Parse = type { ptr, ptr, ptr, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, %struct.Token, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i8, i8, i8, [10 x %struct.yColCache], [8 x i32], %struct.Token, %struct.Token, i16, i8, i8, i8, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, %struct.Token, ptr, ptr, ptr, ptr, ptr }
%struct.yColCache = type { i32, i16, i8, i32, i32, i32 }
%struct.Token = type { ptr, i32 }
%struct.sqlite3 = type { ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i64, i32, i32, i32, i32, i16, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, [12 x i32], i32, %struct.sqlite3InitInfo, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %union.anon, %struct.Lookaside, ptr, ptr, ptr, ptr, i32, i32, %struct.Hash, ptr, ptr, ptr, %struct.Hash, %struct.Hash, %struct.BusyHandler, [2 x %struct.Db], ptr, i32, i32, i32, i64, i64, ptr }
%struct.sqlite3InitInfo = type { i32, i8, i8, i8, i8 }
%union.anon = type { double }
%struct.Lookaside = type { i32, i16, i8, i32, i32, [3 x i32], ptr, ptr, ptr }
%struct.Hash = type { i32, i32, ptr, ptr }
%struct.BusyHandler = type { ptr, ptr, i32 }
%struct.Db = type { ptr, ptr, i8, i8, ptr }
%struct.Index = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i16, i16, i16, i8, i8 }

; Function Attrs: nounwind uwtable
define dso_local void @sqlite3Analyze(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.Parse, ptr %17, i32 0, i32 0
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  store ptr %19, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = call i32 @sqlite3ReadSchema(ptr noundef %20)
  %22 = icmp ne i32 0, %21
  br i1 %22, label %23, label %24

23:                                               ; preds = %3
  store i32 1, ptr %16, align 4
  br label %129

24:                                               ; preds = %3
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = icmp eq ptr %25, null
  br i1 %26, label %27, label %45

27:                                               ; preds = %24
  store i32 0, ptr %9, align 4, !tbaa !14
  br label %28

28:                                               ; preds = %41, %27
  %29 = load i32, ptr %9, align 4, !tbaa !14
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.sqlite3, ptr %30, i32 0, i32 5
  %32 = load i32, ptr %31, align 8, !tbaa !15
  %33 = icmp slt i32 %29, %32
  br i1 %33, label %34, label %44

34:                                               ; preds = %28
  %35 = load i32, ptr %9, align 4, !tbaa !14
  %36 = icmp eq i32 %35, 1
  br i1 %36, label %37, label %38

37:                                               ; preds = %34
  br label %41

38:                                               ; preds = %34
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = load i32, ptr %9, align 4, !tbaa !14
  call void @analyzeDatabase(ptr noundef %39, i32 noundef %40)
  br label %41

41:                                               ; preds = %38, %37
  %42 = load i32, ptr %9, align 4, !tbaa !14
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %9, align 4, !tbaa !14
  br label %28, !llvm.loop !22

44:                                               ; preds = %28
  br label %115

45:                                               ; preds = %24
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.Token, ptr %46, i32 0, i32 1
  %48 = load i32, ptr %47, align 8, !tbaa !24
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %50, label %58

50:                                               ; preds = %45
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = call i32 @sqlite3FindDb(ptr noundef %51, ptr noundef %52)
  store i32 %53, ptr %8, align 4, !tbaa !14
  %54 = icmp sge i32 %53, 0
  br i1 %54, label %55, label %58

55:                                               ; preds = %50
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = load i32, ptr %8, align 4, !tbaa !14
  call void @analyzeDatabase(ptr noundef %56, i32 noundef %57)
  br label %114

58:                                               ; preds = %50, %45
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = call i32 @sqlite3TwoPartName(ptr noundef %59, ptr noundef %60, ptr noundef %61, ptr noundef %14)
  store i32 %62, ptr %8, align 4, !tbaa !14
  %63 = load i32, ptr %8, align 4, !tbaa !14
  %64 = icmp sge i32 %63, 0
  br i1 %64, label %65, label %113

65:                                               ; preds = %58
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.Token, ptr %66, i32 0, i32 1
  %68 = load i32, ptr %67, align 8, !tbaa !24
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %79

70:                                               ; preds = %65
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.sqlite3, ptr %71, i32 0, i32 4
  %73 = load ptr, ptr %72, align 8, !tbaa !25
  %74 = load i32, ptr %8, align 4, !tbaa !14
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds %struct.Db, ptr %73, i64 %75
  %77 = getelementptr inbounds %struct.Db, ptr %76, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8, !tbaa !26
  br label %80

79:                                               ; preds = %65
  br label %80

80:                                               ; preds = %79, %70
  %81 = phi ptr [ %78, %70 ], [ null, %79 ]
  store ptr %81, ptr %11, align 8, !tbaa !5
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = load ptr, ptr %14, align 8, !tbaa !5
  %84 = call ptr @sqlite3NameFromToken(ptr noundef %82, ptr noundef %83)
  store ptr %84, ptr %10, align 8, !tbaa !5
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  %86 = icmp ne ptr %85, null
  br i1 %86, label %87, label %112

87:                                               ; preds = %80
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = load ptr, ptr %10, align 8, !tbaa !5
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  %91 = call ptr @sqlite3FindIndex(ptr noundef %88, ptr noundef %89, ptr noundef %90)
  store ptr %91, ptr %13, align 8, !tbaa !5
  %92 = icmp ne ptr %91, null
  br i1 %92, label %93, label %99

93:                                               ; preds = %87
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = load ptr, ptr %13, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.Index, ptr %95, i32 0, i32 3
  %97 = load ptr, ptr %96, align 8, !tbaa !28
  %98 = load ptr, ptr %13, align 8, !tbaa !5
  call void @analyzeTable(ptr noundef %94, ptr noundef %97, ptr noundef %98)
  br label %109

99:                                               ; preds = %87
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = load ptr, ptr %10, align 8, !tbaa !5
  %102 = load ptr, ptr %11, align 8, !tbaa !5
  %103 = call ptr @sqlite3LocateTable(ptr noundef %100, i32 noundef 0, ptr noundef %101, ptr noundef %102)
  store ptr %103, ptr %12, align 8, !tbaa !5
  %104 = icmp ne ptr %103, null
  br i1 %104, label %105, label %108

105:                                              ; preds = %99
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = load ptr, ptr %12, align 8, !tbaa !5
  call void @analyzeTable(ptr noundef %106, ptr noundef %107, ptr noundef null)
  br label %108

108:                                              ; preds = %105, %99
  br label %109

109:                                              ; preds = %108, %93
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = load ptr, ptr %10, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef %110, ptr noundef %111)
  br label %112

112:                                              ; preds = %109, %80
  br label %113

113:                                              ; preds = %112, %58
  br label %114

114:                                              ; preds = %113, %55
  br label %115

115:                                              ; preds = %114, %44
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.sqlite3, ptr %116, i32 0, i32 26
  %118 = load i8, ptr %117, align 2, !tbaa !30
  %119 = zext i8 %118 to i32
  %120 = icmp eq i32 %119, 0
  br i1 %120, label %121, label %128

121:                                              ; preds = %115
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = call ptr @sqlite3GetVdbe(ptr noundef %122)
  store ptr %123, ptr %15, align 8, !tbaa !5
  %124 = icmp ne ptr %123, null
  br i1 %124, label %125, label %128

125:                                              ; preds = %121
  %126 = load ptr, ptr %15, align 8, !tbaa !5
  %127 = call i32 @sqlite3VdbeAddOp0(ptr noundef %126, i32 noundef 151)
  br label %128

128:                                              ; preds = %125, %121, %115
  store i32 0, ptr %16, align 4
  br label %129

129:                                              ; preds = %128, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  %130 = load i32, ptr %16, align 4
  switch i32 %130, label %132 [
    i32 0, label %131
    i32 1, label %131
  ]

131:                                              ; preds = %129, %129
  ret void

132:                                              ; preds = %129
  unreachable
}

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

declare i32 @sqlite3ReadSchema(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @analyzeDatabase(ptr noundef, i32 noundef) #0

declare i32 @sqlite3FindDb(ptr noundef, ptr noundef) #2

declare i32 @sqlite3TwoPartName(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare ptr @sqlite3NameFromToken(ptr noundef, ptr noundef) #2

declare ptr @sqlite3FindIndex(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @analyzeTable(ptr noundef, ptr noundef, ptr noundef) #0

declare ptr @sqlite3LocateTable(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2

declare void @sqlite3DbFree(ptr noundef, ptr noundef) #2

declare ptr @sqlite3GetVdbe(ptr noundef) #2

declare i32 @sqlite3VdbeAddOp0(ptr noundef, i32 noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 }

!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 0}
!10 = !{!"Parse", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !7, i64 28, !7, i64 29, !7, i64 30, !7, i64 31, !7, i64 32, !7, i64 33, !7, i64 34, !7, i64 35, !7, i64 36, !7, i64 37, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !6, i64 88, !6, i64 96, !12, i64 104, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !11, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !7, i64 192, !7, i64 193, !7, i64 194, !7, i64 196, !7, i64 396, !12, i64 432, !12, i64 448, !13, i64 464, !7, i64 466, !7, i64 467, !7, i64 468, !11, i64 472, !11, i64 476, !11, i64 480, !11, i64 484, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !12, i64 536, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584}
!11 = !{!"int", !7, i64 0}
!12 = !{!"Token", !6, i64 0, !11, i64 8}
!13 = !{!"short", !7, i64 0}
!14 = !{!11, !11, i64 0}
!15 = !{!16, !11, i64 40}
!16 = !{!"sqlite3", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !11, i64 44, !17, i64 48, !17, i64 56, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !13, i64 80, !7, i64 82, !7, i64 83, !7, i64 84, !7, i64 85, !7, i64 86, !7, i64 87, !7, i64 88, !7, i64 89, !7, i64 90, !7, i64 91, !7, i64 92, !7, i64 93, !7, i64 94, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !7, i64 112, !11, i64 160, !18, i64 164, !11, i64 172, !11, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !11, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !7, i64 336, !19, i64 344, !6, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !11, i64 432, !11, i64 436, !20, i64 440, !6, i64 464, !6, i64 472, !6, i64 480, !20, i64 488, !20, i64 512, !21, i64 536, !7, i64 560, !6, i64 624, !11, i64 632, !11, i64 636, !11, i64 640, !17, i64 648, !17, i64 656, !6, i64 664}
!17 = !{!"long long", !7, i64 0}
!18 = !{!"sqlite3InitInfo", !11, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7}
!19 = !{!"Lookaside", !11, i64 0, !13, i64 4, !7, i64 6, !11, i64 8, !11, i64 12, !7, i64 16, !6, i64 32, !6, i64 40, !6, i64 48}
!20 = !{!"Hash", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16}
!21 = !{!"BusyHandler", !6, i64 0, !6, i64 8, !11, i64 16}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!12, !11, i64 8}
!25 = !{!16, !6, i64 32}
!26 = !{!27, !6, i64 0}
!27 = !{!"Db", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 17, !6, i64 24}
!28 = !{!29, !6, i64 24}
!29 = !{!"Index", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !11, i64 88, !13, i64 92, !13, i64 94, !13, i64 96, !7, i64 98, !11, i64 99, !11, i64 99, !11, i64 99, !11, i64 99, !11, i64 99, !11, i64 99, !11, i64 99}
!30 = !{!16, !7, i64 94}


; 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.Db = type { ptr, ptr, i8, i8, ptr }

; Function Attrs: nounwind uwtable
define dso_local void @sqlite3Analyze(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = alloca ptr, align 8
  %5 = load ptr, ptr %0, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %6 = tail call i32 @sqlite3ReadSchema(ptr noundef nonnull %0) #3
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %7, label %54

7:                                                ; preds = %3
  %8 = icmp eq ptr %1, null
  br i1 %8, label %.preheader, label %15

.preheader:                                       ; preds = %7
  %9 = getelementptr inbounds i8, ptr %5, i64 40
  %10 = load i32, ptr %9, align 8, !tbaa !13
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %12, label %.loopexit

12:                                               ; preds = %.preheader
  tail call void @analyzeDatabase(ptr noundef nonnull %0, i32 noundef 0)
  %.pre = load i32, ptr %9, align 8, !tbaa !13
  %or.cond = icmp slt i32 %.pre, 3
  br i1 %or.cond, label %.loopexit, label %.lr.ph.peel.next51

.lr.ph.peel.next51:                               ; preds = %12, %.lr.ph.peel.next51
  %.050 = phi i32 [ %13, %.lr.ph.peel.next51 ], [ 2, %12 ]
  tail call void @analyzeDatabase(ptr noundef nonnull %0, i32 noundef %.050)
  %.pre54 = load i32, ptr %9, align 8, !tbaa !13
  %13 = add nuw nsw i32 %.050, 1
  %14 = icmp slt i32 %13, %.pre54
  br i1 %14, label %.lr.ph.peel.next51, label %.loopexit, !llvm.loop !20

15:                                               ; preds = %7
  %16 = getelementptr inbounds i8, ptr %2, i64 8
  %17 = load i32, ptr %16, align 8, !tbaa !23
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %19, label %23

19:                                               ; preds = %15
  %20 = tail call i32 @sqlite3FindDb(ptr noundef %5, ptr noundef nonnull %1) #3
  %21 = icmp sgt i32 %20, -1
  br i1 %21, label %22, label %23

22:                                               ; preds = %19
  tail call void @analyzeDatabase(ptr noundef nonnull %0, i32 noundef %20)
  br label %.loopexit

23:                                               ; preds = %19, %15
  %24 = call i32 @sqlite3TwoPartName(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %4) #3
  %25 = icmp sgt i32 %24, -1
  br i1 %25, label %26, label %.loopexit

26:                                               ; preds = %23
  %27 = load i32, ptr %16, align 8, !tbaa !23
  %.not45 = icmp eq i32 %27, 0
  br i1 %.not45, label %34, label %28

28:                                               ; preds = %26
  %29 = getelementptr inbounds i8, ptr %5, i64 32
  %30 = load ptr, ptr %29, align 8, !tbaa !24
  %31 = zext nneg i32 %24 to i64
  %32 = getelementptr inbounds %struct.Db, ptr %30, i64 %31
  %33 = load ptr, ptr %32, align 8, !tbaa !25
  br label %34

34:                                               ; preds = %26, %28
  %35 = phi ptr [ %33, %28 ], [ null, %26 ]
  %36 = load ptr, ptr %4, align 8, !tbaa !27
  %37 = call ptr @sqlite3NameFromToken(ptr noundef %5, ptr noundef %36) #3
  %.not46 = icmp eq ptr %37, null
  br i1 %.not46, label %.loopexit, label %38

38:                                               ; preds = %34
  %39 = call ptr @sqlite3FindIndex(ptr noundef %5, ptr noundef nonnull %37, ptr noundef %35) #3
  %.not47 = icmp eq ptr %39, null
  br i1 %.not47, label %43, label %40

40:                                               ; preds = %38
  %41 = getelementptr inbounds i8, ptr %39, i64 24
  %42 = load ptr, ptr %41, align 8, !tbaa !28
  call void @analyzeTable(ptr noundef nonnull %0, ptr noundef %42, ptr noundef nonnull %39)
  br label %46

43:                                               ; preds = %38
  %44 = call ptr @sqlite3LocateTable(ptr noundef nonnull %0, i32 noundef 0, ptr noundef nonnull %37, ptr noundef %35) #3
  %.not48 = icmp eq ptr %44, null
  br i1 %.not48, label %46, label %45

45:                                               ; preds = %43
  call void @analyzeTable(ptr noundef nonnull %0, ptr noundef nonnull %44, ptr noundef null)
  br label %46

46:                                               ; preds = %43, %45, %40
  call void @sqlite3DbFree(ptr noundef %5, ptr noundef nonnull %37) #3
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph.peel.next51, %12, %.preheader, %22, %34, %46, %23
  %47 = getelementptr inbounds i8, ptr %5, i64 94
  %48 = load i8, ptr %47, align 2, !tbaa !30
  %49 = icmp eq i8 %48, 0
  br i1 %49, label %50, label %54

50:                                               ; preds = %.loopexit
  %51 = call ptr @sqlite3GetVdbe(ptr noundef nonnull %0) #3
  %.not49 = icmp eq ptr %51, null
  br i1 %.not49, label %54, label %52

52:                                               ; preds = %50
  %53 = call i32 @sqlite3VdbeAddOp0(ptr noundef nonnull %51, i32 noundef 151) #3
  br label %54

54:                                               ; preds = %.loopexit, %50, %52, %3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  ret void
}

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

declare i32 @sqlite3ReadSchema(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @analyzeDatabase(ptr noundef, i32 noundef) local_unnamed_addr #0

declare i32 @sqlite3FindDb(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @sqlite3TwoPartName(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @sqlite3NameFromToken(ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @sqlite3FindIndex(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @analyzeTable(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @sqlite3LocateTable(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @sqlite3DbFree(ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @sqlite3GetVdbe(ptr noundef) local_unnamed_addr #2

declare i32 @sqlite3VdbeAddOp0(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 }

!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 0}
!6 = !{!"Parse", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !8, i64 28, !8, i64 29, !8, i64 30, !8, i64 31, !8, i64 32, !8, i64 33, !8, i64 34, !8, i64 35, !8, i64 36, !8, i64 37, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !7, i64 88, !7, i64 96, !11, i64 104, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !8, i64 192, !8, i64 193, !8, i64 194, !8, i64 196, !8, i64 396, !11, i64 432, !11, i64 448, !12, i64 464, !8, i64 466, !8, i64 467, !8, i64 468, !10, i64 472, !10, i64 476, !10, i64 480, !10, i64 484, !7, i64 488, !7, i64 496, !7, i64 504, !7, i64 512, !7, i64 520, !7, i64 528, !11, i64 536, !7, i64 552, !7, i64 560, !7, i64 568, !7, i64 576, !7, i64 584}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"Token", !7, i64 0, !10, i64 8}
!12 = !{!"short", !8, i64 0}
!13 = !{!14, !10, i64 40}
!14 = !{!"sqlite3", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 44, !15, i64 48, !15, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !12, i64 80, !8, i64 82, !8, i64 83, !8, i64 84, !8, i64 85, !8, i64 86, !8, i64 87, !8, i64 88, !8, i64 89, !8, i64 90, !8, i64 91, !8, i64 92, !8, i64 93, !8, i64 94, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !8, i64 112, !10, i64 160, !16, i64 164, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !10, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !7, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !7, i64 256, !7, i64 264, !7, i64 272, !7, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !8, i64 336, !17, i64 344, !7, i64 400, !7, i64 408, !7, i64 416, !7, i64 424, !10, i64 432, !10, i64 436, !18, i64 440, !7, i64 464, !7, i64 472, !7, i64 480, !18, i64 488, !18, i64 512, !19, i64 536, !8, i64 560, !7, i64 624, !10, i64 632, !10, i64 636, !10, i64 640, !15, i64 648, !15, i64 656, !7, i64 664}
!15 = !{!"long long", !8, i64 0}
!16 = !{!"sqlite3InitInfo", !10, i64 0, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7}
!17 = !{!"Lookaside", !10, i64 0, !12, i64 4, !8, i64 6, !10, i64 8, !10, i64 12, !8, i64 16, !7, i64 32, !7, i64 40, !7, i64 48}
!18 = !{!"Hash", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 16}
!19 = !{!"BusyHandler", !7, i64 0, !7, i64 8, !10, i64 16}
!20 = distinct !{!20, !21, !22}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!"llvm.loop.peeled.count", i32 2}
!23 = !{!11, !10, i64 8}
!24 = !{!14, !7, i64 32}
!25 = !{!26, !7, i64 0}
!26 = !{!"Db", !7, i64 0, !7, i64 8, !8, i64 16, !8, i64 17, !7, i64 24}
!27 = !{!7, !7, i64 0}
!28 = !{!29, !7, i64 24}
!29 = !{!"Index", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !10, i64 88, !12, i64 92, !12, i64 94, !12, i64 96, !8, i64 98, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99}
!30 = !{!14, !8, i64 94}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass