; LLVM IR from ElsevierSoftwareX/SOFTX-D-20-00016 :: GameplayFootball/src/libs/sqlite3 (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.sqlite3 = type { ptr, i32, ptr, i32, i32, i32, i32, i8, i8, i8, i8, i8, i8, i32, i32, ptr, i64, i32, i32, i32, ptr, [11 x i32], %struct.sqlite3InitInfo, i32, ptr, ptr, i32, i32, ptr, 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, %struct.Hash, ptr, ptr, i32, ptr, %struct.FuncDefHash, %struct.Hash, %struct.BusyHandler, i32, [2 x %struct.Db], ptr, i32, i32, i8, i64, ptr }
%struct.sqlite3InitInfo = type { i32, i32, i8, i8 }
%union.anon = type { double }
%struct.Lookaside = type { i16, i8, i8, i32, i32, ptr, ptr, ptr }
%struct.FuncDefHash = type { [23 x ptr] }
%struct.Hash = type { i32, i32, ptr, ptr }
%struct.BusyHandler = type { ptr, ptr, i32 }
%struct.Db = type { ptr, ptr, i8, i8, ptr }
%struct.Parse = type { ptr, i32, ptr, ptr, i8, i8, i8, i8, i8, i8, i8, [8 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, [10 x %struct.yColCache], i32, i32, i8, i8, i32, [12 x i32], i32, ptr, i32, i32, ptr, i32, ptr, ptr, i32, i32, i8, i8, i8, double, i32, i32, i32, ptr, ptr, i32, i32, ptr, i8, %struct.Token, %struct.Token, ptr, ptr, ptr, ptr, %struct.Token, i8, i32, ptr, i32, ptr, ptr }
%struct.yColCache = type { i32, i32, i8, i32, i32, i32 }
%struct.Token = type { ptr, i32 }
%struct.Table = type { ptr, i32, i32, ptr, ptr, i32, i32, ptr, i16, i8, i8, ptr, ptr, ptr, i32, ptr, i32, ptr, ptr, ptr, ptr }

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

; 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 i32 @sqlite3MisuseError(i32 noundef) #1

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden ptr @sqlite3DbMallocZero(ptr noundef, i32 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 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) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #2
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #2
  store ptr null, ptr %9, align 8, !tbaa !5
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.sqlite3, ptr %11, i32 0, i32 20
  %13 = load ptr, ptr %12, align 8, !tbaa !11
  call void @sqlite3_mutex_enter(ptr noundef %13)
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.sqlite3, ptr %14, i32 0, i32 54
  %16 = load ptr, ptr %15, align 8, !tbaa !20
  store ptr %16, ptr %8, align 8, !tbaa !5
  %17 = load ptr, ptr %8, align 8, !tbaa !5
  %18 = icmp ne ptr %17, null
  br i1 %18, label %25, label %19

19:                                               ; preds = %2
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @sqlite3Error(ptr noundef %20, i32 noundef 21, ptr noundef null)
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.sqlite3, ptr %21, i32 0, i32 20
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  call void @sqlite3_mutex_leave(ptr noundef %23)
  %24 = call i32 @sqlite3MisuseError(i32 noundef 94474)
  store i32 %24, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %132

25:                                               ; preds = %2
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = call ptr @sqlite3DbMallocZero(ptr noundef %26, i32 noundef 672)
  store ptr %27, ptr %6, align 8, !tbaa !5
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = icmp eq ptr %28, null
  br i1 %29, label %30, label %31

30:                                               ; preds = %25
  store i32 7, ptr %7, align 4, !tbaa !9
  br label %124

31:                                               ; preds = %25
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.Parse, ptr %32, i32 0, i32 60
  store i8 1, ptr %33, align 8, !tbaa !21
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.Parse, ptr %35, i32 0, i32 0
  store ptr %34, ptr %36, align 8, !tbaa !25
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.Parse, ptr %37, i32 0, i32 43
  store double 1.000000e+00, ptr %38, align 8, !tbaa !26
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = call i32 @sqlite3RunParser(ptr noundef %39, ptr noundef %40, ptr noundef %9)
  %42 = icmp eq i32 0, %41
  br i1 %42, label %43, label %100

43:                                               ; preds = %31
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.Parse, ptr %44, i32 0, i32 56
  %46 = load ptr, ptr %45, align 8, !tbaa !27
  %47 = icmp ne ptr %46, null
  br i1 %47, label %48, label %100

48:                                               ; preds = %43
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.sqlite3, ptr %49, i32 0, i32 9
  %51 = load i8, ptr %50, align 2, !tbaa !28
  %52 = icmp ne i8 %51, 0
  br i1 %52, label %100, label %53

53:                                               ; preds = %48
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.Parse, ptr %54, i32 0, i32 56
  %56 = load ptr, ptr %55, align 8, !tbaa !27
  %57 = getelementptr inbounds %struct.Table, ptr %56, i32 0, i32 7
  %58 = load ptr, ptr %57, align 8, !tbaa !29
  %59 = icmp ne ptr %58, null
  br i1 %59, label %100, label %60

60:                                               ; preds = %53
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.Parse, ptr %61, i32 0, i32 56
  %63 = load ptr, ptr %62, align 8, !tbaa !27
  %64 = getelementptr inbounds %struct.Table, ptr %63, i32 0, i32 9
  %65 = load i8, ptr %64, align 2, !tbaa !31
  %66 = zext i8 %65 to i32
  %67 = and i32 %66, 16
  %68 = icmp eq i32 %67, 0
  br i1 %68, label %69, label %100

69:                                               ; preds = %60
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.Table, ptr %70, i32 0, i32 3
  %72 = load ptr, ptr %71, align 8, !tbaa !32
  %73 = icmp ne ptr %72, null
  br i1 %73, label %97, label %74

74:                                               ; preds = %69
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.Parse, ptr %75, i32 0, i32 56
  %77 = load ptr, ptr %76, align 8, !tbaa !27
  %78 = getelementptr inbounds %struct.Table, ptr %77, i32 0, i32 3
  %79 = load ptr, ptr %78, align 8, !tbaa !32
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.Table, ptr %80, i32 0, i32 3
  store ptr %79, ptr %81, align 8, !tbaa !32
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.Parse, ptr %82, i32 0, i32 56
  %84 = load ptr, ptr %83, align 8, !tbaa !27
  %85 = getelementptr inbounds %struct.Table, ptr %84, i32 0, i32 2
  %86 = load i32, ptr %85, align 4, !tbaa !33
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.Table, ptr %87, i32 0, i32 2
  store i32 %86, ptr %88, align 4, !tbaa !33
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.Parse, ptr %89, i32 0, i32 56
  %91 = load ptr, ptr %90, align 8, !tbaa !27
  %92 = getelementptr inbounds %struct.Table, ptr %91, i32 0, i32 2
  store i32 0, ptr %92, align 4, !tbaa !33
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.Parse, ptr %93, i32 0, i32 56
  %95 = load ptr, ptr %94, align 8, !tbaa !27
  %96 = getelementptr inbounds %struct.Table, ptr %95, i32 0, i32 3
  store ptr null, ptr %96, align 8, !tbaa !32
  br label %97

97:                                               ; preds = %74, %69
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.sqlite3, ptr %98, i32 0, i32 54
  store ptr null, ptr %99, align 8, !tbaa !20
  br label %105

100:                                              ; preds = %60, %53, %48, %43, %31
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @sqlite3Error(ptr noundef %101, i32 noundef 1, ptr noundef %102)
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = load ptr, ptr %9, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef %103, ptr noundef %104)
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %105

105:                                              ; preds = %100, %97
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.Parse, ptr %106, i32 0, i32 60
  store i8 0, ptr %107, align 8, !tbaa !21
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.Parse, ptr %108, i32 0, i32 3
  %110 = load ptr, ptr %109, align 8, !tbaa !34
  %111 = icmp ne ptr %110, null
  br i1 %111, label %112, label %117

112:                                              ; preds = %105
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.Parse, ptr %113, i32 0, i32 3
  %115 = load ptr, ptr %114, align 8, !tbaa !34
  %116 = call i32 @sqlite3VdbeFinalize(ptr noundef %115)
  br label %117

117:                                              ; preds = %112, %105
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.Parse, ptr %119, i32 0, i32 56
  %121 = load ptr, ptr %120, align 8, !tbaa !27
  call void @sqlite3DeleteTable(ptr noundef %118, ptr noundef %121)
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef %122, ptr noundef %123)
  br label %124

124:                                              ; preds = %117, %30
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  %126 = load i32, ptr %7, align 4, !tbaa !9
  %127 = call i32 @sqlite3ApiExit(ptr noundef %125, i32 noundef %126)
  store i32 %127, ptr %7, align 4, !tbaa !9
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.sqlite3, ptr %128, i32 0, i32 20
  %130 = load ptr, ptr %129, align 8, !tbaa !11
  call void @sqlite3_mutex_leave(ptr noundef %130)
  %131 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %131, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %132

132:                                              ; preds = %124, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2
  %133 = load i32, ptr %3, align 4
  ret i32 %133
}

; Function Attrs: nounwind uwtable
declare hidden i32 @sqlite3RunParser(ptr noundef, ptr noundef, 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 = { 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 88}
!12 = !{!"sqlite3", !6, i64 0, !10, i64 8, !6, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !7, i64 40, !7, i64 41, !7, i64 42, !7, i64 43, !7, i64 44, !7, i64 45, !10, i64 48, !10, i64 52, !6, i64 56, !13, i64 64, !10, i64 72, !10, i64 76, !10, i64 80, !6, i64 88, !7, i64 96, !14, i64 140, !10, i64 152, !6, i64 160, !6, i64 168, !10, i64 176, !10, i64 180, !6, i64 184, !6, 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, !7, i64 328, !15, i64 336, !6, i64 376, !6, i64 384, !6, i64 392, !6, i64 400, !10, i64 408, !17, i64 416, !6, i64 440, !6, i64 448, !10, i64 456, !6, i64 464, !18, i64 472, !17, i64 656, !19, i64 680, !10, i64 704, !7, i64 712, !6, i64 776, !10, i64 784, !10, i64 788, !7, i64 792, !13, i64 800, !6, i64 808}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"sqlite3InitInfo", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 9}
!15 = !{!"Lookaside", !16, i64 0, !7, i64 2, !7, i64 3, !10, i64 4, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!16 = !{!"short", !7, i64 0}
!17 = !{!"Hash", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!18 = !{!"FuncDefHash", !7, i64 0}
!19 = !{!"BusyHandler", !6, i64 0, !6, i64 8, !10, i64 16}
!20 = !{!12, !6, i64 440}
!21 = !{!22, !7, i64 632}
!22 = !{!"Parse", !6, i64 0, !10, i64 8, !6, i64 16, !6, i64 24, !7, i64 32, !7, i64 33, !7, i64 34, !7, i64 35, !7, i64 36, !7, i64 37, !7, i64 38, !7, i64 40, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !7, i64 108, !7, i64 109, !7, i64 112, !10, i64 352, !10, i64 356, !7, i64 360, !7, i64 361, !10, i64 364, !7, i64 368, !10, i64 416, !6, i64 424, !10, i64 432, !10, i64 436, !6, i64 440, !10, i64 448, !6, i64 456, !6, i64 464, !10, i64 472, !10, i64 476, !7, i64 480, !7, i64 481, !7, i64 482, !23, i64 488, !10, i64 496, !10, i64 500, !10, i64 504, !6, i64 512, !6, i64 520, !10, i64 528, !10, i64 532, !6, i64 536, !7, i64 544, !24, i64 552, !24, i64 568, !6, i64 584, !6, i64 592, !6, i64 600, !6, i64 608, !24, i64 616, !7, i64 632, !10, i64 636, !6, i64 640, !10, i64 648, !6, i64 656, !6, i64 664}
!23 = !{!"double", !7, i64 0}
!24 = !{!"Token", !6, i64 0, !10, i64 8}
!25 = !{!22, !6, i64 0}
!26 = !{!22, !23, i64 488}
!27 = !{!22, !6, i64 592}
!28 = !{!12, !7, i64 42}
!29 = !{!30, !6, i64 40}
!30 = !{!"Table", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24, !10, i64 32, !10, i64 36, !6, i64 40, !16, i64 48, !7, i64 50, !7, i64 51, !6, i64 56, !6, i64 64, !6, i64 72, !10, i64 80, !6, i64 88, !10, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128}
!31 = !{!30, !7, i64 50}
!32 = !{!30, !6, i64 16}
!33 = !{!30, !10, i64 12}
!34 = !{!22, !6, i64 24}


; 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"

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

; 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 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 hidden void @sqlite3DeleteTable(ptr noundef, 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: nounwind uwtable
declare hidden void @sqlite3Error(ptr noundef, i32 noundef, ptr 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: nounwind uwtable
declare hidden void @sqlite3DbFree(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden ptr @sqlite3DbMallocZero(ptr noundef, i32 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
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #2
  store ptr null, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 88
  %5 = load ptr, ptr %4, align 8, !tbaa !9
  tail call void @sqlite3_mutex_enter(ptr noundef %5)
  %6 = getelementptr inbounds i8, ptr %0, i64 440
  %7 = load ptr, ptr %6, align 8, !tbaa !19
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %8, label %11

8:                                                ; preds = %2
  tail call void (ptr, i32, ptr, ...) @sqlite3Error(ptr noundef nonnull %0, i32 noundef 21, ptr noundef null)
  %9 = load ptr, ptr %4, align 8, !tbaa !9
  tail call void @sqlite3_mutex_leave(ptr noundef %9)
  %10 = tail call i32 @sqlite3MisuseError(i32 noundef 94474)
  br label %57

11:                                               ; preds = %2
  %12 = tail call ptr @sqlite3DbMallocZero(ptr noundef nonnull %0, i32 noundef 672)
  %13 = icmp eq ptr %12, null
  br i1 %13, label %54, label %14

14:                                               ; preds = %11
  %15 = getelementptr inbounds i8, ptr %12, i64 632
  store i8 1, ptr %15, align 8, !tbaa !20
  store ptr %0, ptr %12, align 8, !tbaa !24
  %16 = getelementptr inbounds i8, ptr %12, i64 488
  store double 1.000000e+00, ptr %16, align 8, !tbaa !25
  %17 = call i32 @sqlite3RunParser(ptr noundef nonnull %12, ptr noundef %1, ptr noundef nonnull %3)
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %19, label %43

19:                                               ; preds = %14
  %20 = getelementptr inbounds i8, ptr %12, i64 592
  %21 = load ptr, ptr %20, align 8, !tbaa !26
  %.not43 = icmp eq ptr %21, null
  br i1 %.not43, label %43, label %22

22:                                               ; preds = %19
  %23 = getelementptr inbounds i8, ptr %0, i64 42
  %24 = load i8, ptr %23, align 2, !tbaa !27
  %.not44 = icmp eq i8 %24, 0
  br i1 %.not44, label %25, label %43

25:                                               ; preds = %22
  %26 = getelementptr inbounds i8, ptr %21, i64 40
  %27 = load ptr, ptr %26, align 8, !tbaa !28
  %.not45 = icmp eq ptr %27, null
  br i1 %.not45, label %28, label %43

28:                                               ; preds = %25
  %29 = getelementptr inbounds i8, ptr %21, i64 50
  %30 = load i8, ptr %29, align 2, !tbaa !30
  %31 = and i8 %30, 16
  %32 = icmp eq i8 %31, 0
  br i1 %32, label %33, label %43

33:                                               ; preds = %28
  %34 = getelementptr inbounds i8, ptr %7, i64 16
  %35 = load ptr, ptr %34, align 8, !tbaa !31
  %.not46 = icmp eq ptr %35, null
  br i1 %.not46, label %36, label %42

36:                                               ; preds = %33
  %37 = getelementptr inbounds i8, ptr %21, i64 16
  %38 = load ptr, ptr %37, align 8, !tbaa !31
  store ptr %38, ptr %34, align 8, !tbaa !31
  %39 = getelementptr inbounds i8, ptr %21, i64 12
  %40 = load i32, ptr %39, align 4, !tbaa !32
  %41 = getelementptr inbounds i8, ptr %7, i64 12
  store i32 %40, ptr %41, align 4, !tbaa !32
  store i32 0, ptr %39, align 4, !tbaa !32
  store ptr null, ptr %37, align 8, !tbaa !31
  br label %42

42:                                               ; preds = %36, %33
  store ptr null, ptr %6, align 8, !tbaa !19
  br label %46

43:                                               ; preds = %28, %25, %22, %19, %14
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @sqlite3Error(ptr noundef nonnull %0, i32 noundef 1, ptr noundef %44)
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef nonnull %0, ptr noundef %45)
  br label %46

46:                                               ; preds = %43, %42
  %.038 = phi i32 [ 1, %43 ], [ 0, %42 ]
  store i8 0, ptr %15, align 8, !tbaa !20
  %47 = getelementptr inbounds i8, ptr %12, i64 24
  %48 = load ptr, ptr %47, align 8, !tbaa !33
  %.not47 = icmp eq ptr %48, null
  br i1 %.not47, label %51, label %49

49:                                               ; preds = %46
  %50 = call i32 @sqlite3VdbeFinalize(ptr noundef nonnull %48)
  br label %51

51:                                               ; preds = %49, %46
  %52 = getelementptr inbounds i8, ptr %12, i64 592
  %53 = load ptr, ptr %52, align 8, !tbaa !26
  call void @sqlite3DeleteTable(ptr noundef nonnull %0, ptr noundef %53)
  call void @sqlite3DbFree(ptr noundef nonnull %0, ptr noundef nonnull %12)
  br label %54

54:                                               ; preds = %11, %51
  %.1 = phi i32 [ %.038, %51 ], [ 7, %11 ]
  %55 = call i32 @sqlite3ApiExit(ptr noundef nonnull %0, i32 noundef %.1)
  %56 = load ptr, ptr %4, align 8, !tbaa !9
  call void @sqlite3_mutex_leave(ptr noundef %56)
  br label %57

57:                                               ; preds = %54, %8
  %.0 = phi i32 [ %55, %54 ], [ %10, %8 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #2
  ret i32 %.0
}

; Function Attrs: nounwind uwtable
declare hidden i32 @sqlite3RunParser(ptr noundef, ptr noundef, 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 = { 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 88}
!10 = !{!"sqlite3", !6, i64 0, !11, i64 8, !6, i64 16, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !7, i64 40, !7, i64 41, !7, i64 42, !7, i64 43, !7, i64 44, !7, i64 45, !11, i64 48, !11, i64 52, !6, i64 56, !12, i64 64, !11, i64 72, !11, i64 76, !11, i64 80, !6, i64 88, !7, i64 96, !13, i64 140, !11, i64 152, !6, i64 160, !6, i64 168, !11, i64 176, !11, i64 180, !6, i64 184, !6, 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, !7, i64 328, !14, i64 336, !6, i64 376, !6, i64 384, !6, i64 392, !6, i64 400, !11, i64 408, !16, i64 416, !6, i64 440, !6, i64 448, !11, i64 456, !6, i64 464, !17, i64 472, !16, i64 656, !18, i64 680, !11, i64 704, !7, i64 712, !6, i64 776, !11, i64 784, !11, i64 788, !7, i64 792, !12, i64 800, !6, i64 808}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"sqlite3InitInfo", !11, i64 0, !11, i64 4, !7, i64 8, !7, i64 9}
!14 = !{!"Lookaside", !15, i64 0, !7, i64 2, !7, i64 3, !11, i64 4, !11, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!15 = !{!"short", !7, i64 0}
!16 = !{!"Hash", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16}
!17 = !{!"FuncDefHash", !7, i64 0}
!18 = !{!"BusyHandler", !6, i64 0, !6, i64 8, !11, i64 16}
!19 = !{!10, !6, i64 440}
!20 = !{!21, !7, i64 632}
!21 = !{!"Parse", !6, i64 0, !11, i64 8, !6, i64 16, !6, i64 24, !7, i64 32, !7, i64 33, !7, i64 34, !7, i64 35, !7, i64 36, !7, i64 37, !7, i64 38, !7, i64 40, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !7, i64 108, !7, i64 109, !7, i64 112, !11, i64 352, !11, i64 356, !7, i64 360, !7, i64 361, !11, i64 364, !7, i64 368, !11, i64 416, !6, i64 424, !11, i64 432, !11, i64 436, !6, i64 440, !11, i64 448, !6, i64 456, !6, i64 464, !11, i64 472, !11, i64 476, !7, i64 480, !7, i64 481, !7, i64 482, !22, i64 488, !11, i64 496, !11, i64 500, !11, i64 504, !6, i64 512, !6, i64 520, !11, i64 528, !11, i64 532, !6, i64 536, !7, i64 544, !23, i64 552, !23, i64 568, !6, i64 584, !6, i64 592, !6, i64 600, !6, i64 608, !23, i64 616, !7, i64 632, !11, i64 636, !6, i64 640, !11, i64 648, !6, i64 656, !6, i64 664}
!22 = !{!"double", !7, i64 0}
!23 = !{!"Token", !6, i64 0, !11, i64 8}
!24 = !{!21, !6, i64 0}
!25 = !{!21, !22, i64 488}
!26 = !{!21, !6, i64 592}
!27 = !{!10, !7, i64 42}
!28 = !{!29, !6, i64 40}
!29 = !{!"Table", !6, i64 0, !11, i64 8, !11, i64 12, !6, i64 16, !6, i64 24, !11, i64 32, !11, i64 36, !6, i64 40, !15, i64 48, !7, i64 50, !7, i64 51, !6, i64 56, !6, i64 64, !6, i64 72, !11, i64 80, !6, i64 88, !11, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128}
!30 = !{!29, !7, i64 50}
!31 = !{!29, !6, i64 16}
!32 = !{!29, !11, i64 12}
!33 = !{!21, !6, i64 24}


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