; 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.Vdbe = type { ptr, ptr, ptr, i32, i32, ptr, i32, i32, ptr, ptr, ptr, ptr, i16, i16, ptr, i8, i8, i16, ptr, ptr, i32, i32, ptr, i32, i32, i32, ptr, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i64, %struct.BtreeMutexArray, [3 x i32], ptr, ptr, i64, i64, i32, ptr, i32, i32, ptr }
%struct.BtreeMutexArray = type { i32, [11 x ptr] }
%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 }

; 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 dso_local void @sqlite3_mutex_leave(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @sqlite3_reset(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @sqlite3_step(ptr noundef %0) #1 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #2
  store i32 0, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #2
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %11, ptr %6, align 8, !tbaa !5
  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
  %12 = load ptr, ptr %6, align 8, !tbaa !5
  %13 = call i32 @vdbeSafetyNotNull(ptr noundef %12)
  %14 = icmp ne i32 %13, 0
  br i1 %14, label %15, label %17

15:                                               ; preds = %1
  %16 = call i32 @sqlite3MisuseError(i32 noundef 58512)
  store i32 %16, ptr %2, align 4
  store i32 1, ptr %9, align 4
  br label %93

17:                                               ; preds = %1
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.Vdbe, ptr %18, i32 0, i32 0
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  store ptr %20, ptr %8, align 8, !tbaa !5
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.sqlite3, ptr %21, i32 0, i32 20
  %23 = load ptr, ptr %22, align 8, !tbaa !16
  call void @sqlite3_mutex_enter(ptr noundef %23)
  br label %24

24:                                               ; preds = %38, %17
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = call i32 @sqlite3Step(ptr noundef %25)
  store i32 %26, ptr %4, align 4, !tbaa !9
  %27 = icmp eq i32 %26, 17
  br i1 %27, label %28, label %36

28:                                               ; preds = %24
  %29 = load i32, ptr %7, align 4, !tbaa !9
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %7, align 4, !tbaa !9
  %31 = icmp slt i32 %29, 5
  br i1 %31, label %32, label %36

32:                                               ; preds = %28
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = call i32 @sqlite3Reprepare(ptr noundef %33)
  store i32 %34, ptr %4, align 4, !tbaa !9
  store i32 %34, ptr %5, align 4, !tbaa !9
  %35 = icmp eq i32 %34, 0
  br label %36

36:                                               ; preds = %32, %28, %24
  %37 = phi i1 [ false, %28 ], [ false, %24 ], [ %35, %32 ]
  br i1 %37, label %38, label %43

38:                                               ; preds = %36
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = call i32 @sqlite3_reset(ptr noundef %39)
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.Vdbe, ptr %41, i32 0, i32 29
  store i8 0, ptr %42, align 2, !tbaa !23
  br label %24, !llvm.loop !24

43:                                               ; preds = %36
  %44 = load i32, ptr %5, align 4, !tbaa !9
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %85

46:                                               ; preds = %43
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.Vdbe, ptr %47, i32 0, i32 35
  %49 = load i8, ptr %48, align 8, !tbaa !26
  %50 = zext i8 %49 to i32
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %85

52:                                               ; preds = %46
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.sqlite3, ptr %53, i32 0, i32 43
  %55 = load ptr, ptr %54, align 8, !tbaa !27
  %56 = icmp ne ptr %55, null
  br i1 %56, label %57, label %85

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #2
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.sqlite3, ptr %58, i32 0, i32 43
  %60 = load ptr, ptr %59, align 8, !tbaa !27
  %61 = call ptr @sqlite3_value_text(ptr noundef %60)
  store ptr %61, ptr %10, align 8, !tbaa !5
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.Vdbe, ptr %63, i32 0, i32 26
  %65 = load ptr, ptr %64, align 8, !tbaa !28
  call void @sqlite3DbFree(ptr noundef %62, ptr noundef %65)
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.sqlite3, ptr %66, i32 0, i32 9
  %68 = load i8, ptr %67, align 2, !tbaa !29
  %69 = icmp ne i8 %68, 0
  br i1 %69, label %79, label %70

70:                                               ; preds = %57
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = load ptr, ptr %10, align 8, !tbaa !5
  %73 = call ptr @sqlite3DbStrDup(ptr noundef %71, ptr noundef %72)
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.Vdbe, ptr %74, i32 0, i32 26
  store ptr %73, ptr %75, align 8, !tbaa !28
  %76 = load i32, ptr %5, align 4, !tbaa !9
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.Vdbe, ptr %77, i32 0, i32 25
  store i32 %76, ptr %78, align 8, !tbaa !30
  br label %84

79:                                               ; preds = %57
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.Vdbe, ptr %80, i32 0, i32 26
  store ptr null, ptr %81, align 8, !tbaa !28
  store i32 7, ptr %4, align 4, !tbaa !9
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.Vdbe, ptr %82, i32 0, i32 25
  store i32 7, ptr %83, align 8, !tbaa !30
  br label %84

84:                                               ; preds = %79, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #2
  br label %85

85:                                               ; preds = %84, %52, %46, %43
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = load i32, ptr %4, align 4, !tbaa !9
  %88 = call i32 @sqlite3ApiExit(ptr noundef %86, i32 noundef %87)
  store i32 %88, ptr %4, align 4, !tbaa !9
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.sqlite3, ptr %89, i32 0, i32 20
  %91 = load ptr, ptr %90, align 8, !tbaa !16
  call void @sqlite3_mutex_leave(ptr noundef %91)
  %92 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %92, ptr %2, align 4
  store i32 1, ptr %9, align 4
  br label %93

93:                                               ; preds = %85, %15
  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
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #2
  %94 = load i32, ptr %2, align 4
  ret i32 %94
}

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden ptr @sqlite3DbStrDup(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 0}
!12 = !{!"Vdbe", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !10, i64 28, !6, i64 32, !10, i64 40, !10, i64 44, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !13, i64 80, !13, i64 82, !6, i64 88, !7, i64 96, !7, i64 97, !13, i64 98, !6, i64 104, !6, i64 112, !10, i64 120, !10, i64 124, !6, i64 128, !10, i64 136, !10, i64 140, !10, i64 144, !6, i64 152, !7, i64 160, !7, i64 161, !7, i64 162, !7, i64 163, !7, i64 164, !7, i64 165, !7, i64 166, !7, i64 167, !7, i64 168, !10, i64 172, !10, i64 176, !14, i64 184, !15, i64 192, !7, i64 288, !6, i64 304, !6, i64 312, !14, i64 320, !14, i64 328, !10, i64 336, !6, i64 344, !10, i64 352, !10, i64 356, !6, i64 360}
!13 = !{!"short", !7, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = !{!"BtreeMutexArray", !10, i64 0, !7, i64 8}
!16 = !{!17, !6, i64 88}
!17 = !{!"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, !14, i64 64, !10, i64 72, !10, i64 76, !10, i64 80, !6, i64 88, !7, i64 96, !18, 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, !19, i64 336, !6, i64 376, !6, i64 384, !6, i64 392, !6, i64 400, !10, i64 408, !20, i64 416, !6, i64 440, !6, i64 448, !10, i64 456, !6, i64 464, !21, i64 472, !20, i64 656, !22, i64 680, !10, i64 704, !7, i64 712, !6, i64 776, !10, i64 784, !10, i64 788, !7, i64 792, !14, i64 800, !6, i64 808}
!18 = !{!"sqlite3InitInfo", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 9}
!19 = !{!"Lookaside", !13, i64 0, !7, i64 2, !7, i64 3, !10, i64 4, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!20 = !{!"Hash", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!21 = !{!"FuncDefHash", !7, i64 0}
!22 = !{!"BusyHandler", !6, i64 0, !6, i64 8, !10, i64 16}
!23 = !{!12, !7, i64 162}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!12, !7, i64 168}
!27 = !{!17, !6, i64 304}
!28 = !{!12, !6, i64 152}
!29 = !{!17, !7, i64 42}
!30 = !{!12, !10, i64 144}


; 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: nounwind uwtable
declare hidden i32 @sqlite3MisuseError(i32 noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @sqlite3_reset(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @sqlite3_value_text(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local i32 @sqlite3_step(ptr noundef %0) local_unnamed_addr #0 {
  %2 = tail call i32 @vdbeSafetyNotNull(ptr noundef %0)
  %.not = icmp eq i32 %2, 0
  br i1 %.not, label %5, label %3

3:                                                ; preds = %1
  %4 = tail call i32 @sqlite3MisuseError(i32 noundef 58512)
  br label %61

5:                                                ; preds = %1
  %6 = load ptr, ptr %0, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %6, i64 88
  %8 = load ptr, ptr %7, align 8, !tbaa !14
  tail call void @sqlite3_mutex_enter(ptr noundef %8)
  %9 = tail call i32 @sqlite3Step(ptr noundef nonnull %0)
  %10 = icmp eq i32 %9, 17
  br i1 %10, label %.lr.ph, label %.critedge.thread

.lr.ph:                                           ; preds = %5
  %11 = getelementptr inbounds i8, ptr %0, i64 162
  %12 = tail call i32 @sqlite3Reprepare(ptr noundef nonnull %0)
  %13 = icmp eq i32 %12, 0
  br i1 %13, label %14, label %.critedge

14:                                               ; preds = %.lr.ph
  %15 = tail call i32 @sqlite3_reset(ptr noundef nonnull %0)
  store i8 0, ptr %11, align 2, !tbaa !21
  %16 = tail call i32 @sqlite3Step(ptr noundef nonnull %0)
  %17 = icmp eq i32 %16, 17
  br i1 %17, label %18, label %.critedge.thread, !llvm.loop !22

18:                                               ; preds = %14
  %19 = tail call i32 @sqlite3Reprepare(ptr noundef nonnull %0)
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %21, label %.critedge

21:                                               ; preds = %18
  %22 = tail call i32 @sqlite3_reset(ptr noundef nonnull %0)
  store i8 0, ptr %11, align 2, !tbaa !21
  %23 = tail call i32 @sqlite3Step(ptr noundef nonnull %0)
  %24 = icmp eq i32 %23, 17
  br i1 %24, label %25, label %.critedge.thread, !llvm.loop !22

25:                                               ; preds = %21
  %26 = tail call i32 @sqlite3Reprepare(ptr noundef nonnull %0)
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %.critedge

28:                                               ; preds = %25
  %29 = tail call i32 @sqlite3_reset(ptr noundef nonnull %0)
  store i8 0, ptr %11, align 2, !tbaa !21
  %30 = tail call i32 @sqlite3Step(ptr noundef nonnull %0)
  %31 = icmp eq i32 %30, 17
  br i1 %31, label %32, label %.critedge.thread, !llvm.loop !22

32:                                               ; preds = %28
  %33 = tail call i32 @sqlite3Reprepare(ptr noundef nonnull %0)
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %35, label %.critedge

35:                                               ; preds = %32
  %36 = tail call i32 @sqlite3_reset(ptr noundef nonnull %0)
  store i8 0, ptr %11, align 2, !tbaa !21
  %37 = tail call i32 @sqlite3Step(ptr noundef nonnull %0)
  %38 = icmp eq i32 %37, 17
  br i1 %38, label %39, label %.critedge.thread, !llvm.loop !22

39:                                               ; preds = %35
  %40 = tail call i32 @sqlite3Reprepare(ptr noundef nonnull %0)
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %42, label %.critedge

42:                                               ; preds = %39
  %43 = tail call i32 @sqlite3_reset(ptr noundef nonnull %0)
  store i8 0, ptr %11, align 2, !tbaa !21
  %44 = tail call i32 @sqlite3Step(ptr noundef nonnull %0)
  br label %.critedge.thread, !llvm.loop !22

.critedge:                                        ; preds = %39, %32, %25, %18, %.lr.ph
  %.lcssa = phi i32 [ %12, %.lr.ph ], [ %19, %18 ], [ %26, %25 ], [ %33, %32 ], [ %40, %39 ]
  %45 = getelementptr inbounds i8, ptr %0, i64 168
  %46 = load i8, ptr %45, align 8, !tbaa !24
  %.not37 = icmp eq i8 %46, 0
  br i1 %.not37, label %.critedge.thread, label %47

47:                                               ; preds = %.critedge
  %48 = getelementptr inbounds i8, ptr %6, i64 304
  %49 = load ptr, ptr %48, align 8, !tbaa !25
  %.not38 = icmp eq ptr %49, null
  br i1 %.not38, label %.critedge.thread, label %50

50:                                               ; preds = %47
  %51 = tail call ptr @sqlite3_value_text(ptr noundef nonnull %49)
  %52 = getelementptr inbounds i8, ptr %0, i64 152
  %53 = load ptr, ptr %52, align 8, !tbaa !26
  tail call void @sqlite3DbFree(ptr noundef nonnull %6, ptr noundef %53)
  %54 = getelementptr inbounds i8, ptr %6, i64 42
  %55 = load i8, ptr %54, align 2, !tbaa !27
  %.not39 = icmp eq i8 %55, 0
  br i1 %.not39, label %56, label %.critedge.thread.sink.split

56:                                               ; preds = %50
  %57 = tail call ptr @sqlite3DbStrDup(ptr noundef nonnull %6, ptr noundef %51)
  br label %.critedge.thread.sink.split

.critedge.thread.sink.split:                      ; preds = %50, %56
  %.sink = phi ptr [ %57, %56 ], [ null, %50 ]
  %.lcssa.sink = phi i32 [ %.lcssa, %56 ], [ 7, %50 ]
  store ptr %.sink, ptr %52, align 8, !tbaa !26
  %58 = getelementptr inbounds i8, ptr %0, i64 144
  store i32 %.lcssa.sink, ptr %58, align 8, !tbaa !28
  br label %.critedge.thread

.critedge.thread:                                 ; preds = %42, %.critedge.thread.sink.split, %14, %21, %28, %35, %5, %47, %.critedge
  %.2 = phi i32 [ %.lcssa, %47 ], [ %.lcssa, %.critedge ], [ %9, %5 ], [ %16, %14 ], [ %23, %21 ], [ %30, %28 ], [ %37, %35 ], [ %44, %42 ], [ %.lcssa.sink, %.critedge.thread.sink.split ]
  %59 = tail call i32 @sqlite3ApiExit(ptr noundef nonnull %6, i32 noundef %.2)
  %60 = load ptr, ptr %7, align 8, !tbaa !14
  tail call void @sqlite3_mutex_leave(ptr noundef %60)
  br label %61

61:                                               ; preds = %.critedge.thread, %3
  %.0 = phi i32 [ %4, %3 ], [ %59, %.critedge.thread ]
  ret i32 %.0
}

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden ptr @sqlite3DbStrDup(ptr noundef, ptr noundef) local_unnamed_addr #0

attributes #0 = { 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" }

!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 = !{!"Vdbe", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 28, !7, i64 32, !10, i64 40, !10, i64 44, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !11, i64 80, !11, i64 82, !7, i64 88, !8, i64 96, !8, i64 97, !11, i64 98, !7, i64 104, !7, i64 112, !10, i64 120, !10, i64 124, !7, i64 128, !10, i64 136, !10, i64 140, !10, i64 144, !7, i64 152, !8, i64 160, !8, i64 161, !8, i64 162, !8, i64 163, !8, i64 164, !8, i64 165, !8, i64 166, !8, i64 167, !8, i64 168, !10, i64 172, !10, i64 176, !12, i64 184, !13, i64 192, !8, i64 288, !7, i64 304, !7, i64 312, !12, i64 320, !12, i64 328, !10, i64 336, !7, i64 344, !10, i64 352, !10, i64 356, !7, i64 360}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"short", !8, i64 0}
!12 = !{!"long long", !8, i64 0}
!13 = !{!"BtreeMutexArray", !10, i64 0, !8, i64 8}
!14 = !{!15, !7, i64 88}
!15 = !{!"sqlite3", !7, i64 0, !10, i64 8, !7, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !8, i64 40, !8, i64 41, !8, i64 42, !8, i64 43, !8, i64 44, !8, i64 45, !10, i64 48, !10, i64 52, !7, i64 56, !12, i64 64, !10, i64 72, !10, i64 76, !10, i64 80, !7, i64 88, !8, i64 96, !16, i64 140, !10, i64 152, !7, i64 160, !7, i64 168, !10, i64 176, !10, i64 180, !7, i64 184, !7, 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, !8, i64 328, !17, i64 336, !7, i64 376, !7, i64 384, !7, i64 392, !7, i64 400, !10, i64 408, !18, i64 416, !7, i64 440, !7, i64 448, !10, i64 456, !7, i64 464, !19, i64 472, !18, i64 656, !20, i64 680, !10, i64 704, !8, i64 712, !7, i64 776, !10, i64 784, !10, i64 788, !8, i64 792, !12, i64 800, !7, i64 808}
!16 = !{!"sqlite3InitInfo", !10, i64 0, !10, i64 4, !8, i64 8, !8, i64 9}
!17 = !{!"Lookaside", !11, i64 0, !8, i64 2, !8, i64 3, !10, i64 4, !10, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!18 = !{!"Hash", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 16}
!19 = !{!"FuncDefHash", !8, i64 0}
!20 = !{!"BusyHandler", !7, i64 0, !7, i64 8, !10, i64 16}
!21 = !{!6, !8, i64 162}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!6, !8, i64 168}
!25 = !{!15, !7, i64 304}
!26 = !{!6, !7, i64 152}
!27 = !{!15, !8, i64 42}
!28 = !{!6, !10, i64 144}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass