; 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.analysisInfo = type { ptr, ptr }
%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.Schema = type { i32, i32, %struct.Hash, %struct.Hash, %struct.Hash, %struct.Hash, ptr, i8, i8, i16, i32 }
%struct.HashElem = type { ptr, ptr, ptr, ptr }
%struct.Table = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i16, i16, i16, i16, i8, i32, i32, ptr, ptr, ptr, ptr, ptr }
%struct.Index = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i16, i16, i16, i8, i8 }

@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [41 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

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

; 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 i32 @sqlite3AnalysisLoad(ptr noundef %0, i32 noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %struct.analysisInfo, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.sqlite3, ptr %13, i32 0, i32 4
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  %16 = load i32, ptr %4, align 4, !tbaa !9
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds %struct.Db, ptr %15, i64 %17
  %19 = getelementptr inbounds %struct.Db, ptr %18, i32 0, i32 4
  %20 = load ptr, ptr %19, align 8, !tbaa !19
  store ptr %20, ptr %9, align 8, !tbaa !5
  %21 = load ptr, ptr %9, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.Schema, ptr %21, i32 0, i32 2
  %23 = getelementptr inbounds %struct.Hash, ptr %22, i32 0, i32 2
  %24 = load ptr, ptr %23, align 8, !tbaa !21
  store ptr %24, ptr %6, align 8, !tbaa !5
  br label %25

25:                                               ; preds = %36, %2
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %40

28:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.HashElem, ptr %29, i32 0, i32 2
  %31 = load ptr, ptr %30, align 8, !tbaa !23
  store ptr %31, ptr %10, align 8, !tbaa !5
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.Table, ptr %32, i32 0, i32 9
  %34 = load i32, ptr %33, align 8, !tbaa !25
  %35 = and i32 %34, -17
  store i32 %35, ptr %33, align 8, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  br label %36

36:                                               ; preds = %28
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.HashElem, ptr %37, i32 0, i32 0
  %39 = load ptr, ptr %38, align 8, !tbaa !27
  store ptr %39, ptr %6, align 8, !tbaa !5
  br label %25, !llvm.loop !28

40:                                               ; preds = %25
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.Schema, ptr %41, i32 0, i32 3
  %43 = getelementptr inbounds %struct.Hash, ptr %42, i32 0, i32 2
  %44 = load ptr, ptr %43, align 8, !tbaa !30
  store ptr %44, ptr %6, align 8, !tbaa !5
  br label %45

45:                                               ; preds = %57, %40
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = icmp ne ptr %46, null
  br i1 %47, label %48, label %61

48:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.HashElem, ptr %49, i32 0, i32 2
  %51 = load ptr, ptr %50, align 8, !tbaa !23
  store ptr %51, ptr %11, align 8, !tbaa !5
  %52 = load ptr, ptr %11, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.Index, ptr %52, i32 0, i32 16
  %54 = load i8, ptr %53, align 1
  %55 = and i8 %54, 127
  %56 = or i8 %55, 0
  store i8 %56, ptr %53, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  br label %57

57:                                               ; preds = %48
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.HashElem, ptr %58, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8, !tbaa !27
  store ptr %60, ptr %6, align 8, !tbaa !5
  br label %45, !llvm.loop !31

61:                                               ; preds = %45
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.analysisInfo, ptr %5, i32 0, i32 0
  store ptr %62, ptr %63, align 8, !tbaa !32
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.sqlite3, ptr %64, i32 0, i32 4
  %66 = load ptr, ptr %65, align 8, !tbaa !11
  %67 = load i32, ptr %4, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds %struct.Db, ptr %66, i64 %68
  %70 = getelementptr inbounds %struct.Db, ptr %69, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !34
  %72 = getelementptr inbounds %struct.analysisInfo, ptr %5, i32 0, i32 1
  store ptr %71, ptr %72, align 8, !tbaa !35
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.analysisInfo, ptr %5, i32 0, i32 1
  %75 = load ptr, ptr %74, align 8, !tbaa !35
  %76 = call ptr @sqlite3FindTable(ptr noundef %73, ptr noundef @.str, ptr noundef %75)
  %77 = icmp ne ptr %76, null
  br i1 %77, label %78, label %93

78:                                               ; preds = %61
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.analysisInfo, ptr %5, i32 0, i32 1
  %81 = load ptr, ptr %80, align 8, !tbaa !35
  %82 = call ptr (ptr, ptr, ...) @sqlite3MPrintf(ptr noundef %79, ptr noundef @.str.1, ptr noundef %81)
  store ptr %82, ptr %7, align 8, !tbaa !5
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = icmp eq ptr %83, null
  br i1 %84, label %85, label %86

85:                                               ; preds = %78
  store i32 7, ptr %8, align 4, !tbaa !9
  br label %92

86:                                               ; preds = %78
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = call i32 @sqlite3_exec(ptr noundef %87, ptr noundef %88, ptr noundef @analysisLoader, ptr noundef %5, ptr noundef null)
  store i32 %89, ptr %8, align 4, !tbaa !9
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef %90, ptr noundef %91)
  br label %92

92:                                               ; preds = %86, %85
  br label %93

93:                                               ; preds = %92, %61
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.Schema, ptr %94, i32 0, i32 3
  %96 = getelementptr inbounds %struct.Hash, ptr %95, i32 0, i32 2
  %97 = load ptr, ptr %96, align 8, !tbaa !30
  store ptr %97, ptr %6, align 8, !tbaa !5
  br label %98

98:                                               ; preds = %114, %93
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = icmp ne ptr %99, null
  br i1 %100, label %101, label %118

101:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.HashElem, ptr %102, i32 0, i32 2
  %104 = load ptr, ptr %103, align 8, !tbaa !23
  store ptr %104, ptr %12, align 8, !tbaa !5
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.Index, ptr %105, i32 0, i32 16
  %107 = load i8, ptr %106, align 1
  %108 = lshr i8 %107, 7
  %109 = zext i8 %108 to i32
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %113, label %111

111:                                              ; preds = %101
  %112 = load ptr, ptr %12, align 8, !tbaa !5
  call void @sqlite3DefaultRowEst(ptr noundef %112)
  br label %113

113:                                              ; preds = %111, %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  br label %114

114:                                              ; preds = %113
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.HashElem, ptr %115, i32 0, i32 0
  %117 = load ptr, ptr %116, align 8, !tbaa !27
  store ptr %117, ptr %6, align 8, !tbaa !5
  br label %98, !llvm.loop !36

118:                                              ; preds = %98
  %119 = load i32, ptr %8, align 4, !tbaa !9
  %120 = icmp eq i32 %119, 7
  br i1 %120, label %121, label %123

121:                                              ; preds = %118
  %122 = load ptr, ptr %3, align 8, !tbaa !5
  call void @sqlite3OomFault(ptr noundef %122)
  br label %123

123:                                              ; preds = %121, %118
  %124 = load i32, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #3
  ret i32 %124
}

declare ptr @sqlite3FindTable(ptr noundef, ptr noundef, ptr noundef) #1

declare ptr @sqlite3MPrintf(ptr noundef, ptr noundef, ...) #1

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

; Function Attrs: nounwind uwtable
declare hidden i32 @analysisLoader(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2

declare void @sqlite3DefaultRowEst(ptr noundef) #1

declare void @sqlite3OomFault(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 32}
!12 = !{!"sqlite3", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40, !10, i64 44, !13, i64 48, !13, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !14, 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, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !7, i64 112, !10, i64 160, !15, i64 164, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !10, 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, !16, i64 344, !6, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !10, i64 432, !10, i64 436, !17, i64 440, !6, i64 464, !6, i64 472, !6, i64 480, !17, i64 488, !17, i64 512, !18, i64 536, !7, i64 560, !6, i64 624, !10, i64 632, !10, i64 636, !10, i64 640, !13, i64 648, !13, i64 656, !6, i64 664}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!"sqlite3InitInfo", !10, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7}
!16 = !{!"Lookaside", !10, i64 0, !14, i64 4, !7, i64 6, !10, i64 8, !10, i64 12, !7, i64 16, !6, i64 32, !6, i64 40, !6, i64 48}
!17 = !{!"Hash", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!18 = !{!"BusyHandler", !6, i64 0, !6, i64 8, !10, i64 16}
!19 = !{!20, !6, i64 24}
!20 = !{!"Db", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 17, !6, i64 24}
!21 = !{!22, !6, i64 16}
!22 = !{!"Schema", !10, i64 0, !10, i64 4, !17, i64 8, !17, i64 32, !17, i64 56, !17, i64 80, !6, i64 104, !7, i64 112, !7, i64 113, !14, i64 114, !10, i64 116}
!23 = !{!24, !6, i64 16}
!24 = !{!"HashElem", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!25 = !{!26, !10, i64 64}
!26 = !{!"Table", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !14, i64 68, !14, i64 70, !14, i64 72, !14, i64 74, !7, i64 76, !10, i64 80, !10, i64 84, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!27 = !{!24, !6, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!22, !6, i64 40}
!31 = distinct !{!31, !29}
!32 = !{!33, !6, i64 0}
!33 = !{!"analysisInfo", !6, i64 0, !6, i64 8}
!34 = !{!20, !6, i64 0}
!35 = !{!33, !6, i64 8}
!36 = distinct !{!36, !29}


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

@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [41 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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @sqlite3AnalysisLoad(ptr noundef %0, i32 noundef %1) local_unnamed_addr #2 {
  %3 = alloca %struct.analysisInfo, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #3
  %4 = getelementptr inbounds i8, ptr %0, i64 32
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = sext i32 %1 to i64
  %7 = getelementptr inbounds %struct.Db, ptr %5, i64 %6, i32 4
  %8 = load ptr, ptr %7, align 8, !tbaa !17
  %9 = getelementptr inbounds i8, ptr %8, i64 16
  %.036 = load ptr, ptr %9, align 8, !tbaa !19
  %.not37 = icmp eq ptr %.036, null
  br i1 %.not37, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2, %.lr.ph
  %.038 = phi ptr [ %.0, %.lr.ph ], [ %.036, %2 ]
  %10 = getelementptr inbounds i8, ptr %.038, i64 16
  %11 = load ptr, ptr %10, align 8, !tbaa !20
  %12 = getelementptr inbounds i8, ptr %11, i64 64
  %13 = load i32, ptr %12, align 8, !tbaa !22
  %14 = and i32 %13, -17
  store i32 %14, ptr %12, align 8, !tbaa !22
  %.0 = load ptr, ptr %.038, align 8, !tbaa !19
  %.not = icmp eq ptr %.0, null
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !24

._crit_edge:                                      ; preds = %.lr.ph, %2
  %15 = getelementptr inbounds i8, ptr %8, i64 40
  %.139 = load ptr, ptr %15, align 8, !tbaa !19
  %.not3240 = icmp eq ptr %.139, null
  br i1 %.not3240, label %._crit_edge44, label %.lr.ph43

.lr.ph43:                                         ; preds = %._crit_edge, %.lr.ph43
  %.141 = phi ptr [ %.1, %.lr.ph43 ], [ %.139, %._crit_edge ]
  %16 = getelementptr inbounds i8, ptr %.141, i64 16
  %17 = load ptr, ptr %16, align 8, !tbaa !20
  %18 = getelementptr inbounds i8, ptr %17, i64 99
  %19 = load i8, ptr %18, align 1
  %20 = and i8 %19, 127
  store i8 %20, ptr %18, align 1
  %.1 = load ptr, ptr %.141, align 8, !tbaa !19
  %.not32 = icmp eq ptr %.1, null
  br i1 %.not32, label %._crit_edge44.loopexit, label %.lr.ph43, !llvm.loop !26

._crit_edge44.loopexit:                           ; preds = %.lr.ph43
  %.pre = load ptr, ptr %4, align 8, !tbaa !5
  br label %._crit_edge44

._crit_edge44:                                    ; preds = %._crit_edge44.loopexit, %._crit_edge
  %21 = phi ptr [ %.pre, %._crit_edge44.loopexit ], [ %5, %._crit_edge ]
  store ptr %0, ptr %3, align 8, !tbaa !27
  %22 = getelementptr inbounds %struct.Db, ptr %21, i64 %6
  %23 = load ptr, ptr %22, align 8, !tbaa !29
  %24 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %23, ptr %24, align 8, !tbaa !30
  %25 = tail call ptr @sqlite3FindTable(ptr noundef %0, ptr noundef nonnull @.str, ptr noundef %23) #3
  %.not33 = icmp eq ptr %25, null
  br i1 %.not33, label %31, label %26

26:                                               ; preds = %._crit_edge44
  %27 = tail call ptr (ptr, ptr, ...) @sqlite3MPrintf(ptr noundef nonnull %0, ptr noundef nonnull @.str.1, ptr noundef %23) #3
  %28 = icmp eq ptr %27, null
  br i1 %28, label %31, label %29

29:                                               ; preds = %26
  %30 = call i32 @sqlite3_exec(ptr noundef nonnull %0, ptr noundef nonnull %27, ptr noundef nonnull @analysisLoader, ptr noundef nonnull %3, ptr noundef null) #3
  call void @sqlite3DbFree(ptr noundef nonnull %0, ptr noundef nonnull %27) #3
  br label %31

31:                                               ; preds = %26, %29, %._crit_edge44
  %.030 = phi i32 [ %30, %29 ], [ 0, %._crit_edge44 ], [ 7, %26 ]
  %.245 = load ptr, ptr %15, align 8, !tbaa !19
  %.not3446 = icmp eq ptr %.245, null
  br i1 %.not3446, label %._crit_edge50, label %.lr.ph49

.lr.ph49:                                         ; preds = %31, %37
  %.247 = phi ptr [ %.2, %37 ], [ %.245, %31 ]
  %32 = getelementptr inbounds i8, ptr %.247, i64 16
  %33 = load ptr, ptr %32, align 8, !tbaa !20
  %34 = getelementptr inbounds i8, ptr %33, i64 99
  %35 = load i8, ptr %34, align 1
  %.not35 = icmp sgt i8 %35, -1
  br i1 %.not35, label %36, label %37

36:                                               ; preds = %.lr.ph49
  call void @sqlite3DefaultRowEst(ptr noundef nonnull %33) #3
  br label %37

37:                                               ; preds = %36, %.lr.ph49
  %.2 = load ptr, ptr %.247, align 8, !tbaa !19
  %.not34 = icmp eq ptr %.2, null
  br i1 %.not34, label %._crit_edge50, label %.lr.ph49, !llvm.loop !31

._crit_edge50:                                    ; preds = %37, %31
  %38 = icmp eq i32 %.030, 7
  br i1 %38, label %39, label %40

39:                                               ; preds = %._crit_edge50
  call void @sqlite3OomFault(ptr noundef %0) #3
  br label %40

40:                                               ; preds = %39, %._crit_edge50
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #3
  ret i32 %.030
}

declare ptr @sqlite3FindTable(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @sqlite3MPrintf(ptr noundef, ptr noundef, ...) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare hidden i32 @analysisLoader(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2

declare void @sqlite3DefaultRowEst(ptr noundef) local_unnamed_addr #1

declare void @sqlite3OomFault(ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #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 32}
!6 = !{!"sqlite3", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 44, !11, i64 48, !11, 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, !13, 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, !14, i64 344, !7, i64 400, !7, i64 408, !7, i64 416, !7, i64 424, !10, i64 432, !10, i64 436, !15, i64 440, !7, i64 464, !7, i64 472, !7, i64 480, !15, i64 488, !15, i64 512, !16, i64 536, !8, i64 560, !7, i64 624, !10, i64 632, !10, i64 636, !10, i64 640, !11, i64 648, !11, i64 656, !7, i64 664}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long long", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!"sqlite3InitInfo", !10, i64 0, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7}
!14 = !{!"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}
!15 = !{!"Hash", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 16}
!16 = !{!"BusyHandler", !7, i64 0, !7, i64 8, !10, i64 16}
!17 = !{!18, !7, i64 24}
!18 = !{!"Db", !7, i64 0, !7, i64 8, !8, i64 16, !8, i64 17, !7, i64 24}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !7, i64 16}
!21 = !{!"HashElem", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!22 = !{!23, !10, i64 64}
!23 = !{!"Table", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !12, i64 68, !12, i64 70, !12, i64 72, !12, i64 74, !8, i64 76, !10, i64 80, !10, i64 84, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}
!27 = !{!28, !7, i64 0}
!28 = !{!"analysisInfo", !7, i64 0, !7, i64 8}
!29 = !{!18, !7, i64 0}
!30 = !{!28, !7, i64 8}
!31 = distinct !{!31, !25}


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