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

; 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.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.VtabCtx = type { ptr, ptr, ptr, i32 }
%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.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.VTable = type { ptr, ptr, ptr, i32, i8, i32, ptr }
%struct.Module = type { ptr, ptr, ptr, ptr, ptr }
%struct.sqlite3_module = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, 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.5 = external hidden unnamed_addr constant [3 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 @sqlite3_declare_vtab(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca i32, align 4
  %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 ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  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
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  store ptr null, ptr %10, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.sqlite3, ptr %14, i32 0, i32 3
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  call void @sqlite3_mutex_enter(ptr noundef %16)
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.sqlite3, ptr %17, i32 0, i32 66
  %19 = load ptr, ptr %18, align 8, !tbaa !19
  store ptr %19, ptr %6, align 8, !tbaa !5
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %27

22:                                               ; preds = %2
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.VtabCtx, ptr %23, i32 0, i32 3
  %25 = load i32, ptr %24, align 8, !tbaa !20
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %27, label %33

27:                                               ; preds = %22, %2
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  call void @sqlite3Error(ptr noundef %28, i32 noundef 21)
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.sqlite3, ptr %29, i32 0, i32 3
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  call void @sqlite3_mutex_leave(ptr noundef %31)
  %32 = call i32 @sqlite3MisuseError(i32 noundef 751)
  store i32 %32, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %182

33:                                               ; preds = %22
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.VtabCtx, ptr %34, i32 0, i32 1
  %36 = load ptr, ptr %35, align 8, !tbaa !22
  store ptr %36, ptr %9, align 8, !tbaa !5
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = call ptr @sqlite3DbMallocZero(ptr noundef %37, i64 noundef 592)
  store ptr %38, ptr %7, align 8, !tbaa !5
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = icmp eq ptr %39, null
  br i1 %40, label %41, label %42

41:                                               ; preds = %33
  store i32 7, ptr %8, align 4, !tbaa !9
  br label %174

42:                                               ; preds = %33
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.Parse, ptr %43, i32 0, i32 53
  store i8 1, ptr %44, align 4, !tbaa !23
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.Parse, ptr %46, i32 0, i32 0
  store ptr %45, ptr %47, align 8, !tbaa !26
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.Parse, ptr %48, i32 0, i32 40
  store i32 1, ptr %49, align 4, !tbaa !27
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = call i32 @sqlite3RunParser(ptr noundef %50, ptr noundef %51, ptr noundef %10)
  %53 = icmp eq i32 0, %52
  br i1 %53, label %54, label %145

54:                                               ; preds = %42
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.Parse, ptr %55, i32 0, i32 61
  %57 = load ptr, ptr %56, align 8, !tbaa !28
  %58 = icmp ne ptr %57, null
  br i1 %58, label %59, label %145

59:                                               ; preds = %54
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.sqlite3, ptr %60, i32 0, i32 17
  %62 = load i8, ptr %61, align 1, !tbaa !29
  %63 = icmp ne i8 %62, 0
  br i1 %63, label %145, label %64

64:                                               ; preds = %59
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.Parse, ptr %65, i32 0, i32 61
  %67 = load ptr, ptr %66, align 8, !tbaa !28
  %68 = getelementptr inbounds %struct.Table, ptr %67, i32 0, i32 3
  %69 = load ptr, ptr %68, align 8, !tbaa !30
  %70 = icmp ne ptr %69, null
  br i1 %70, label %145, label %71

71:                                               ; preds = %64
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.Parse, ptr %72, i32 0, i32 61
  %74 = load ptr, ptr %73, align 8, !tbaa !28
  %75 = getelementptr inbounds %struct.Table, ptr %74, i32 0, i32 16
  %76 = load i32, ptr %75, align 4, !tbaa !32
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %145, label %78

78:                                               ; preds = %71
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.Table, ptr %79, i32 0, i32 1
  %81 = load ptr, ptr %80, align 8, !tbaa !33
  %82 = icmp ne ptr %81, null
  br i1 %82, label %142, label %83

83:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.Parse, ptr %84, i32 0, i32 61
  %86 = load ptr, ptr %85, align 8, !tbaa !28
  store ptr %86, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.Table, ptr %87, i32 0, i32 1
  %89 = load ptr, ptr %88, align 8, !tbaa !33
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.Table, ptr %90, i32 0, i32 1
  store ptr %89, ptr %91, align 8, !tbaa !33
  %92 = load ptr, ptr %12, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.Table, ptr %92, i32 0, i32 11
  %94 = load i16, ptr %93, align 2, !tbaa !34
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.Table, ptr %95, i32 0, i32 11
  store i16 %94, ptr %96, align 2, !tbaa !34
  %97 = load ptr, ptr %12, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.Table, ptr %97, i32 0, i32 9
  %99 = load i32, ptr %98, align 8, !tbaa !35
  %100 = and i32 %99, 96
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.Table, ptr %101, i32 0, i32 9
  %103 = load i32, ptr %102, align 8, !tbaa !35
  %104 = or i32 %103, %100
  store i32 %104, ptr %102, align 8, !tbaa !35
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.Table, ptr %105, i32 0, i32 11
  store i16 0, ptr %106, align 2, !tbaa !34
  %107 = load ptr, ptr %12, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.Table, ptr %107, i32 0, i32 1
  store ptr null, ptr %108, align 8, !tbaa !33
  %109 = load ptr, ptr %12, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.Table, ptr %109, i32 0, i32 9
  %111 = load i32, ptr %110, align 8, !tbaa !35
  %112 = and i32 %111, 32
  %113 = icmp eq i32 %112, 0
  br i1 %113, label %126, label %114

114:                                              ; preds = %83
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.VtabCtx, ptr %115, i32 0, i32 0
  %117 = load ptr, ptr %116, align 8, !tbaa !36
  %118 = getelementptr inbounds %struct.VTable, ptr %117, i32 0, i32 1
  %119 = load ptr, ptr %118, align 8, !tbaa !37
  %120 = getelementptr inbounds %struct.Module, ptr %119, i32 0, i32 0
  %121 = load ptr, ptr %120, align 8, !tbaa !39
  %122 = getelementptr inbounds %struct.sqlite3_module, ptr %121, i32 0, i32 13
  %123 = load ptr, ptr %122, align 8, !tbaa !41
  %124 = icmp ne ptr %123, null
  br i1 %124, label %125, label %126

125:                                              ; preds = %114
  store i32 1, ptr %8, align 4, !tbaa !9
  br label %126

126:                                              ; preds = %125, %114, %83
  %127 = load ptr, ptr %12, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.Table, ptr %127, i32 0, i32 2
  %129 = load ptr, ptr %128, align 8, !tbaa !43
  store ptr %129, ptr %13, align 8, !tbaa !5
  %130 = load ptr, ptr %13, align 8, !tbaa !5
  %131 = icmp ne ptr %130, null
  br i1 %131, label %132, label %141

132:                                              ; preds = %126
  %133 = load ptr, ptr %13, align 8, !tbaa !5
  %134 = load ptr, ptr %9, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.Table, ptr %134, i32 0, i32 2
  store ptr %133, ptr %135, align 8, !tbaa !43
  %136 = load ptr, ptr %12, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.Table, ptr %136, i32 0, i32 2
  store ptr null, ptr %137, align 8, !tbaa !43
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  %139 = load ptr, ptr %13, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.Index, ptr %139, i32 0, i32 3
  store ptr %138, ptr %140, align 8, !tbaa !44
  br label %141

141:                                              ; preds = %132, %126
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  br label %142

142:                                              ; preds = %141, %78
  %143 = load ptr, ptr %6, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.VtabCtx, ptr %143, i32 0, i32 3
  store i32 1, ptr %144, align 8, !tbaa !20
  br label %154

145:                                              ; preds = %71, %64, %59, %54, %42
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = load ptr, ptr %10, align 8, !tbaa !5
  %148 = icmp ne ptr %147, null
  %149 = zext i1 %148 to i64
  %150 = select i1 %148, ptr @.str.5, ptr null
  %151 = load ptr, ptr %10, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @sqlite3ErrorWithMsg(ptr noundef %146, i32 noundef 1, ptr noundef %150, ptr noundef %151)
  %152 = load ptr, ptr %4, align 8, !tbaa !5
  %153 = load ptr, ptr %10, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef %152, ptr noundef %153)
  store i32 1, ptr %8, align 4, !tbaa !9
  br label %154

154:                                              ; preds = %145, %142
  %155 = load ptr, ptr %7, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.Parse, ptr %155, i32 0, i32 53
  store i8 0, ptr %156, align 4, !tbaa !23
  %157 = load ptr, ptr %7, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.Parse, ptr %157, i32 0, i32 2
  %159 = load ptr, ptr %158, align 8, !tbaa !46
  %160 = icmp ne ptr %159, null
  br i1 %160, label %161, label %166

161:                                              ; preds = %154
  %162 = load ptr, ptr %7, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.Parse, ptr %162, i32 0, i32 2
  %164 = load ptr, ptr %163, align 8, !tbaa !46
  %165 = call i32 @sqlite3VdbeFinalize(ptr noundef %164)
  br label %166

166:                                              ; preds = %161, %154
  %167 = load ptr, ptr %4, align 8, !tbaa !5
  %168 = load ptr, ptr %7, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.Parse, ptr %168, i32 0, i32 61
  %170 = load ptr, ptr %169, align 8, !tbaa !28
  call void @sqlite3DeleteTable(ptr noundef %167, ptr noundef %170)
  %171 = load ptr, ptr %7, align 8, !tbaa !5
  call void @sqlite3ParserReset(ptr noundef %171)
  %172 = load ptr, ptr %4, align 8, !tbaa !5
  %173 = load ptr, ptr %7, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef %172, ptr noundef %173)
  br label %174

174:                                              ; preds = %166, %41
  %175 = load ptr, ptr %4, align 8, !tbaa !5
  %176 = load i32, ptr %8, align 4, !tbaa !9
  %177 = call i32 @sqlite3ApiExit(ptr noundef %175, i32 noundef %176)
  store i32 %177, ptr %8, align 4, !tbaa !9
  %178 = load ptr, ptr %4, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.sqlite3, ptr %178, i32 0, i32 3
  %180 = load ptr, ptr %179, align 8, !tbaa !11
  call void @sqlite3_mutex_leave(ptr noundef %180)
  %181 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %181, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %182

182:                                              ; preds = %174, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  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
  %183 = load i32, ptr %3, align 4
  ret i32 %183
}

declare void @sqlite3_mutex_enter(ptr noundef) #1

declare void @sqlite3Error(ptr noundef, i32 noundef) #1

declare void @sqlite3_mutex_leave(ptr noundef) #1

declare i32 @sqlite3MisuseError(i32 noundef) #1

declare ptr @sqlite3DbMallocZero(ptr noundef, i64 noundef) #1

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

declare void @sqlite3ErrorWithMsg(ptr noundef, i32 noundef, ptr noundef, ...) #1

declare i32 @sqlite3VdbeFinalize(ptr noundef) #1

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

declare void @sqlite3ParserReset(ptr noundef) #1

declare i32 @sqlite3ApiExit(ptr noundef, i32 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 24}
!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 = !{!12, !6, i64 464}
!20 = !{!21, !10, i64 24}
!21 = !{!"VtabCtx", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24}
!22 = !{!21, !6, i64 8}
!23 = !{!24, !7, i64 468}
!24 = !{!"Parse", !6, i64 0, !6, i64 8, !6, i64 16, !10, 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, !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, !6, i64 88, !6, i64 96, !25, i64 104, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !7, i64 192, !7, i64 193, !7, i64 194, !7, i64 196, !7, i64 396, !25, i64 432, !25, i64 448, !14, i64 464, !7, i64 466, !7, i64 467, !7, i64 468, !10, i64 472, !10, i64 476, !10, i64 480, !10, i64 484, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !25, i64 536, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584}
!25 = !{!"Token", !6, i64 0, !10, i64 8}
!26 = !{!24, !6, i64 0}
!27 = !{!24, !10, i64 180}
!28 = !{!24, !6, i64 512}
!29 = !{!12, !7, i64 85}
!30 = !{!31, !6, i64 24}
!31 = !{!"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}
!32 = !{!31, !10, i64 84}
!33 = !{!31, !6, i64 8}
!34 = !{!31, !14, i64 70}
!35 = !{!31, !10, i64 64}
!36 = !{!21, !6, i64 0}
!37 = !{!38, !6, i64 8}
!38 = !{!"VTable", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !7, i64 28, !10, i64 32, !6, i64 40}
!39 = !{!40, !6, i64 0}
!40 = !{!"Module", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!41 = !{!42, !6, i64 104}
!42 = !{!"sqlite3_module", !10, 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, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!43 = !{!31, !6, i64 16}
!44 = !{!45, !6, i64 24}
!45 = !{!"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, !10, i64 88, !14, i64 92, !14, i64 94, !14, i64 96, !7, i64 98, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99}
!46 = !{!24, !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"

@.str.5 = external hidden unnamed_addr constant [3 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 @sqlite3_declare_vtab(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  store ptr null, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 24
  %5 = load ptr, ptr %4, align 8, !tbaa !9
  tail call void @sqlite3_mutex_enter(ptr noundef %5) #3
  %6 = getelementptr inbounds i8, ptr %0, i64 464
  %7 = load ptr, ptr %6, align 8, !tbaa !18
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %11, label %8

8:                                                ; preds = %2
  %9 = getelementptr inbounds i8, ptr %7, i64 24
  %10 = load i32, ptr %9, align 8, !tbaa !19
  %.not59 = icmp eq i32 %10, 0
  br i1 %.not59, label %14, label %11

11:                                               ; preds = %8, %2
  tail call void @sqlite3Error(ptr noundef nonnull %0, i32 noundef 21) #3
  %12 = load ptr, ptr %4, align 8, !tbaa !9
  tail call void @sqlite3_mutex_leave(ptr noundef %12) #3
  %13 = tail call i32 @sqlite3MisuseError(i32 noundef 751) #3
  br label %83

14:                                               ; preds = %8
  %15 = getelementptr inbounds i8, ptr %7, i64 8
  %16 = load ptr, ptr %15, align 8, !tbaa !21
  %17 = tail call ptr @sqlite3DbMallocZero(ptr noundef nonnull %0, i64 noundef 592) #3
  %18 = icmp eq ptr %17, null
  br i1 %18, label %80, label %19

19:                                               ; preds = %14
  %20 = getelementptr inbounds i8, ptr %17, i64 468
  store i8 1, ptr %20, align 4, !tbaa !22
  store ptr %0, ptr %17, align 8, !tbaa !25
  %21 = getelementptr inbounds i8, ptr %17, i64 180
  store i32 1, ptr %21, align 4, !tbaa !26
  %22 = call i32 @sqlite3RunParser(ptr noundef nonnull %17, ptr noundef %1, ptr noundef nonnull %3) #3
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %68

24:                                               ; preds = %19
  %25 = getelementptr inbounds i8, ptr %17, i64 512
  %26 = load ptr, ptr %25, align 8, !tbaa !27
  %.not60 = icmp eq ptr %26, null
  br i1 %.not60, label %68, label %27

27:                                               ; preds = %24
  %28 = getelementptr inbounds i8, ptr %0, i64 85
  %29 = load i8, ptr %28, align 1, !tbaa !28
  %.not61 = icmp eq i8 %29, 0
  br i1 %.not61, label %30, label %68

30:                                               ; preds = %27
  %31 = getelementptr inbounds i8, ptr %26, i64 24
  %32 = load ptr, ptr %31, align 8, !tbaa !29
  %.not62 = icmp eq ptr %32, null
  br i1 %.not62, label %33, label %68

33:                                               ; preds = %30
  %34 = getelementptr inbounds i8, ptr %26, i64 84
  %35 = load i32, ptr %34, align 4, !tbaa !31
  %.not63 = icmp eq i32 %35, 0
  br i1 %.not63, label %36, label %68

36:                                               ; preds = %33
  %37 = getelementptr inbounds i8, ptr %16, i64 8
  %38 = load ptr, ptr %37, align 8, !tbaa !32
  %.not64 = icmp eq ptr %38, null
  br i1 %.not64, label %39, label %67

39:                                               ; preds = %36
  %40 = getelementptr inbounds i8, ptr %26, i64 8
  %41 = load ptr, ptr %40, align 8, !tbaa !32
  store ptr %41, ptr %37, align 8, !tbaa !32
  %42 = getelementptr inbounds i8, ptr %26, i64 70
  %43 = load i16, ptr %42, align 2, !tbaa !33
  %44 = getelementptr inbounds i8, ptr %16, i64 70
  store i16 %43, ptr %44, align 2, !tbaa !33
  %45 = getelementptr inbounds i8, ptr %26, i64 64
  %46 = load i32, ptr %45, align 8, !tbaa !34
  %47 = and i32 %46, 96
  %48 = getelementptr inbounds i8, ptr %16, i64 64
  %49 = load i32, ptr %48, align 8, !tbaa !34
  %50 = or i32 %49, %47
  store i32 %50, ptr %48, align 8, !tbaa !34
  store i16 0, ptr %42, align 2, !tbaa !33
  store ptr null, ptr %40, align 8, !tbaa !32
  %51 = load i32, ptr %45, align 8, !tbaa !34
  %52 = and i32 %51, 32
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %61, label %54

54:                                               ; preds = %39
  %55 = load ptr, ptr %7, align 8, !tbaa !35
  %56 = getelementptr inbounds i8, ptr %55, i64 8
  %57 = load ptr, ptr %56, align 8, !tbaa !36
  %58 = load ptr, ptr %57, align 8, !tbaa !38
  %59 = getelementptr inbounds i8, ptr %58, i64 104
  %60 = load ptr, ptr %59, align 8, !tbaa !40
  %.not65 = icmp ne ptr %60, null
  %spec.select = zext i1 %.not65 to i32
  br label %61

61:                                               ; preds = %54, %39
  %.053 = phi i32 [ 0, %39 ], [ %spec.select, %54 ]
  %62 = getelementptr inbounds i8, ptr %26, i64 16
  %63 = load ptr, ptr %62, align 8, !tbaa !42
  %.not66 = icmp eq ptr %63, null
  br i1 %.not66, label %67, label %64

64:                                               ; preds = %61
  %65 = getelementptr inbounds i8, ptr %16, i64 16
  store ptr %63, ptr %65, align 8, !tbaa !42
  store ptr null, ptr %62, align 8, !tbaa !42
  %66 = getelementptr inbounds i8, ptr %63, i64 24
  store ptr %16, ptr %66, align 8, !tbaa !43
  br label %67

67:                                               ; preds = %61, %64, %36
  %.1 = phi i32 [ 0, %36 ], [ %.053, %64 ], [ %.053, %61 ]
  store i32 1, ptr %9, align 8, !tbaa !19
  br label %72

68:                                               ; preds = %33, %30, %27, %24, %19
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %.not67 = icmp eq ptr %69, null
  %70 = select i1 %.not67, ptr null, ptr @.str.5
  call void (ptr, i32, ptr, ...) @sqlite3ErrorWithMsg(ptr noundef nonnull %0, i32 noundef 1, ptr noundef %70, ptr noundef %69) #3
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef nonnull %0, ptr noundef %71) #3
  br label %72

72:                                               ; preds = %68, %67
  %.2 = phi i32 [ 1, %68 ], [ %.1, %67 ]
  store i8 0, ptr %20, align 4, !tbaa !22
  %73 = getelementptr inbounds i8, ptr %17, i64 16
  %74 = load ptr, ptr %73, align 8, !tbaa !45
  %.not68 = icmp eq ptr %74, null
  br i1 %.not68, label %77, label %75

75:                                               ; preds = %72
  %76 = call i32 @sqlite3VdbeFinalize(ptr noundef nonnull %74) #3
  br label %77

77:                                               ; preds = %75, %72
  %78 = getelementptr inbounds i8, ptr %17, i64 512
  %79 = load ptr, ptr %78, align 8, !tbaa !27
  call void @sqlite3DeleteTable(ptr noundef nonnull %0, ptr noundef %79) #3
  call void @sqlite3ParserReset(ptr noundef nonnull %17) #3
  call void @sqlite3DbFree(ptr noundef nonnull %0, ptr noundef nonnull %17) #3
  br label %80

80:                                               ; preds = %14, %77
  %.3 = phi i32 [ %.2, %77 ], [ 7, %14 ]
  %81 = call i32 @sqlite3ApiExit(ptr noundef nonnull %0, i32 noundef %.3) #3
  %82 = load ptr, ptr %4, align 8, !tbaa !9
  call void @sqlite3_mutex_leave(ptr noundef %82) #3
  br label %83

83:                                               ; preds = %80, %11
  %.0 = phi i32 [ %13, %11 ], [ %81, %80 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  ret i32 %.0
}

declare void @sqlite3_mutex_enter(ptr noundef) local_unnamed_addr #1

declare void @sqlite3Error(ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @sqlite3_mutex_leave(ptr noundef) local_unnamed_addr #1

declare i32 @sqlite3MisuseError(i32 noundef) local_unnamed_addr #1

declare ptr @sqlite3DbMallocZero(ptr noundef, i64 noundef) local_unnamed_addr #1

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

declare void @sqlite3ErrorWithMsg(ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #1

declare i32 @sqlite3VdbeFinalize(ptr noundef) local_unnamed_addr #1

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

declare void @sqlite3ParserReset(ptr noundef) local_unnamed_addr #1

declare i32 @sqlite3ApiExit(ptr noundef, i32 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 24}
!10 = !{!"sqlite3", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !11, i64 44, !12, i64 48, !12, 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, !14, 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, !15, i64 344, !6, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !11, i64 432, !11, i64 436, !16, i64 440, !6, i64 464, !6, i64 472, !6, i64 480, !16, i64 488, !16, i64 512, !17, i64 536, !7, i64 560, !6, i64 624, !11, i64 632, !11, i64 636, !11, i64 640, !12, i64 648, !12, i64 656, !6, i64 664}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!"sqlite3InitInfo", !11, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7}
!15 = !{!"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}
!16 = !{!"Hash", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16}
!17 = !{!"BusyHandler", !6, i64 0, !6, i64 8, !11, i64 16}
!18 = !{!10, !6, i64 464}
!19 = !{!20, !11, i64 24}
!20 = !{!"VtabCtx", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24}
!21 = !{!20, !6, i64 8}
!22 = !{!23, !7, i64 468}
!23 = !{!"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, !24, 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, !24, i64 432, !24, 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, !24, i64 536, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584}
!24 = !{!"Token", !6, i64 0, !11, i64 8}
!25 = !{!23, !6, i64 0}
!26 = !{!23, !11, i64 180}
!27 = !{!23, !6, i64 512}
!28 = !{!10, !7, i64 85}
!29 = !{!30, !6, i64 24}
!30 = !{!"Table", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !11, i64 56, !11, i64 60, !11, i64 64, !13, i64 68, !13, i64 70, !13, i64 72, !13, i64 74, !7, i64 76, !11, i64 80, !11, i64 84, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!31 = !{!30, !11, i64 84}
!32 = !{!30, !6, i64 8}
!33 = !{!30, !13, i64 70}
!34 = !{!30, !11, i64 64}
!35 = !{!20, !6, i64 0}
!36 = !{!37, !6, i64 8}
!37 = !{!"VTable", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !7, i64 28, !11, i64 32, !6, i64 40}
!38 = !{!39, !6, i64 0}
!39 = !{!"Module", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!40 = !{!41, !6, i64 104}
!41 = !{!"sqlite3_module", !11, 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, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!42 = !{!30, !6, i64 16}
!43 = !{!44, !6, i64 24}
!44 = !{!"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}
!45 = !{!23, !6, i64 16}


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