; 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.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.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 }

@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [27 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 ptr @sqlite3HashInsert(ptr noundef, ptr noundef, ptr noundef) #1

declare void @sqlite3OomFault(ptr noundef) #1

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

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

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

24:                                               ; preds = %2
  store i32 1, ptr %7, align 4
  br label %145

25:                                               ; preds = %2
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  call void @addArgumentToVtab(ptr noundef %26)
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.Parse, ptr %27, i32 0, i32 64
  %29 = getelementptr inbounds %struct.Token, ptr %28, i32 0, i32 0
  store ptr null, ptr %29, align 8, !tbaa !15
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.Table, ptr %30, i32 0, i32 16
  %32 = load i32, ptr %31, align 4, !tbaa !16
  %33 = icmp slt i32 %32, 1
  br i1 %33, label %34, label %35

34:                                               ; preds = %25
  store i32 1, ptr %7, align 4
  br label %145

35:                                               ; preds = %25
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.sqlite3, ptr %36, i32 0, i32 33
  %38 = getelementptr inbounds %struct.sqlite3InitInfo, ptr %37, i32 0, i32 2
  %39 = load i8, ptr %38, align 1, !tbaa !18
  %40 = icmp ne i8 %39, 0
  br i1 %40, label %122, label %41

41:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = icmp ne ptr %42, null
  br i1 %43, label %44, label %63

44:                                               ; preds = %41
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.Token, ptr %45, i32 0, i32 0
  %47 = load ptr, ptr %46, align 8, !tbaa !25
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.Parse, ptr %48, i32 0, i32 48
  %50 = getelementptr inbounds %struct.Token, ptr %49, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !26
  %52 = ptrtoint ptr %47 to i64
  %53 = ptrtoint ptr %51 to i64
  %54 = sub i64 %52, %53
  %55 = trunc i64 %54 to i32
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.Token, ptr %56, i32 0, i32 1
  %58 = load i32, ptr %57, align 8, !tbaa !27
  %59 = add i32 %55, %58
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.Parse, ptr %60, i32 0, i32 48
  %62 = getelementptr inbounds %struct.Token, ptr %61, i32 0, i32 1
  store i32 %59, ptr %62, align 8, !tbaa !28
  br label %63

63:                                               ; preds = %44, %41
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.Parse, ptr %65, i32 0, i32 48
  %67 = call ptr (ptr, ptr, ...) @sqlite3MPrintf(ptr noundef %64, ptr noundef @.str, ptr noundef %66)
  store ptr %67, ptr %8, align 8, !tbaa !5
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.Table, ptr %69, i32 0, i32 20
  %71 = load ptr, ptr %70, align 8, !tbaa !29
  %72 = call i32 @sqlite3SchemaToIndex(ptr noundef %68, ptr noundef %71)
  store i32 %72, ptr %10, align 4, !tbaa !30
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.sqlite3, ptr %74, i32 0, i32 4
  %76 = load ptr, ptr %75, align 8, !tbaa !31
  %77 = load i32, ptr %10, align 4, !tbaa !30
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds %struct.Db, ptr %76, i64 %78
  %80 = getelementptr inbounds %struct.Db, ptr %79, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8, !tbaa !32
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.Table, ptr %82, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8, !tbaa !34
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.Table, ptr %85, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8, !tbaa !34
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.Parse, ptr %89, i32 0, i32 31
  %91 = load i32, ptr %90, align 8, !tbaa !35
  call void (ptr, ptr, ...) @sqlite3NestedParse(ptr noundef %73, ptr noundef @.str.1, ptr noundef %81, ptr noundef @.str.2, ptr noundef %84, ptr noundef %87, ptr noundef %88, i32 noundef %91)
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef %92, ptr noundef %93)
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = call ptr @sqlite3GetVdbe(ptr noundef %94)
  store ptr %95, ptr %12, align 8, !tbaa !5
  %96 = load ptr, ptr %3, align 8, !tbaa !5
  %97 = load i32, ptr %10, align 4, !tbaa !30
  call void @sqlite3ChangeCookie(ptr noundef %96, i32 noundef %97)
  %98 = load ptr, ptr %12, align 8, !tbaa !5
  %99 = call i32 @sqlite3VdbeAddOp0(ptr noundef %98, i32 noundef 151)
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.Table, ptr %101, i32 0, i32 0
  %103 = load ptr, ptr %102, align 8, !tbaa !34
  %104 = call ptr (ptr, ptr, ...) @sqlite3MPrintf(ptr noundef %100, ptr noundef @.str.3, ptr noundef %103)
  store ptr %104, ptr %9, align 8, !tbaa !5
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  %106 = load i32, ptr %10, align 4, !tbaa !30
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  call void @sqlite3VdbeAddParseSchemaOp(ptr noundef %105, i32 noundef %106, ptr noundef %107)
  %108 = load ptr, ptr %3, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.Parse, ptr %108, i32 0, i32 18
  %110 = load i32, ptr %109, align 8, !tbaa !36
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %109, align 8, !tbaa !36
  store i32 %111, ptr %11, align 4, !tbaa !30
  %112 = load ptr, ptr %12, align 8, !tbaa !5
  %113 = load i32, ptr %11, align 4, !tbaa !30
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.Table, ptr %114, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8, !tbaa !34
  %117 = call i32 @sqlite3VdbeLoadString(ptr noundef %112, i32 noundef %113, ptr noundef %116)
  %118 = load ptr, ptr %12, align 8, !tbaa !5
  %119 = load i32, ptr %10, align 4, !tbaa !30
  %120 = load i32, ptr %11, align 4, !tbaa !30
  %121 = call i32 @sqlite3VdbeAddOp2(ptr noundef %118, i32 noundef 154, i32 noundef %119, i32 noundef %120)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, 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
  br label %144

122:                                              ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.Table, ptr %123, i32 0, i32 20
  %125 = load ptr, ptr %124, align 8, !tbaa !29
  store ptr %125, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.Table, ptr %126, i32 0, i32 0
  %128 = load ptr, ptr %127, align 8, !tbaa !34
  store ptr %128, ptr %15, align 8, !tbaa !5
  %129 = load ptr, ptr %14, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.Schema, ptr %129, i32 0, i32 2
  %131 = load ptr, ptr %15, align 8, !tbaa !5
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = call ptr @sqlite3HashInsert(ptr noundef %130, ptr noundef %131, ptr noundef %132)
  store ptr %133, ptr %13, align 8, !tbaa !5
  %134 = load ptr, ptr %13, align 8, !tbaa !5
  %135 = icmp ne ptr %134, null
  br i1 %135, label %136, label %138

136:                                              ; preds = %122
  %137 = load ptr, ptr %6, align 8, !tbaa !5
  call void @sqlite3OomFault(ptr noundef %137)
  store i32 1, ptr %7, align 4
  br label %141

138:                                              ; preds = %122
  %139 = load ptr, ptr %3, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.Parse, ptr %139, i32 0, i32 61
  store ptr null, ptr %140, align 8, !tbaa !9
  store i32 0, ptr %7, align 4
  br label %141

141:                                              ; preds = %138, %136
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  %142 = load i32, ptr %7, align 4
  switch i32 %142, label %145 [
    i32 0, label %143
  ]

143:                                              ; preds = %141
  br label %144

144:                                              ; preds = %143, %63
  store i32 0, ptr %7, align 4
  br label %145

145:                                              ; preds = %144, %141, %34, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  %146 = load i32, ptr %7, align 4
  switch i32 %146, label %148 [
    i32 0, label %147
    i32 1, label %147
  ]

147:                                              ; preds = %145, %145
  ret void

148:                                              ; preds = %145
  unreachable
}

; Function Attrs: nounwind uwtable
declare hidden void @addArgumentToVtab(ptr noundef) #2

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

declare void @sqlite3NestedParse(ptr noundef, ptr noundef, ...) #1

declare ptr @sqlite3GetVdbe(ptr noundef) #1

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

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

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

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

declare i32 @sqlite3VdbeAddOp2(ptr noundef, i32 noundef, i32 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, !6, i64 512}
!10 = !{!"Parse", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !7, i64 28, !7, i64 29, !7, i64 30, !7, i64 31, !7, i64 32, !7, i64 33, !7, i64 34, !7, i64 35, !7, i64 36, !7, i64 37, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !6, i64 88, !6, i64 96, !12, i64 104, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !11, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !7, i64 192, !7, i64 193, !7, i64 194, !7, i64 196, !7, i64 396, !12, i64 432, !12, i64 448, !13, i64 464, !7, i64 466, !7, i64 467, !7, i64 468, !11, i64 472, !11, i64 476, !11, i64 480, !11, i64 484, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !12, i64 536, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584}
!11 = !{!"int", !7, i64 0}
!12 = !{!"Token", !6, i64 0, !11, i64 8}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !6, i64 0}
!15 = !{!10, !6, i64 536}
!16 = !{!17, !11, i64 84}
!17 = !{!"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}
!18 = !{!19, !7, i64 169}
!19 = !{!"sqlite3", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !11, i64 44, !20, i64 48, !20, 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, !21, 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, !22, i64 344, !6, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !11, i64 432, !11, i64 436, !23, i64 440, !6, i64 464, !6, i64 472, !6, i64 480, !23, i64 488, !23, i64 512, !24, i64 536, !7, i64 560, !6, i64 624, !11, i64 632, !11, i64 636, !11, i64 640, !20, i64 648, !20, i64 656, !6, i64 664}
!20 = !{!"long long", !7, i64 0}
!21 = !{!"sqlite3InitInfo", !11, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7}
!22 = !{!"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}
!23 = !{!"Hash", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16}
!24 = !{!"BusyHandler", !6, i64 0, !6, i64 8, !11, i64 16}
!25 = !{!12, !6, i64 0}
!26 = !{!10, !6, i64 432}
!27 = !{!12, !11, i64 8}
!28 = !{!10, !11, i64 440}
!29 = !{!17, !6, i64 112}
!30 = !{!11, !11, i64 0}
!31 = !{!19, !6, i64 32}
!32 = !{!33, !6, i64 0}
!33 = !{!"Db", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 17, !6, i64 24}
!34 = !{!17, !6, i64 0}
!35 = !{!10, !11, i64 128}
!36 = !{!10, !11, i64 56}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.Db = type { ptr, ptr, i8, i8, ptr }

@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [27 x i8], align 1

declare ptr @sqlite3HashInsert(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @sqlite3OomFault(ptr noundef) local_unnamed_addr #0

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

declare i32 @sqlite3SchemaToIndex(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @sqlite3VtabFinishParse(ptr noundef %0, ptr noundef readonly %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %0, i64 512
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = load ptr, ptr %0, align 8, !tbaa !13
  %6 = icmp eq ptr %4, null
  br i1 %6, label %60, label %7

7:                                                ; preds = %2
  tail call void @addArgumentToVtab(ptr noundef nonnull %0)
  %8 = getelementptr inbounds i8, ptr %0, i64 536
  store ptr null, ptr %8, align 8, !tbaa !14
  %9 = getelementptr inbounds i8, ptr %4, i64 84
  %10 = load i32, ptr %9, align 4, !tbaa !15
  %11 = icmp slt i32 %10, 1
  br i1 %11, label %60, label %12

12:                                               ; preds = %7
  %13 = getelementptr inbounds i8, ptr %5, i64 169
  %14 = load i8, ptr %13, align 1, !tbaa !17
  %.not = icmp eq i8 %14, 0
  br i1 %.not, label %15, label %52

15:                                               ; preds = %12
  %.not51 = icmp eq ptr %1, null
  br i1 %.not51, label %28, label %16

16:                                               ; preds = %15
  %17 = load ptr, ptr %1, align 8, !tbaa !24
  %18 = getelementptr inbounds i8, ptr %0, i64 432
  %19 = load ptr, ptr %18, align 8, !tbaa !25
  %20 = ptrtoint ptr %17 to i64
  %21 = ptrtoint ptr %19 to i64
  %22 = sub i64 %20, %21
  %23 = trunc i64 %22 to i32
  %24 = getelementptr inbounds i8, ptr %1, i64 8
  %25 = load i32, ptr %24, align 8, !tbaa !26
  %26 = add i32 %25, %23
  %27 = getelementptr inbounds i8, ptr %0, i64 440
  store i32 %26, ptr %27, align 8, !tbaa !27
  br label %28

28:                                               ; preds = %16, %15
  %29 = getelementptr inbounds i8, ptr %0, i64 432
  %30 = tail call ptr (ptr, ptr, ...) @sqlite3MPrintf(ptr noundef nonnull %5, ptr noundef nonnull @.str, ptr noundef nonnull %29) #2
  %31 = getelementptr inbounds i8, ptr %4, i64 112
  %32 = load ptr, ptr %31, align 8, !tbaa !28
  %33 = tail call i32 @sqlite3SchemaToIndex(ptr noundef nonnull %5, ptr noundef %32) #2
  %34 = getelementptr inbounds i8, ptr %5, i64 32
  %35 = load ptr, ptr %34, align 8, !tbaa !29
  %36 = sext i32 %33 to i64
  %37 = getelementptr inbounds %struct.Db, ptr %35, i64 %36
  %38 = load ptr, ptr %37, align 8, !tbaa !30
  %39 = load ptr, ptr %4, align 8, !tbaa !32
  %40 = getelementptr inbounds i8, ptr %0, i64 128
  %41 = load i32, ptr %40, align 8, !tbaa !33
  tail call void (ptr, ptr, ...) @sqlite3NestedParse(ptr noundef nonnull %0, ptr noundef nonnull @.str.1, ptr noundef %38, ptr noundef nonnull @.str.2, ptr noundef %39, ptr noundef %39, ptr noundef %30, i32 noundef %41) #2
  tail call void @sqlite3DbFree(ptr noundef nonnull %5, ptr noundef %30) #2
  %42 = tail call ptr @sqlite3GetVdbe(ptr noundef nonnull %0) #2
  tail call void @sqlite3ChangeCookie(ptr noundef nonnull %0, i32 noundef %33) #2
  %43 = tail call i32 @sqlite3VdbeAddOp0(ptr noundef %42, i32 noundef 151) #2
  %44 = load ptr, ptr %4, align 8, !tbaa !32
  %45 = tail call ptr (ptr, ptr, ...) @sqlite3MPrintf(ptr noundef nonnull %5, ptr noundef nonnull @.str.3, ptr noundef %44) #2
  tail call void @sqlite3VdbeAddParseSchemaOp(ptr noundef %42, i32 noundef %33, ptr noundef %45) #2
  %46 = getelementptr inbounds i8, ptr %0, i64 56
  %47 = load i32, ptr %46, align 8, !tbaa !34
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %46, align 8, !tbaa !34
  %49 = load ptr, ptr %4, align 8, !tbaa !32
  %50 = tail call i32 @sqlite3VdbeLoadString(ptr noundef %42, i32 noundef %48, ptr noundef %49) #2
  %51 = tail call i32 @sqlite3VdbeAddOp2(ptr noundef %42, i32 noundef 154, i32 noundef %33, i32 noundef %48) #2
  br label %60

52:                                               ; preds = %12
  %53 = getelementptr inbounds i8, ptr %4, i64 112
  %54 = load ptr, ptr %53, align 8, !tbaa !28
  %55 = load ptr, ptr %4, align 8, !tbaa !32
  %56 = getelementptr inbounds i8, ptr %54, i64 8
  %57 = tail call ptr @sqlite3HashInsert(ptr noundef nonnull %56, ptr noundef %55, ptr noundef nonnull %4) #2
  %.not52 = icmp eq ptr %57, null
  br i1 %.not52, label %59, label %58

58:                                               ; preds = %52
  tail call void @sqlite3OomFault(ptr noundef nonnull %5) #2
  br label %60

59:                                               ; preds = %52
  store ptr null, ptr %3, align 8, !tbaa !5
  br label %60

60:                                               ; preds = %58, %59, %28, %7, %2
  ret void
}

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

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

declare void @sqlite3NestedParse(ptr noundef, ptr noundef, ...) local_unnamed_addr #0

declare ptr @sqlite3GetVdbe(ptr noundef) local_unnamed_addr #0

declare void @sqlite3ChangeCookie(ptr noundef, i32 noundef) local_unnamed_addr #0

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

declare void @sqlite3VdbeAddParseSchemaOp(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

declare i32 @sqlite3VdbeLoadString(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

declare i32 @sqlite3VdbeAddOp2(ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { 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 512}
!6 = !{!"Parse", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !8, i64 28, !8, i64 29, !8, i64 30, !8, i64 31, !8, i64 32, !8, i64 33, !8, i64 34, !8, i64 35, !8, i64 36, !8, i64 37, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !7, i64 88, !7, i64 96, !11, i64 104, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !8, i64 192, !8, i64 193, !8, i64 194, !8, i64 196, !8, i64 396, !11, i64 432, !11, i64 448, !12, i64 464, !8, i64 466, !8, i64 467, !8, i64 468, !10, i64 472, !10, i64 476, !10, i64 480, !10, i64 484, !7, i64 488, !7, i64 496, !7, i64 504, !7, i64 512, !7, i64 520, !7, i64 528, !11, i64 536, !7, i64 552, !7, i64 560, !7, i64 568, !7, i64 576, !7, i64 584}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"Token", !7, i64 0, !10, i64 8}
!12 = !{!"short", !8, i64 0}
!13 = !{!6, !7, i64 0}
!14 = !{!6, !7, i64 536}
!15 = !{!16, !10, i64 84}
!16 = !{!"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}
!17 = !{!18, !8, i64 169}
!18 = !{!"sqlite3", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 44, !19, i64 48, !19, 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, !20, 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, !21, i64 344, !7, i64 400, !7, i64 408, !7, i64 416, !7, i64 424, !10, i64 432, !10, i64 436, !22, i64 440, !7, i64 464, !7, i64 472, !7, i64 480, !22, i64 488, !22, i64 512, !23, i64 536, !8, i64 560, !7, i64 624, !10, i64 632, !10, i64 636, !10, i64 640, !19, i64 648, !19, i64 656, !7, i64 664}
!19 = !{!"long long", !8, i64 0}
!20 = !{!"sqlite3InitInfo", !10, i64 0, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7}
!21 = !{!"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}
!22 = !{!"Hash", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 16}
!23 = !{!"BusyHandler", !7, i64 0, !7, i64 8, !10, i64 16}
!24 = !{!11, !7, i64 0}
!25 = !{!6, !7, i64 432}
!26 = !{!11, !10, i64 8}
!27 = !{!6, !10, i64 440}
!28 = !{!16, !7, i64 112}
!29 = !{!18, !7, i64 32}
!30 = !{!31, !7, i64 0}
!31 = !{!"Db", !7, i64 0, !7, i64 8, !8, i64 16, !8, i64 17, !7, i64 24}
!32 = !{!16, !7, i64 0}
!33 = !{!6, !10, i64 128}
!34 = !{!6, !10, i64 56}


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