; LLVM IR from HassenSaidi/IC_sqlite :: src (sqlite3)

; 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, ptr, ptr, %struct.Token, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i8, i8, i8, [8 x i32], %struct.Token, %struct.Token, i16, i8, i8, i8, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.Token, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.Token = type { ptr, i32 }
%struct.sqlite3 = type { ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i64, i64, i32, 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, %union.anon, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %union.anon.0, %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, i32, i64, i64, ptr }
%struct.sqlite3InitInfo = type { i32, i8, i8, i8, ptr }
%union.anon = type { ptr }
%union.anon.0 = type { double }
%struct.Lookaside = type { i32, i16, i16, i8, i32, [3 x i32], ptr, ptr, ptr, ptr, 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.Table = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i16, i16, i16, i16, i16, i8, i32, i32, ptr, ptr, ptr, ptr, ptr }
%struct.VTable = type { ptr, ptr, ptr, i32, i8, i8, i32, ptr }
%struct.Module = type { ptr, ptr, i32, 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, ptr }
%struct.Index = type <{ ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i16, i16, i16, i8, i16, [3 x i8], i64 }>

@.str.20 = 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

; Function Attrs: nounwind uwtable
declare hidden i32 @sqlite3MisuseError(i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @sqlite3_mutex_enter(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @sqlite3_mutex_leave(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
declare hidden void @sqlite3DeleteTable(ptr noundef, ptr noundef) #1

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

; Function Attrs: nounwind uwtable
declare hidden void @sqlite3ErrorWithMsg(ptr noundef, i32 noundef, ptr noundef, ...) #1

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

; Function Attrs: nounwind uwtable
declare hidden i32 @sqlite3VdbeFinalize(ptr noundef) #1

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

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

; Function Attrs: nounwind uwtable
declare hidden void @sqlite3ParserReset(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @sqlite3_declare_vtab(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %struct.Parse, 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 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 424, ptr %10) #3
  %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 69
  %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 140941)
  store i32 %32, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %167

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 %8, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %10, i8 0, i64 424, i1 false)
  %37 = getelementptr inbounds %struct.Parse, ptr %10, i32 0, i32 52
  store i8 1, ptr %37, align 4, !tbaa !23
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.Parse, ptr %10, i32 0, i32 0
  store ptr %38, ptr %39, align 8, !tbaa !26
  %40 = getelementptr inbounds %struct.Parse, ptr %10, i32 0, i32 40
  store i32 1, ptr %40, align 4, !tbaa !27
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = call i32 @sqlite3RunParser(ptr noundef %10, ptr noundef %41, ptr noundef %9)
  %43 = icmp eq i32 0, %42
  br i1 %43, label %44, label %138

44:                                               ; preds = %33
  %45 = getelementptr inbounds %struct.Parse, ptr %10, i32 0, i32 59
  %46 = load ptr, ptr %45, align 8, !tbaa !28
  %47 = icmp ne ptr %46, null
  br i1 %47, label %48, label %138

48:                                               ; preds = %44
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.sqlite3, ptr %49, i32 0, i32 19
  %51 = load i8, ptr %50, align 1, !tbaa !29
  %52 = icmp ne i8 %51, 0
  br i1 %52, label %138, label %53

53:                                               ; preds = %48
  %54 = getelementptr inbounds %struct.Parse, ptr %10, i32 0, i32 59
  %55 = load ptr, ptr %54, align 8, !tbaa !28
  %56 = getelementptr inbounds %struct.Table, ptr %55, i32 0, i32 3
  %57 = load ptr, ptr %56, align 8, !tbaa !30
  %58 = icmp ne ptr %57, null
  br i1 %58, label %138, label %59

59:                                               ; preds = %53
  %60 = getelementptr inbounds %struct.Parse, ptr %10, i32 0, i32 59
  %61 = load ptr, ptr %60, align 8, !tbaa !28
  %62 = getelementptr inbounds %struct.Table, ptr %61, i32 0, i32 17
  %63 = load i32, ptr %62, align 4, !tbaa !32
  %64 = icmp ne i32 %63, 0
  br i1 %64, label %138, label %65

65:                                               ; preds = %59
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.Table, ptr %66, i32 0, i32 1
  %68 = load ptr, ptr %67, align 8, !tbaa !33
  %69 = icmp ne ptr %68, null
  br i1 %69, label %135, label %70

70:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %71 = getelementptr inbounds %struct.Parse, ptr %10, i32 0, i32 59
  %72 = load ptr, ptr %71, align 8, !tbaa !28
  store ptr %72, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %73 = load ptr, ptr %12, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.Table, ptr %73, i32 0, i32 1
  %75 = load ptr, ptr %74, align 8, !tbaa !33
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.Table, ptr %76, i32 0, i32 1
  store ptr %75, ptr %77, align 8, !tbaa !33
  %78 = load ptr, ptr %12, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.Table, ptr %78, i32 0, i32 11
  %80 = load i16, ptr %79, align 2, !tbaa !34
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.Table, ptr %81, i32 0, i32 11
  store i16 %80, ptr %82, align 2, !tbaa !34
  %83 = load ptr, ptr %12, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.Table, ptr %83, i32 0, i32 9
  %85 = load i32, ptr %84, align 8, !tbaa !35
  %86 = and i32 %85, 640
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.Table, ptr %87, i32 0, i32 9
  %89 = load i32, ptr %88, align 8, !tbaa !35
  %90 = or i32 %89, %86
  store i32 %90, ptr %88, align 8, !tbaa !35
  %91 = load ptr, ptr %12, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.Table, ptr %91, i32 0, i32 11
  store i16 0, ptr %92, align 2, !tbaa !34
  %93 = load ptr, ptr %12, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.Table, ptr %93, i32 0, i32 1
  store ptr null, ptr %94, align 8, !tbaa !33
  %95 = load ptr, ptr %12, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.Table, ptr %95, i32 0, i32 9
  %97 = load i32, ptr %96, align 8, !tbaa !35
  %98 = and i32 %97, 128
  %99 = icmp eq i32 %98, 0
  br i1 %99, label %119, label %100

100:                                              ; preds = %70
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.VtabCtx, ptr %101, i32 0, i32 0
  %103 = load ptr, ptr %102, align 8, !tbaa !36
  %104 = getelementptr inbounds %struct.VTable, ptr %103, i32 0, i32 1
  %105 = load ptr, ptr %104, align 8, !tbaa !37
  %106 = getelementptr inbounds %struct.Module, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !39
  %108 = getelementptr inbounds %struct.sqlite3_module, ptr %107, i32 0, i32 13
  %109 = load ptr, ptr %108, align 8, !tbaa !41
  %110 = icmp ne ptr %109, null
  br i1 %110, label %111, label %119

111:                                              ; preds = %100
  %112 = load ptr, ptr %12, align 8, !tbaa !5
  %113 = call ptr @sqlite3PrimaryKeyIndex(ptr noundef %112)
  %114 = getelementptr inbounds %struct.Index, ptr %113, i32 0, i32 13
  %115 = load i16, ptr %114, align 2, !tbaa !43
  %116 = zext i16 %115 to i32
  %117 = icmp ne i32 %116, 1
  br i1 %117, label %118, label %119

118:                                              ; preds = %111
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %119

119:                                              ; preds = %118, %111, %100, %70
  %120 = load ptr, ptr %12, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.Table, ptr %120, i32 0, i32 2
  %122 = load ptr, ptr %121, align 8, !tbaa !45
  store ptr %122, ptr %13, align 8, !tbaa !5
  %123 = load ptr, ptr %13, align 8, !tbaa !5
  %124 = icmp ne ptr %123, null
  br i1 %124, label %125, label %134

125:                                              ; preds = %119
  %126 = load ptr, ptr %13, align 8, !tbaa !5
  %127 = load ptr, ptr %8, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.Table, ptr %127, i32 0, i32 2
  store ptr %126, ptr %128, align 8, !tbaa !45
  %129 = load ptr, ptr %12, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.Table, ptr %129, i32 0, i32 2
  store ptr null, ptr %130, align 8, !tbaa !45
  %131 = load ptr, ptr %8, align 8, !tbaa !5
  %132 = load ptr, ptr %13, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.Index, ptr %132, i32 0, i32 3
  store ptr %131, ptr %133, align 8, !tbaa !46
  br label %134

134:                                              ; preds = %125, %119
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  br label %135

135:                                              ; preds = %134, %65
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.VtabCtx, ptr %136, i32 0, i32 3
  store i32 1, ptr %137, align 8, !tbaa !20
  br label %147

138:                                              ; preds = %59, %53, %48, %44, %33
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = load ptr, ptr %9, align 8, !tbaa !5
  %141 = icmp ne ptr %140, null
  %142 = zext i1 %141 to i64
  %143 = select i1 %141, ptr @.str.20, ptr null
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @sqlite3ErrorWithMsg(ptr noundef %139, i32 noundef 1, ptr noundef %143, ptr noundef %144)
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = load ptr, ptr %9, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef %145, ptr noundef %146)
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %147

147:                                              ; preds = %138, %135
  %148 = getelementptr inbounds %struct.Parse, ptr %10, i32 0, i32 52
  store i8 0, ptr %148, align 4, !tbaa !23
  %149 = getelementptr inbounds %struct.Parse, ptr %10, i32 0, i32 2
  %150 = load ptr, ptr %149, align 8, !tbaa !47
  %151 = icmp ne ptr %150, null
  br i1 %151, label %152, label %156

152:                                              ; preds = %147
  %153 = getelementptr inbounds %struct.Parse, ptr %10, i32 0, i32 2
  %154 = load ptr, ptr %153, align 8, !tbaa !47
  %155 = call i32 @sqlite3VdbeFinalize(ptr noundef %154)
  br label %156

156:                                              ; preds = %152, %147
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.Parse, ptr %10, i32 0, i32 59
  %159 = load ptr, ptr %158, align 8, !tbaa !28
  call void @sqlite3DeleteTable(ptr noundef %157, ptr noundef %159)
  call void @sqlite3ParserReset(ptr noundef %10)
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  %161 = load i32, ptr %7, align 4, !tbaa !9
  %162 = call i32 @sqlite3ApiExit(ptr noundef %160, i32 noundef %161)
  store i32 %162, ptr %7, align 4, !tbaa !9
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.sqlite3, ptr %163, i32 0, i32 3
  %165 = load ptr, ptr %164, align 8, !tbaa !11
  call void @sqlite3_mutex_leave(ptr noundef %165)
  %166 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %166, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %167

167:                                              ; preds = %156, %27
  call void @llvm.lifetime.end.p0(i64 424, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %168 = load i32, ptr %3, align 4
  ret i32 %168
}

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

; Function Attrs: nounwind uwtable
declare hidden ptr @sqlite3PrimaryKeyIndex(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 nounwind willreturn memory(argmem: write) }
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, !13, i64 64, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !14, i64 92, !7, i64 94, !7, i64 95, !7, i64 96, !7, i64 97, !7, i64 98, !7, i64 99, !7, i64 100, !7, i64 101, !7, i64 102, !7, i64 103, !7, i64 104, !7, i64 105, !7, i64 106, !10, i64 108, !10, i64 112, !10, i64 116, !10, i64 120, !7, i64 124, !10, i64 172, !15, i64 176, !10, i64 192, !10, i64 196, !10, i64 200, !10, i64 204, !10, i64 208, !10, i64 212, !6, i64 216, !7, 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, !6, i64 336, !6, i64 344, !6, i64 352, !7, i64 360, !16, i64 368, !6, i64 456, !6, i64 464, !6, i64 472, !6, i64 480, !10, i64 488, !10, i64 492, !17, i64 496, !6, i64 520, !6, i64 528, !6, i64 536, !17, i64 544, !17, i64 568, !18, i64 592, !7, i64 616, !6, i64 680, !10, i64 688, !10, i64 692, !10, i64 696, !10, i64 700, !13, i64 704, !13, i64 712, !6, i64 720}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!"sqlite3InitInfo", !10, i64 0, !7, i64 4, !7, i64 5, !10, i64 6, !10, i64 6, !10, i64 6, !6, i64 8}
!16 = !{!"Lookaside", !10, i64 0, !14, i64 4, !14, i64 6, !7, i64 8, !10, i64 12, !7, i64 16, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80}
!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 520}
!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 284}
!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, !6, i64 80, !6, i64 88, !25, i64 96, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !10, i64 192, !10, i64 196, !10, i64 200, !10, i64 204, !7, i64 208, !7, i64 209, !7, i64 210, !7, i64 212, !25, i64 248, !25, i64 264, !14, i64 280, !7, i64 282, !7, i64 283, !7, i64 284, !10, i64 288, !10, i64 292, !10, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !25, i64 360, !6, i64 376, !6, i64 384, !6, i64 392, !6, i64 400, !6, i64 408, !6, i64 416}
!25 = !{!"Token", !6, i64 0, !10, i64 8}
!26 = !{!24, !6, i64 0}
!27 = !{!24, !10, i64 196}
!28 = !{!24, !6, i64 328}
!29 = !{!12, !7, i64 97}
!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, !14, i64 76, !7, i64 78, !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, !7, i64 29, !10, i64 32, !6, i64 40}
!39 = !{!40, !6, i64 0}
!40 = !{!"Module", !6, i64 0, !6, i64 8, !10, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!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, !6, i64 184}
!43 = !{!44, !14, i64 94}
!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, !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, !10, i64 100, !10, i64 100, !10, i64 100, !13, i64 104}
!45 = !{!31, !6, i64 16}
!46 = !{!44, !6, i64 24}
!47 = !{!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"

%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, ptr, ptr, %struct.Token, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i8, i8, i8, [8 x i32], %struct.Token, %struct.Token, i16, i8, i8, i8, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.Token, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.Token = type { ptr, i32 }

@.str.20 = 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

; Function Attrs: nounwind uwtable
declare hidden i32 @sqlite3MisuseError(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @sqlite3_mutex_enter(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @sqlite3_mutex_leave(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
declare hidden void @sqlite3DeleteTable(ptr noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare hidden void @sqlite3ErrorWithMsg(ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare hidden i32 @sqlite3VdbeFinalize(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @sqlite3ApiExit(ptr noundef, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare hidden void @sqlite3ParserReset(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @sqlite3_declare_vtab(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = alloca ptr, align 8
  %4 = alloca %struct.Parse, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  store ptr null, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 424, ptr nonnull %4) #3
  %5 = getelementptr inbounds i8, ptr %0, i64 24
  %6 = load ptr, ptr %5, align 8, !tbaa !9
  tail call void @sqlite3_mutex_enter(ptr noundef %6)
  %7 = getelementptr inbounds i8, ptr %0, i64 520
  %8 = load ptr, ptr %7, align 8, !tbaa !18
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %12, label %9

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

12:                                               ; preds = %9, %2
  tail call void @sqlite3Error(ptr noundef nonnull %0, i32 noundef 21)
  %13 = load ptr, ptr %5, align 8, !tbaa !9
  tail call void @sqlite3_mutex_leave(ptr noundef %13)
  %14 = tail call i32 @sqlite3MisuseError(i32 noundef 140941)
  br label %84

15:                                               ; preds = %9
  %16 = getelementptr inbounds i8, ptr %8, i64 8
  %17 = load ptr, ptr %16, align 8, !tbaa !21
  %18 = getelementptr inbounds i8, ptr %4, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(424) %18, i8 0, i64 416, i1 false)
  %19 = getelementptr inbounds i8, ptr %4, i64 284
  store i8 1, ptr %19, align 4, !tbaa !22
  store ptr %0, ptr %4, align 8, !tbaa !25
  %20 = getelementptr inbounds i8, ptr %4, i64 196
  store i32 1, ptr %20, align 4, !tbaa !26
  %21 = call i32 @sqlite3RunParser(ptr noundef nonnull %4, ptr noundef %1, ptr noundef nonnull %3)
  %22 = icmp eq i32 %21, 0
  %23 = getelementptr inbounds i8, ptr %4, i64 328
  %24 = load ptr, ptr %23, align 8
  %25 = icmp ne ptr %24, null
  %or.cond = select i1 %22, i1 %25, i1 false
  br i1 %or.cond, label %26, label %71

26:                                               ; preds = %15
  %27 = getelementptr inbounds i8, ptr %0, i64 97
  %28 = load i8, ptr %27, align 1, !tbaa !27
  %.not45 = icmp eq i8 %28, 0
  br i1 %.not45, label %29, label %71

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

32:                                               ; preds = %29
  %33 = getelementptr inbounds i8, ptr %24, i64 84
  %34 = load i32, ptr %33, align 4, !tbaa !30
  %.not47 = icmp eq i32 %34, 0
  br i1 %.not47, label %35, label %71

35:                                               ; preds = %32
  %36 = getelementptr inbounds i8, ptr %17, i64 8
  %37 = load ptr, ptr %36, align 8, !tbaa !31
  %.not48 = icmp eq ptr %37, null
  br i1 %.not48, label %38, label %70

38:                                               ; preds = %35
  %39 = getelementptr inbounds i8, ptr %24, i64 8
  %40 = load ptr, ptr %39, align 8, !tbaa !31
  store ptr %40, ptr %36, align 8, !tbaa !31
  %41 = getelementptr inbounds i8, ptr %24, i64 70
  %42 = load i16, ptr %41, align 2, !tbaa !32
  %43 = getelementptr inbounds i8, ptr %17, i64 70
  store i16 %42, ptr %43, align 2, !tbaa !32
  %44 = getelementptr inbounds i8, ptr %24, i64 64
  %45 = load i32, ptr %44, align 8, !tbaa !33
  %46 = and i32 %45, 640
  %47 = getelementptr inbounds i8, ptr %17, i64 64
  %48 = load i32, ptr %47, align 8, !tbaa !33
  %49 = or i32 %48, %46
  store i32 %49, ptr %47, align 8, !tbaa !33
  store i16 0, ptr %41, align 2, !tbaa !32
  store ptr null, ptr %39, align 8, !tbaa !31
  %50 = load i32, ptr %44, align 8, !tbaa !33
  %51 = and i32 %50, 128
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %64, label %53

53:                                               ; preds = %38
  %54 = load ptr, ptr %8, align 8, !tbaa !34
  %55 = getelementptr inbounds i8, ptr %54, i64 8
  %56 = load ptr, ptr %55, align 8, !tbaa !35
  %57 = load ptr, ptr %56, align 8, !tbaa !37
  %58 = getelementptr inbounds i8, ptr %57, i64 104
  %59 = load ptr, ptr %58, align 8, !tbaa !39
  %.not49 = icmp eq ptr %59, null
  br i1 %.not49, label %64, label %60

60:                                               ; preds = %53
  %61 = call ptr @sqlite3PrimaryKeyIndex(ptr noundef nonnull %24)
  %62 = getelementptr inbounds i8, ptr %61, i64 94
  %63 = load i16, ptr %62, align 2, !tbaa !41
  %.not50 = icmp ne i16 %63, 1
  %spec.select = zext i1 %.not50 to i32
  br label %64

64:                                               ; preds = %60, %53, %38
  %.039 = phi i32 [ 0, %38 ], [ 0, %53 ], [ %spec.select, %60 ]
  %65 = getelementptr inbounds i8, ptr %24, i64 16
  %66 = load ptr, ptr %65, align 8, !tbaa !43
  %.not51 = icmp eq ptr %66, null
  br i1 %.not51, label %70, label %67

67:                                               ; preds = %64
  %68 = getelementptr inbounds i8, ptr %17, i64 16
  store ptr %66, ptr %68, align 8, !tbaa !43
  store ptr null, ptr %65, align 8, !tbaa !43
  %69 = getelementptr inbounds i8, ptr %66, i64 24
  store ptr %17, ptr %69, align 8, !tbaa !44
  br label %70

70:                                               ; preds = %64, %67, %35
  %.1 = phi i32 [ 0, %35 ], [ %.039, %67 ], [ %.039, %64 ]
  store i32 1, ptr %10, align 8, !tbaa !19
  br label %75

71:                                               ; preds = %32, %29, %26, %15
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %.not52 = icmp eq ptr %72, null
  %73 = select i1 %.not52, ptr null, ptr @.str.20
  call void (ptr, i32, ptr, ...) @sqlite3ErrorWithMsg(ptr noundef nonnull %0, i32 noundef 1, ptr noundef %73, ptr noundef %72)
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef nonnull %0, ptr noundef %74)
  br label %75

75:                                               ; preds = %71, %70
  %.2 = phi i32 [ 1, %71 ], [ %.1, %70 ]
  store i8 0, ptr %19, align 4, !tbaa !22
  %76 = getelementptr inbounds i8, ptr %4, i64 16
  %77 = load ptr, ptr %76, align 8, !tbaa !45
  %.not53 = icmp eq ptr %77, null
  br i1 %.not53, label %80, label %78

78:                                               ; preds = %75
  %79 = call i32 @sqlite3VdbeFinalize(ptr noundef nonnull %77)
  br label %80

80:                                               ; preds = %78, %75
  %81 = load ptr, ptr %23, align 8, !tbaa !46
  call void @sqlite3DeleteTable(ptr noundef nonnull %0, ptr noundef %81)
  call void @sqlite3ParserReset(ptr noundef nonnull %4)
  %82 = call i32 @sqlite3ApiExit(ptr noundef nonnull %0, i32 noundef %.2)
  %83 = load ptr, ptr %5, align 8, !tbaa !9
  call void @sqlite3_mutex_leave(ptr noundef %83)
  br label %84

84:                                               ; preds = %80, %12
  %.0 = phi i32 [ %14, %12 ], [ %82, %80 ]
  call void @llvm.lifetime.end.p0(i64 424, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  ret i32 %.0
}

; Function Attrs: nounwind uwtable
declare hidden i32 @sqlite3RunParser(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden ptr @sqlite3PrimaryKeyIndex(ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 nounwind willreturn memory(argmem: write) }
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, !12, i64 64, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !13, i64 92, !7, i64 94, !7, i64 95, !7, i64 96, !7, i64 97, !7, i64 98, !7, i64 99, !7, i64 100, !7, i64 101, !7, i64 102, !7, i64 103, !7, i64 104, !7, i64 105, !7, i64 106, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !7, i64 124, !11, i64 172, !14, i64 176, !11, i64 192, !11, i64 196, !11, i64 200, !11, i64 204, !11, i64 208, !11, i64 212, !6, i64 216, !7, 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, !6, i64 336, !6, i64 344, !6, i64 352, !7, i64 360, !15, i64 368, !6, i64 456, !6, i64 464, !6, i64 472, !6, i64 480, !11, i64 488, !11, i64 492, !16, i64 496, !6, i64 520, !6, i64 528, !6, i64 536, !16, i64 544, !16, i64 568, !17, i64 592, !7, i64 616, !6, i64 680, !11, i64 688, !11, i64 692, !11, i64 696, !11, i64 700, !12, i64 704, !12, i64 712, !6, i64 720}
!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, !11, i64 6, !11, i64 6, !11, i64 6, !6, i64 8}
!15 = !{!"Lookaside", !11, i64 0, !13, i64 4, !13, i64 6, !7, i64 8, !11, i64 12, !7, i64 16, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80}
!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 520}
!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 284}
!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, !6, i64 80, !6, i64 88, !24, i64 96, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !11, i64 192, !11, i64 196, !11, i64 200, !11, i64 204, !7, i64 208, !7, i64 209, !7, i64 210, !7, i64 212, !24, i64 248, !24, i64 264, !13, i64 280, !7, i64 282, !7, i64 283, !7, i64 284, !11, i64 288, !11, i64 292, !11, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !24, i64 360, !6, i64 376, !6, i64 384, !6, i64 392, !6, i64 400, !6, i64 408, !6, i64 416}
!24 = !{!"Token", !6, i64 0, !11, i64 8}
!25 = !{!23, !6, i64 0}
!26 = !{!23, !11, i64 196}
!27 = !{!10, !7, i64 97}
!28 = !{!29, !6, i64 24}
!29 = !{!"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, !13, i64 76, !7, i64 78, !11, i64 80, !11, i64 84, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!30 = !{!29, !11, i64 84}
!31 = !{!29, !6, i64 8}
!32 = !{!29, !13, i64 70}
!33 = !{!29, !11, i64 64}
!34 = !{!20, !6, i64 0}
!35 = !{!36, !6, i64 8}
!36 = !{!"VTable", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !7, i64 28, !7, i64 29, !11, i64 32, !6, i64 40}
!37 = !{!38, !6, i64 0}
!38 = !{!"Module", !6, i64 0, !6, i64 8, !11, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!39 = !{!40, !6, i64 104}
!40 = !{!"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, !6, i64 184}
!41 = !{!42, !13, i64 94}
!42 = !{!"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, !11, i64 100, !11, i64 100, !11, i64 100, !12, i64 104}
!43 = !{!29, !6, i64 16}
!44 = !{!42, !6, i64 24}
!45 = !{!23, !6, i64 16}
!46 = !{!23, !6, i64 328}


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