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

@.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
declare hidden void @addModuleArgument(ptr noundef, ptr noundef, ptr noundef) #2

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

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

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

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

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

22:                                               ; preds = %2
  store i32 1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %107

23:                                               ; preds = %2
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.sqlite3_module, ptr %24, i32 0, i32 1
  %26 = load ptr, ptr %25, align 8, !tbaa !17
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %37

28:                                               ; preds = %23
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.sqlite3_module, ptr %29, i32 0, i32 1
  %31 = load ptr, ptr %30, align 8, !tbaa !17
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.sqlite3_module, ptr %32, i32 0, i32 2
  %34 = load ptr, ptr %33, align 8, !tbaa !19
  %35 = icmp ne ptr %31, %34
  br i1 %35, label %36, label %37

36:                                               ; preds = %28
  store i32 0, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %107

37:                                               ; preds = %28, %23
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = call ptr @sqlite3DbMallocZero(ptr noundef %38, i64 noundef 128)
  store ptr %39, ptr %7, align 8, !tbaa !5
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %43

42:                                               ; preds = %37
  store i32 0, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %107

43:                                               ; preds = %37
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.Module, ptr %45, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !20
  %48 = call ptr @sqlite3DbStrDup(ptr noundef %44, ptr noundef %47)
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.Table, ptr %49, i32 0, i32 0
  store ptr %48, ptr %50, align 8, !tbaa !21
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.Table, ptr %51, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8, !tbaa !21
  %54 = icmp eq ptr %53, null
  br i1 %54, label %55, label %58

55:                                               ; preds = %43
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef %56, ptr noundef %57)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %107

58:                                               ; preds = %43
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.Module, ptr %60, i32 0, i32 4
  store ptr %59, ptr %61, align 8, !tbaa !16
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.Table, ptr %62, i32 0, i32 8
  store i32 1, ptr %63, align 4, !tbaa !23
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.sqlite3, ptr %64, i32 0, i32 4
  %66 = load ptr, ptr %65, align 8, !tbaa !24
  %67 = getelementptr inbounds %struct.Db, ptr %66, i64 0
  %68 = getelementptr inbounds %struct.Db, ptr %67, i32 0, i32 4
  %69 = load ptr, ptr %68, align 8, !tbaa !31
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.Table, ptr %70, i32 0, i32 20
  store ptr %69, ptr %71, align 8, !tbaa !33
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.Table, ptr %72, i32 0, i32 10
  store i16 -1, ptr %73, align 4, !tbaa !34
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.Table, ptr %77, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8, !tbaa !21
  %80 = call ptr @sqlite3DbStrDup(ptr noundef %76, ptr noundef %79)
  call void @addModuleArgument(ptr noundef %74, ptr noundef %75, ptr noundef %80)
  %81 = load ptr, ptr %10, align 8, !tbaa !5
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  call void @addModuleArgument(ptr noundef %81, ptr noundef %82, ptr noundef null)
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.Table, ptr %86, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8, !tbaa !21
  %89 = call ptr @sqlite3DbStrDup(ptr noundef %85, ptr noundef %88)
  call void @addModuleArgument(ptr noundef %83, ptr noundef %84, ptr noundef %89)
  %90 = load ptr, ptr %10, align 8, !tbaa !5
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.sqlite3_module, ptr %93, i32 0, i32 2
  %95 = load ptr, ptr %94, align 8, !tbaa !19
  %96 = call i32 @vtabCallConstructor(ptr noundef %90, ptr noundef %91, ptr noundef %92, ptr noundef %95, ptr noundef %8)
  store i32 %96, ptr %9, align 4, !tbaa !35
  %97 = load i32, ptr %9, align 4, !tbaa !35
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %106

99:                                               ; preds = %58
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  call void (ptr, ptr, ...) @sqlite3ErrorMsg(ptr noundef %100, ptr noundef @.str.5, ptr noundef %101)
  %102 = load ptr, ptr %10, align 8, !tbaa !5
  %103 = load ptr, ptr %8, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef %102, ptr noundef %103)
  %104 = load ptr, ptr %10, align 8, !tbaa !5
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sqlite3VtabEponymousTableClear(ptr noundef %104, ptr noundef %105)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %107

106:                                              ; preds = %58
  store i32 1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %107

107:                                              ; preds = %106, %99, %55, %42, %36, %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, 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
  %108 = load i32, ptr %3, align 4
  ret i32 %108
}

; Function Attrs: nounwind uwtable
declare dso_local void @sqlite3VtabEponymousTableClear(ptr noundef, ptr noundef) #2

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


; 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
declare hidden void @addModuleArgument(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @sqlite3VtabEponymousTableInit(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca ptr, align 8
  %4 = load ptr, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  store ptr null, ptr %3, align 8, !tbaa !10
  %5 = load ptr, ptr %0, align 8, !tbaa !11
  %6 = getelementptr inbounds i8, ptr %1, i64 32
  %7 = load ptr, ptr %6, align 8, !tbaa !16
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %8, label %40

8:                                                ; preds = %2
  %9 = getelementptr inbounds i8, ptr %4, i64 8
  %10 = load ptr, ptr %9, align 8, !tbaa !17
  %.not41 = icmp eq ptr %10, null
  br i1 %.not41, label %14, label %11

11:                                               ; preds = %8
  %12 = getelementptr inbounds i8, ptr %4, i64 16
  %13 = load ptr, ptr %12, align 8, !tbaa !19
  %.not42 = icmp eq ptr %10, %13
  br i1 %.not42, label %14, label %40

14:                                               ; preds = %11, %8
  %15 = tail call ptr @sqlite3DbMallocZero(ptr noundef %5, i64 noundef 128) #3
  %16 = icmp eq ptr %15, null
  br i1 %16, label %40, label %17

17:                                               ; preds = %14
  %18 = getelementptr inbounds i8, ptr %1, i64 8
  %19 = load ptr, ptr %18, align 8, !tbaa !20
  %20 = tail call ptr @sqlite3DbStrDup(ptr noundef %5, ptr noundef %19) #3
  store ptr %20, ptr %15, align 8, !tbaa !21
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %23

22:                                               ; preds = %17
  tail call void @sqlite3DbFree(ptr noundef %5, ptr noundef nonnull %15) #3
  br label %40

23:                                               ; preds = %17
  store ptr %15, ptr %6, align 8, !tbaa !16
  %24 = getelementptr inbounds i8, ptr %15, i64 60
  store i32 1, ptr %24, align 4, !tbaa !23
  %25 = getelementptr inbounds i8, ptr %5, i64 32
  %26 = load ptr, ptr %25, align 8, !tbaa !24
  %27 = getelementptr inbounds i8, ptr %26, i64 24
  %28 = load ptr, ptr %27, align 8, !tbaa !31
  %29 = getelementptr inbounds i8, ptr %15, i64 112
  store ptr %28, ptr %29, align 8, !tbaa !33
  %30 = getelementptr inbounds i8, ptr %15, i64 68
  store i16 -1, ptr %30, align 4, !tbaa !34
  %31 = tail call ptr @sqlite3DbStrDup(ptr noundef %5, ptr noundef nonnull %20) #3
  tail call void @addModuleArgument(ptr noundef %5, ptr noundef nonnull %15, ptr noundef %31)
  tail call void @addModuleArgument(ptr noundef %5, ptr noundef nonnull %15, ptr noundef null)
  %32 = load ptr, ptr %15, align 8, !tbaa !21
  %33 = tail call ptr @sqlite3DbStrDup(ptr noundef %5, ptr noundef %32) #3
  tail call void @addModuleArgument(ptr noundef %5, ptr noundef nonnull %15, ptr noundef %33)
  %34 = getelementptr inbounds i8, ptr %4, i64 16
  %35 = load ptr, ptr %34, align 8, !tbaa !19
  %36 = call i32 @vtabCallConstructor(ptr noundef %5, ptr noundef nonnull %15, ptr noundef nonnull %1, ptr noundef %35, ptr noundef nonnull %3)
  %.not43 = icmp eq i32 %36, 0
  br i1 %.not43, label %40, label %37

37:                                               ; preds = %23
  %38 = load ptr, ptr %3, align 8, !tbaa !10
  call void (ptr, ptr, ...) @sqlite3ErrorMsg(ptr noundef nonnull %0, ptr noundef nonnull @.str.5, ptr noundef %38) #3
  %39 = load ptr, ptr %3, align 8, !tbaa !10
  call void @sqlite3DbFree(ptr noundef nonnull %5, ptr noundef %39) #3
  call void @sqlite3VtabEponymousTableClear(ptr noundef nonnull %5, ptr noundef nonnull %1)
  br label %40

40:                                               ; preds = %23, %14, %11, %2, %37, %22
  %.0 = phi i32 [ 0, %22 ], [ 0, %37 ], [ 1, %2 ], [ 0, %11 ], [ 0, %14 ], [ 1, %23 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  ret i32 %.0
}

; Function Attrs: nounwind uwtable
declare dso_local void @sqlite3VtabEponymousTableClear(ptr noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"Module", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!7, !7, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"Parse", !7, i64 0, !7, i64 8, !7, i64 16, !13, 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, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68, !13, i64 72, !13, i64 76, !13, i64 80, !13, i64 84, !7, i64 88, !7, i64 96, !14, i64 104, !13, i64 120, !13, i64 124, !13, i64 128, !13, i64 132, !13, i64 136, !13, i64 140, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !13, i64 176, !13, i64 180, !13, i64 184, !13, i64 188, !8, i64 192, !8, i64 193, !8, i64 194, !8, i64 196, !8, i64 396, !14, i64 432, !14, i64 448, !15, i64 464, !8, i64 466, !8, i64 467, !8, i64 468, !13, i64 472, !13, i64 476, !13, i64 480, !13, i64 484, !7, i64 488, !7, i64 496, !7, i64 504, !7, i64 512, !7, i64 520, !7, i64 528, !14, i64 536, !7, i64 552, !7, i64 560, !7, i64 568, !7, i64 576, !7, i64 584}
!13 = !{!"int", !8, i64 0}
!14 = !{!"Token", !7, i64 0, !13, i64 8}
!15 = !{!"short", !8, i64 0}
!16 = !{!6, !7, i64 32}
!17 = !{!18, !7, i64 8}
!18 = !{!"sqlite3_module", !13, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176}
!19 = !{!18, !7, i64 16}
!20 = !{!6, !7, i64 8}
!21 = !{!22, !7, i64 0}
!22 = !{!"Table", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !13, i64 56, !13, i64 60, !13, i64 64, !15, i64 68, !15, i64 70, !15, i64 72, !15, i64 74, !8, i64 76, !13, i64 80, !13, i64 84, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120}
!23 = !{!22, !13, i64 60}
!24 = !{!25, !7, i64 32}
!25 = !{!"sqlite3", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !13, i64 40, !13, i64 44, !26, i64 48, !26, i64 56, !13, i64 64, !13, i64 68, !13, i64 72, !13, i64 76, !15, 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, !13, i64 96, !13, i64 100, !13, i64 104, !13, i64 108, !8, i64 112, !13, i64 160, !27, i64 164, !13, i64 172, !13, i64 176, !13, i64 180, !13, i64 184, !13, i64 188, !13, 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, !28, i64 344, !7, i64 400, !7, i64 408, !7, i64 416, !7, i64 424, !13, i64 432, !13, i64 436, !29, i64 440, !7, i64 464, !7, i64 472, !7, i64 480, !29, i64 488, !29, i64 512, !30, i64 536, !8, i64 560, !7, i64 624, !13, i64 632, !13, i64 636, !13, i64 640, !26, i64 648, !26, i64 656, !7, i64 664}
!26 = !{!"long long", !8, i64 0}
!27 = !{!"sqlite3InitInfo", !13, i64 0, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7}
!28 = !{!"Lookaside", !13, i64 0, !15, i64 4, !8, i64 6, !13, i64 8, !13, i64 12, !8, i64 16, !7, i64 32, !7, i64 40, !7, i64 48}
!29 = !{!"Hash", !13, i64 0, !13, i64 4, !7, i64 8, !7, i64 16}
!30 = !{!"BusyHandler", !7, i64 0, !7, i64 8, !13, i64 16}
!31 = !{!32, !7, i64 24}
!32 = !{!"Db", !7, i64 0, !7, i64 8, !8, i64 16, !8, i64 17, !7, i64 24}
!33 = !{!22, !7, i64 112}
!34 = !{!22, !15, i64 68}


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