; LLVM IR from ibr-ds/STANlite :: Enclave/sqlite (build)

; 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.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.TableLock = type { i32, i32, i8, ptr }

; Function Attrs: nounwind uwtable
define dso_local void @sqlite3TableLock(ptr noundef %0, i32 noundef %1, i32 noundef %2, i8 noundef zeroext %3, ptr noundef %4) #0 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i8, align 1
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i8 %3, ptr %9, align 1, !tbaa !11
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.Parse, ptr %16, i32 0, i32 37
  %18 = load ptr, ptr %17, align 8, !tbaa !12
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %24

20:                                               ; preds = %5
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.Parse, ptr %21, i32 0, i32 37
  %23 = load ptr, ptr %22, align 8, !tbaa !12
  br label %26

24:                                               ; preds = %5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %24, %20
  %27 = phi ptr [ %23, %20 ], [ %25, %24 ]
  store ptr %27, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %28 = load i32, ptr %7, align 4, !tbaa !9
  %29 = icmp eq i32 %28, 1
  br i1 %29, label %30, label %31

30:                                               ; preds = %26
  store i32 1, ptr %15, align 4
  br label %142

31:                                               ; preds = %26
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.Parse, ptr %32, i32 0, i32 0
  %34 = load ptr, ptr %33, align 8, !tbaa !16
  %35 = getelementptr inbounds %struct.sqlite3, ptr %34, i32 0, i32 4
  %36 = load ptr, ptr %35, align 8, !tbaa !17
  %37 = load i32, ptr %7, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds %struct.Db, ptr %36, i64 %38
  %40 = getelementptr inbounds %struct.Db, ptr %39, i32 0, i32 1
  %41 = load ptr, ptr %40, align 8, !tbaa !24
  %42 = call i32 @sqlite3BtreeSharable(ptr noundef %41)
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %45, label %44

44:                                               ; preds = %31
  store i32 1, ptr %15, align 4
  br label %142

45:                                               ; preds = %31
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %87, %45
  %47 = load i32, ptr %12, align 4, !tbaa !9
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.Parse, ptr %48, i32 0, i32 34
  %50 = load i32, ptr %49, align 4, !tbaa !26
  %51 = icmp slt i32 %47, %50
  br i1 %51, label %52, label %90

52:                                               ; preds = %46
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.Parse, ptr %53, i32 0, i32 35
  %55 = load ptr, ptr %54, align 8, !tbaa !27
  %56 = load i32, ptr %12, align 4, !tbaa !9
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds %struct.TableLock, ptr %55, i64 %57
  store ptr %58, ptr %14, align 8, !tbaa !5
  %59 = load ptr, ptr %14, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.TableLock, ptr %59, i32 0, i32 0
  %61 = load i32, ptr %60, align 8, !tbaa !28
  %62 = load i32, ptr %7, align 4, !tbaa !9
  %63 = icmp eq i32 %61, %62
  br i1 %63, label %64, label %86

64:                                               ; preds = %52
  %65 = load ptr, ptr %14, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.TableLock, ptr %65, i32 0, i32 1
  %67 = load i32, ptr %66, align 4, !tbaa !30
  %68 = load i32, ptr %8, align 4, !tbaa !9
  %69 = icmp eq i32 %67, %68
  br i1 %69, label %70, label %86

70:                                               ; preds = %64
  %71 = load ptr, ptr %14, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.TableLock, ptr %71, i32 0, i32 2
  %73 = load i8, ptr %72, align 8, !tbaa !31
  %74 = zext i8 %73 to i32
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %80, label %76

76:                                               ; preds = %70
  %77 = load i8, ptr %9, align 1, !tbaa !11
  %78 = zext i8 %77 to i32
  %79 = icmp ne i32 %78, 0
  br label %80

80:                                               ; preds = %76, %70
  %81 = phi i1 [ true, %70 ], [ %79, %76 ]
  %82 = zext i1 %81 to i32
  %83 = trunc i32 %82 to i8
  %84 = load ptr, ptr %14, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.TableLock, ptr %84, i32 0, i32 2
  store i8 %83, ptr %85, align 8, !tbaa !31
  store i32 1, ptr %15, align 4
  br label %142

86:                                               ; preds = %64, %52
  br label %87

87:                                               ; preds = %86
  %88 = load i32, ptr %12, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %12, align 4, !tbaa !9
  br label %46, !llvm.loop !32

90:                                               ; preds = %46
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.Parse, ptr %91, i32 0, i32 34
  %93 = load i32, ptr %92, align 4, !tbaa !26
  %94 = add nsw i32 %93, 1
  %95 = sext i32 %94 to i64
  %96 = mul i64 24, %95
  %97 = trunc i64 %96 to i32
  store i32 %97, ptr %13, align 4, !tbaa !9
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.Parse, ptr %98, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8, !tbaa !16
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.Parse, ptr %101, i32 0, i32 35
  %103 = load ptr, ptr %102, align 8, !tbaa !27
  %104 = load i32, ptr %13, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = call ptr @sqlite3DbReallocOrFree(ptr noundef %100, ptr noundef %103, i64 noundef %105)
  %107 = load ptr, ptr %11, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.Parse, ptr %107, i32 0, i32 35
  store ptr %106, ptr %108, align 8, !tbaa !27
  %109 = load ptr, ptr %11, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.Parse, ptr %109, i32 0, i32 35
  %111 = load ptr, ptr %110, align 8, !tbaa !27
  %112 = icmp ne ptr %111, null
  br i1 %112, label %113, label %135

113:                                              ; preds = %90
  %114 = load ptr, ptr %11, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.Parse, ptr %114, i32 0, i32 35
  %116 = load ptr, ptr %115, align 8, !tbaa !27
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.Parse, ptr %117, i32 0, i32 34
  %119 = load i32, ptr %118, align 4, !tbaa !26
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %118, align 4, !tbaa !26
  %121 = sext i32 %119 to i64
  %122 = getelementptr inbounds %struct.TableLock, ptr %116, i64 %121
  store ptr %122, ptr %14, align 8, !tbaa !5
  %123 = load i32, ptr %7, align 4, !tbaa !9
  %124 = load ptr, ptr %14, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.TableLock, ptr %124, i32 0, i32 0
  store i32 %123, ptr %125, align 8, !tbaa !28
  %126 = load i32, ptr %8, align 4, !tbaa !9
  %127 = load ptr, ptr %14, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.TableLock, ptr %127, i32 0, i32 1
  store i32 %126, ptr %128, align 4, !tbaa !30
  %129 = load i8, ptr %9, align 1, !tbaa !11
  %130 = load ptr, ptr %14, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.TableLock, ptr %130, i32 0, i32 2
  store i8 %129, ptr %131, align 8, !tbaa !31
  %132 = load ptr, ptr %10, align 8, !tbaa !5
  %133 = load ptr, ptr %14, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.TableLock, ptr %133, i32 0, i32 3
  store ptr %132, ptr %134, align 8, !tbaa !34
  br label %141

135:                                              ; preds = %90
  %136 = load ptr, ptr %11, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.Parse, ptr %136, i32 0, i32 34
  store i32 0, ptr %137, align 4, !tbaa !26
  %138 = load ptr, ptr %11, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.Parse, ptr %138, i32 0, i32 0
  %140 = load ptr, ptr %139, align 8, !tbaa !16
  call void @sqlite3OomFault(ptr noundef %140)
  br label %141

141:                                              ; preds = %135, %113
  store i32 0, ptr %15, align 4
  br label %142

142:                                              ; preds = %141, %80, %44, %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  %143 = load i32, ptr %15, align 4
  switch i32 %143, label %145 [
    i32 0, label %144
    i32 1, label %144
  ]

144:                                              ; preds = %142, %142
  ret void

145:                                              ; preds = %142
  unreachable
}

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

declare i32 @sqlite3BtreeSharable(ptr noundef) #2

declare ptr @sqlite3DbReallocOrFree(ptr noundef, ptr noundef, i64 noundef) #2

declare void @sqlite3OomFault(ptr noundef) #2

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

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" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !6, i64 160}
!13 = !{!"Parse", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !7, i64 28, !7, i64 29, !7, i64 30, !7, i64 31, !7, i64 32, !7, i64 33, !7, i64 34, !7, i64 35, !7, i64 36, !7, i64 37, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !6, i64 88, !6, i64 96, !14, i64 104, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !10, i64 176, !10, i64 180, !10, i64 184, !10, 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, !10, i64 472, !10, i64 476, !10, i64 480, !10, 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}
!14 = !{!"Token", !6, i64 0, !10, i64 8}
!15 = !{!"short", !7, i64 0}
!16 = !{!13, !6, i64 0}
!17 = !{!18, !6, i64 32}
!18 = !{!"sqlite3", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, 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, !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, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !7, 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, !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, !21, i64 344, !6, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !10, i64 432, !10, i64 436, !22, i64 440, !6, i64 464, !6, i64 472, !6, i64 480, !22, i64 488, !22, i64 512, !23, i64 536, !7, i64 560, !6, i64 624, !10, i64 632, !10, i64 636, !10, i64 640, !19, i64 648, !19, i64 656, !6, i64 664}
!19 = !{!"long long", !7, i64 0}
!20 = !{!"sqlite3InitInfo", !10, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7}
!21 = !{!"Lookaside", !10, i64 0, !15, i64 4, !7, i64 6, !10, i64 8, !10, i64 12, !7, i64 16, !6, i64 32, !6, i64 40, !6, i64 48}
!22 = !{!"Hash", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!23 = !{!"BusyHandler", !6, i64 0, !6, i64 8, !10, i64 16}
!24 = !{!25, !6, i64 8}
!25 = !{!"Db", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 17, !6, i64 24}
!26 = !{!13, !10, i64 140}
!27 = !{!13, !6, i64 144}
!28 = !{!29, !10, i64 0}
!29 = !{!"TableLock", !10, i64 0, !10, i64 4, !7, i64 8, !6, i64 16}
!30 = !{!29, !10, i64 4}
!31 = !{!29, !7, i64 8}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!29, !6, i64 16}


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

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

; Function Attrs: nounwind uwtable
define dso_local void @sqlite3TableLock(ptr nocapture noundef %0, i32 noundef %1, i32 noundef %2, i8 noundef zeroext %3, ptr noundef %4) local_unnamed_addr #0 {
  %6 = getelementptr inbounds i8, ptr %0, i64 160
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %.not = icmp eq ptr %7, null
  %. = select i1 %.not, ptr %0, ptr %7
  %8 = icmp eq i32 %1, 1
  br i1 %8, label %53, label %9

9:                                                ; preds = %5
  %10 = load ptr, ptr %0, align 8, !tbaa !13
  %11 = getelementptr inbounds i8, ptr %10, i64 32
  %12 = load ptr, ptr %11, align 8, !tbaa !14
  %13 = sext i32 %1 to i64
  %14 = getelementptr inbounds %struct.Db, ptr %12, i64 %13, i32 1
  %15 = load ptr, ptr %14, align 8, !tbaa !21
  %16 = tail call i32 @sqlite3BtreeSharable(ptr noundef %15) #2
  %.not39 = icmp eq i32 %16, 0
  br i1 %.not39, label %53, label %.preheader

.preheader:                                       ; preds = %9
  %17 = getelementptr inbounds i8, ptr %., i64 140
  %18 = load i32, ptr %17, align 4, !tbaa !23
  %19 = icmp sgt i32 %18, 0
  %20 = getelementptr inbounds i8, ptr %., i64 144
  %21 = load ptr, ptr %20, align 8, !tbaa !24
  br i1 %19, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %18 to i64
  br label %22

22:                                               ; preds = %.lr.ph, %36
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %36 ]
  %23 = getelementptr inbounds %struct.TableLock, ptr %21, i64 %indvars.iv
  %24 = load i32, ptr %23, align 8, !tbaa !25
  %25 = icmp eq i32 %24, %1
  br i1 %25, label %26, label %36

26:                                               ; preds = %22
  %27 = getelementptr inbounds i8, ptr %23, i64 4
  %28 = load i32, ptr %27, align 4, !tbaa !27
  %29 = icmp eq i32 %28, %2
  br i1 %29, label %30, label %36

30:                                               ; preds = %26
  %31 = getelementptr inbounds i8, ptr %23, i64 8
  %32 = load i8, ptr %31, align 8, !tbaa !28
  %33 = or i8 %32, %3
  %34 = icmp ne i8 %33, 0
  %35 = zext i1 %34 to i8
  store i8 %35, ptr %31, align 8, !tbaa !28
  br label %53

36:                                               ; preds = %22, %26
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %22, !llvm.loop !29

._crit_edge:                                      ; preds = %36, %.preheader
  %37 = mul i32 %18, 24
  %38 = add i32 %37, 24
  %39 = load ptr, ptr %., align 8, !tbaa !13
  %40 = getelementptr inbounds i8, ptr %., i64 144
  %41 = sext i32 %38 to i64
  %42 = tail call ptr @sqlite3DbReallocOrFree(ptr noundef %39, ptr noundef %21, i64 noundef %41) #2
  store ptr %42, ptr %40, align 8, !tbaa !24
  %.not40 = icmp eq ptr %42, null
  br i1 %.not40, label %51, label %43

43:                                               ; preds = %._crit_edge
  %44 = load i32, ptr %17, align 4, !tbaa !23
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %17, align 4, !tbaa !23
  %46 = sext i32 %44 to i64
  %47 = getelementptr inbounds %struct.TableLock, ptr %42, i64 %46
  store i32 %1, ptr %47, align 8, !tbaa !25
  %48 = getelementptr inbounds i8, ptr %47, i64 4
  store i32 %2, ptr %48, align 4, !tbaa !27
  %49 = getelementptr inbounds i8, ptr %47, i64 8
  store i8 %3, ptr %49, align 8, !tbaa !28
  %50 = getelementptr inbounds i8, ptr %47, i64 16
  store ptr %4, ptr %50, align 8, !tbaa !31
  br label %53

51:                                               ; preds = %._crit_edge
  store i32 0, ptr %17, align 4, !tbaa !23
  %52 = load ptr, ptr %., align 8, !tbaa !13
  tail call void @sqlite3OomFault(ptr noundef %52) #2
  br label %53

53:                                               ; preds = %43, %51, %9, %5, %30
  ret void
}

declare i32 @sqlite3BtreeSharable(ptr noundef) local_unnamed_addr #1

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

declare void @sqlite3OomFault(ptr noundef) local_unnamed_addr #1

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

!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 160}
!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 = !{!15, !7, i64 32}
!15 = !{!"sqlite3", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 44, !16, i64 48, !16, 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, !17, 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, !18, i64 344, !7, i64 400, !7, i64 408, !7, i64 416, !7, i64 424, !10, i64 432, !10, i64 436, !19, i64 440, !7, i64 464, !7, i64 472, !7, i64 480, !19, i64 488, !19, i64 512, !20, i64 536, !8, i64 560, !7, i64 624, !10, i64 632, !10, i64 636, !10, i64 640, !16, i64 648, !16, i64 656, !7, i64 664}
!16 = !{!"long long", !8, i64 0}
!17 = !{!"sqlite3InitInfo", !10, i64 0, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7}
!18 = !{!"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}
!19 = !{!"Hash", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 16}
!20 = !{!"BusyHandler", !7, i64 0, !7, i64 8, !10, i64 16}
!21 = !{!22, !7, i64 8}
!22 = !{!"Db", !7, i64 0, !7, i64 8, !8, i64 16, !8, i64 17, !7, i64 24}
!23 = !{!6, !10, i64 140}
!24 = !{!6, !7, i64 144}
!25 = !{!26, !10, i64 0}
!26 = !{!"TableLock", !10, i64 0, !10, i64 4, !8, i64 8, !7, i64 16}
!27 = !{!26, !10, i64 4}
!28 = !{!26, !8, i64 8}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!26, !7, i64 16}


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