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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.Parse = type { ptr, ptr, ptr, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, %struct.Token, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i8, i8, i8, [10 x %struct.yColCache], [8 x i32], %struct.Token, %struct.Token, i16, i8, i8, i8, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, %struct.Token, ptr, ptr, ptr, ptr, ptr }
%struct.yColCache = type { i32, i16, i8, i32, i32, i32 }
%struct.Token = type { ptr, i32 }
%struct.Table = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i16, i16, i16, i16, i8, i32, i32, ptr, ptr, ptr, ptr, ptr }

; 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

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

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

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

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

declare i32 @sqlite3VdbeMakeLabel(ptr noundef) #1

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

declare void @sqlite3VdbeChangeP5(ptr noundef, i16 noundef zeroext) #1

; Function Attrs: nounwind uwtable
define dso_local void @sqlite3GenerateRowDelete(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i16 noundef signext %6, i8 noundef zeroext %7, i8 noundef zeroext %8, i8 noundef zeroext %9, i32 noundef %10) #2 {
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i16, align 2
  %19 = alloca i8, align 1
  %20 = alloca i8, align 1
  %21 = alloca i8, align 1
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i8, align 1
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i8, align 1
  store ptr %0, ptr %12, align 8, !tbaa !5
  store ptr %1, ptr %13, align 8, !tbaa !5
  store ptr %2, ptr %14, align 8, !tbaa !5
  store i32 %3, ptr %15, align 4, !tbaa !9
  store i32 %4, ptr %16, align 4, !tbaa !9
  store i32 %5, ptr %17, align 4, !tbaa !9
  store i16 %6, ptr %18, align 2, !tbaa !11
  store i8 %7, ptr %19, align 1, !tbaa !13
  store i8 %8, ptr %20, align 1, !tbaa !13
  store i8 %9, ptr %21, align 1, !tbaa !13
  store i32 %10, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %31 = load ptr, ptr %12, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.Parse, ptr %31, i32 0, i32 2
  %33 = load ptr, ptr %32, align 8, !tbaa !14
  store ptr %33, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  store i32 0, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #3
  %34 = load ptr, ptr %23, align 8, !tbaa !5
  %35 = call i32 @sqlite3VdbeMakeLabel(ptr noundef %34)
  store i32 %35, ptr %25, align 4, !tbaa !9
  %36 = load ptr, ptr %13, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.Table, ptr %36, i32 0, i32 9
  %38 = load i32, ptr %37, align 8, !tbaa !17
  %39 = and i32 %38, 32
  %40 = icmp eq i32 %39, 0
  %41 = zext i1 %40 to i64
  %42 = select i1 %40, i32 33, i32 30
  %43 = trunc i32 %42 to i8
  store i8 %43, ptr %26, align 1, !tbaa !13
  %44 = load i8, ptr %21, align 1, !tbaa !13
  %45 = zext i8 %44 to i32
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %47, label %57

47:                                               ; preds = %11
  %48 = load ptr, ptr %23, align 8, !tbaa !5
  %49 = load i8, ptr %26, align 1, !tbaa !13
  %50 = zext i8 %49 to i32
  %51 = load i32, ptr %15, align 4, !tbaa !9
  %52 = load i32, ptr %25, align 4, !tbaa !9
  %53 = load i32, ptr %17, align 4, !tbaa !9
  %54 = load i16, ptr %18, align 2, !tbaa !11
  %55 = sext i16 %54 to i32
  %56 = call i32 @sqlite3VdbeAddOp4Int(ptr noundef %48, i32 noundef %50, i32 noundef %51, i32 noundef %52, i32 noundef %53, i32 noundef %55)
  br label %57

57:                                               ; preds = %47, %11
  %58 = load ptr, ptr %12, align 8, !tbaa !5
  %59 = load ptr, ptr %13, align 8, !tbaa !5
  %60 = call i32 @sqlite3FkRequired(ptr noundef %58, ptr noundef %59, ptr noundef null, i32 noundef 0)
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %65, label %62

62:                                               ; preds = %57
  %63 = load ptr, ptr %14, align 8, !tbaa !5
  %64 = icmp ne ptr %63, null
  br i1 %64, label %65, label %154

65:                                               ; preds = %62, %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #3
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = load ptr, ptr %14, align 8, !tbaa !5
  %68 = load ptr, ptr %13, align 8, !tbaa !5
  %69 = load i8, ptr %20, align 1, !tbaa !13
  %70 = zext i8 %69 to i32
  %71 = call i32 @sqlite3TriggerColmask(ptr noundef %66, ptr noundef %67, ptr noundef null, i32 noundef 0, i32 noundef 3, ptr noundef %68, i32 noundef %70)
  store i32 %71, ptr %27, align 4, !tbaa !9
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = load ptr, ptr %13, align 8, !tbaa !5
  %74 = call i32 @sqlite3FkOldmask(ptr noundef %72, ptr noundef %73)
  %75 = load i32, ptr %27, align 4, !tbaa !9
  %76 = or i32 %75, %74
  store i32 %76, ptr %27, align 4, !tbaa !9
  %77 = load ptr, ptr %12, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.Parse, ptr %77, i32 0, i32 18
  %79 = load i32, ptr %78, align 8, !tbaa !19
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %24, align 4, !tbaa !9
  %81 = load ptr, ptr %13, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.Table, ptr %81, i32 0, i32 11
  %83 = load i16, ptr %82, align 2, !tbaa !20
  %84 = sext i16 %83 to i32
  %85 = add nsw i32 1, %84
  %86 = load ptr, ptr %12, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.Parse, ptr %86, i32 0, i32 18
  %88 = load i32, ptr %87, align 8, !tbaa !19
  %89 = add nsw i32 %88, %85
  store i32 %89, ptr %87, align 8, !tbaa !19
  %90 = load ptr, ptr %23, align 8, !tbaa !5
  %91 = load i32, ptr %17, align 4, !tbaa !9
  %92 = load i32, ptr %24, align 4, !tbaa !9
  %93 = call i32 @sqlite3VdbeAddOp2(ptr noundef %90, i32 noundef 85, i32 noundef %91, i32 noundef %92)
  store i32 0, ptr %28, align 4, !tbaa !9
  br label %94

94:                                               ; preds = %123, %65
  %95 = load i32, ptr %28, align 4, !tbaa !9
  %96 = load ptr, ptr %13, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.Table, ptr %96, i32 0, i32 11
  %98 = load i16, ptr %97, align 2, !tbaa !20
  %99 = sext i16 %98 to i32
  %100 = icmp slt i32 %95, %99
  br i1 %100, label %101, label %126

101:                                              ; preds = %94
  %102 = load i32, ptr %27, align 4, !tbaa !9
  %103 = icmp eq i32 %102, -1
  br i1 %103, label %113, label %104

104:                                              ; preds = %101
  %105 = load i32, ptr %28, align 4, !tbaa !9
  %106 = icmp sle i32 %105, 31
  br i1 %106, label %107, label %122

107:                                              ; preds = %104
  %108 = load i32, ptr %27, align 4, !tbaa !9
  %109 = load i32, ptr %28, align 4, !tbaa !9
  %110 = shl i32 1, %109
  %111 = and i32 %108, %110
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %113, label %122

113:                                              ; preds = %107, %101
  %114 = load ptr, ptr %23, align 8, !tbaa !5
  %115 = load ptr, ptr %13, align 8, !tbaa !5
  %116 = load i32, ptr %15, align 4, !tbaa !9
  %117 = load i32, ptr %28, align 4, !tbaa !9
  %118 = load i32, ptr %24, align 4, !tbaa !9
  %119 = load i32, ptr %28, align 4, !tbaa !9
  %120 = add nsw i32 %118, %119
  %121 = add nsw i32 %120, 1
  call void @sqlite3ExprCodeGetColumnOfTable(ptr noundef %114, ptr noundef %115, i32 noundef %116, i32 noundef %117, i32 noundef %121)
  br label %122

122:                                              ; preds = %113, %107, %104
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %28, align 4, !tbaa !9
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %28, align 4, !tbaa !9
  br label %94, !llvm.loop !21

126:                                              ; preds = %94
  %127 = load ptr, ptr %23, align 8, !tbaa !5
  %128 = call i32 @sqlite3VdbeCurrentAddr(ptr noundef %127)
  store i32 %128, ptr %29, align 4, !tbaa !9
  %129 = load ptr, ptr %12, align 8, !tbaa !5
  %130 = load ptr, ptr %14, align 8, !tbaa !5
  %131 = load ptr, ptr %13, align 8, !tbaa !5
  %132 = load i32, ptr %24, align 4, !tbaa !9
  %133 = load i8, ptr %20, align 1, !tbaa !13
  %134 = zext i8 %133 to i32
  %135 = load i32, ptr %25, align 4, !tbaa !9
  call void @sqlite3CodeRowTrigger(ptr noundef %129, ptr noundef %130, i32 noundef 109, ptr noundef null, i32 noundef 1, ptr noundef %131, i32 noundef %132, i32 noundef %134, i32 noundef %135)
  %136 = load i32, ptr %29, align 4, !tbaa !9
  %137 = load ptr, ptr %23, align 8, !tbaa !5
  %138 = call i32 @sqlite3VdbeCurrentAddr(ptr noundef %137)
  %139 = icmp slt i32 %136, %138
  br i1 %139, label %140, label %150

140:                                              ; preds = %126
  %141 = load ptr, ptr %23, align 8, !tbaa !5
  %142 = load i8, ptr %26, align 1, !tbaa !13
  %143 = zext i8 %142 to i32
  %144 = load i32, ptr %15, align 4, !tbaa !9
  %145 = load i32, ptr %25, align 4, !tbaa !9
  %146 = load i32, ptr %17, align 4, !tbaa !9
  %147 = load i16, ptr %18, align 2, !tbaa !11
  %148 = sext i16 %147 to i32
  %149 = call i32 @sqlite3VdbeAddOp4Int(ptr noundef %141, i32 noundef %143, i32 noundef %144, i32 noundef %145, i32 noundef %146, i32 noundef %148)
  store i32 -1, ptr %22, align 4, !tbaa !9
  br label %150

150:                                              ; preds = %140, %126
  %151 = load ptr, ptr %12, align 8, !tbaa !5
  %152 = load ptr, ptr %13, align 8, !tbaa !5
  %153 = load i32, ptr %24, align 4, !tbaa !9
  call void @sqlite3FkCheck(ptr noundef %151, ptr noundef %152, i32 noundef %153, i32 noundef 0, ptr noundef null, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #3
  br label %154

154:                                              ; preds = %150, %62
  %155 = load ptr, ptr %13, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.Table, ptr %155, i32 0, i32 3
  %157 = load ptr, ptr %156, align 8, !tbaa !23
  %158 = icmp eq ptr %157, null
  br i1 %158, label %159, label %211

159:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 1, ptr %30) #3
  store i8 0, ptr %30, align 1, !tbaa !13
  %160 = load ptr, ptr %12, align 8, !tbaa !5
  %161 = load ptr, ptr %13, align 8, !tbaa !5
  %162 = load i32, ptr %15, align 4, !tbaa !9
  %163 = load i32, ptr %16, align 4, !tbaa !9
  %164 = load i32, ptr %22, align 4, !tbaa !9
  call void @sqlite3GenerateRowIndexDelete(ptr noundef %160, ptr noundef %161, i32 noundef %162, i32 noundef %163, ptr noundef null, i32 noundef %164)
  %165 = load ptr, ptr %23, align 8, !tbaa !5
  %166 = load i32, ptr %15, align 4, !tbaa !9
  %167 = load i8, ptr %19, align 1, !tbaa !13
  %168 = zext i8 %167 to i32
  %169 = icmp ne i32 %168, 0
  %170 = zext i1 %169 to i64
  %171 = select i1 %169, i32 1, i32 0
  %172 = call i32 @sqlite3VdbeAddOp2(ptr noundef %165, i32 noundef 118, i32 noundef %166, i32 noundef %171)
  %173 = load ptr, ptr %12, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.Parse, ptr %173, i32 0, i32 6
  %175 = load i8, ptr %174, align 2, !tbaa !24
  %176 = zext i8 %175 to i32
  %177 = icmp eq i32 %176, 0
  br i1 %177, label %178, label %181

178:                                              ; preds = %159
  %179 = load ptr, ptr %23, align 8, !tbaa !5
  %180 = load ptr, ptr %13, align 8, !tbaa !5
  call void @sqlite3VdbeAppendP4(ptr noundef %179, ptr noundef %180, i32 noundef -15)
  br label %181

181:                                              ; preds = %178, %159
  %182 = load i8, ptr %21, align 1, !tbaa !13
  %183 = zext i8 %182 to i32
  %184 = icmp ne i32 %183, 0
  br i1 %184, label %185, label %187

185:                                              ; preds = %181
  %186 = load ptr, ptr %23, align 8, !tbaa !5
  call void @sqlite3VdbeChangeP5(ptr noundef %186, i16 noundef zeroext 4)
  br label %187

187:                                              ; preds = %185, %181
  %188 = load i32, ptr %22, align 4, !tbaa !9
  %189 = icmp sge i32 %188, 0
  br i1 %189, label %190, label %198

190:                                              ; preds = %187
  %191 = load i32, ptr %22, align 4, !tbaa !9
  %192 = load i32, ptr %15, align 4, !tbaa !9
  %193 = icmp ne i32 %191, %192
  br i1 %193, label %194, label %198

194:                                              ; preds = %190
  %195 = load ptr, ptr %23, align 8, !tbaa !5
  %196 = load i32, ptr %22, align 4, !tbaa !9
  %197 = call i32 @sqlite3VdbeAddOp1(ptr noundef %195, i32 noundef 118, i32 noundef %196)
  br label %198

198:                                              ; preds = %194, %190, %187
  %199 = load i8, ptr %21, align 1, !tbaa !13
  %200 = zext i8 %199 to i32
  %201 = icmp eq i32 %200, 2
  br i1 %201, label %202, label %207

202:                                              ; preds = %198
  %203 = load i8, ptr %30, align 1, !tbaa !13
  %204 = zext i8 %203 to i32
  %205 = or i32 %204, 2
  %206 = trunc i32 %205 to i8
  store i8 %206, ptr %30, align 1, !tbaa !13
  br label %207

207:                                              ; preds = %202, %198
  %208 = load ptr, ptr %23, align 8, !tbaa !5
  %209 = load i8, ptr %30, align 1, !tbaa !13
  %210 = zext i8 %209 to i16
  call void @sqlite3VdbeChangeP5(ptr noundef %208, i16 noundef zeroext %210)
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #3
  br label %211

211:                                              ; preds = %207, %154
  %212 = load ptr, ptr %12, align 8, !tbaa !5
  %213 = load ptr, ptr %13, align 8, !tbaa !5
  %214 = load i32, ptr %24, align 4, !tbaa !9
  call void @sqlite3FkActions(ptr noundef %212, ptr noundef %213, ptr noundef null, i32 noundef %214, ptr noundef null, i32 noundef 0)
  %215 = load ptr, ptr %12, align 8, !tbaa !5
  %216 = load ptr, ptr %14, align 8, !tbaa !5
  %217 = load ptr, ptr %13, align 8, !tbaa !5
  %218 = load i32, ptr %24, align 4, !tbaa !9
  %219 = load i8, ptr %20, align 1, !tbaa !13
  %220 = zext i8 %219 to i32
  %221 = load i32, ptr %25, align 4, !tbaa !9
  call void @sqlite3CodeRowTrigger(ptr noundef %215, ptr noundef %216, i32 noundef 109, ptr noundef null, i32 noundef 2, ptr noundef %217, i32 noundef %218, i32 noundef %220, i32 noundef %221)
  %222 = load ptr, ptr %23, align 8, !tbaa !5
  %223 = load i32, ptr %25, align 4, !tbaa !9
  call void @sqlite3VdbeResolveLabel(ptr noundef %222, i32 noundef %223)
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  ret void
}

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

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

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

declare i32 @sqlite3VdbeCurrentAddr(ptr noundef) #1

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !6, i64 16}
!15 = !{!"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, !16, 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, !16, i64 432, !16, i64 448, !12, 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, !16, i64 536, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584}
!16 = !{!"Token", !6, i64 0, !10, i64 8}
!17 = !{!18, !10, i64 64}
!18 = !{!"Table", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !12, i64 68, !12, i64 70, !12, i64 72, !12, i64 74, !7, i64 76, !10, i64 80, !10, i64 84, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!19 = !{!15, !10, i64 56}
!20 = !{!18, !12, i64 70}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!18, !6, i64 24}
!24 = !{!15, !7, i64 30}


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

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

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

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

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

declare i32 @sqlite3VdbeMakeLabel(ptr noundef) local_unnamed_addr #0

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

declare void @sqlite3VdbeChangeP5(ptr noundef, i16 noundef zeroext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @sqlite3GenerateRowDelete(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i16 noundef signext %6, i8 noundef zeroext %7, i8 noundef zeroext %8, i8 noundef zeroext %9, i32 noundef %10) local_unnamed_addr #1 {
  %12 = getelementptr inbounds i8, ptr %0, i64 16
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  %14 = tail call i32 @sqlite3VdbeMakeLabel(ptr noundef %13) #2
  %15 = getelementptr inbounds i8, ptr %1, i64 64
  %16 = load i32, ptr %15, align 8, !tbaa !13
  %17 = and i32 %16, 32
  %18 = icmp eq i32 %17, 0
  %19 = select i1 %18, i8 33, i8 30
  %20 = icmp eq i8 %9, 0
  br i1 %20, label %21, label %25

21:                                               ; preds = %11
  %22 = zext nneg i8 %19 to i32
  %23 = sext i16 %6 to i32
  %24 = tail call i32 @sqlite3VdbeAddOp4Int(ptr noundef %13, i32 noundef %22, i32 noundef %3, i32 noundef %14, i32 noundef %5, i32 noundef %23) #2
  br label %25

25:                                               ; preds = %21, %11
  %26 = tail call i32 @sqlite3FkRequired(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef null, i32 noundef 0) #2
  %27 = icmp ne i32 %26, 0
  %28 = icmp ne ptr %2, null
  %or.cond = or i1 %28, %27
  br i1 %or.cond, label %29, label %71

29:                                               ; preds = %25
  %30 = zext i8 %8 to i32
  %31 = tail call i32 @sqlite3TriggerColmask(ptr noundef nonnull %0, ptr noundef %2, ptr noundef null, i32 noundef 0, i32 noundef 3, ptr noundef nonnull %1, i32 noundef %30) #2
  %32 = tail call i32 @sqlite3FkOldmask(ptr noundef nonnull %0, ptr noundef nonnull %1) #2
  %33 = or i32 %32, %31
  %34 = getelementptr inbounds i8, ptr %0, i64 56
  %35 = load i32, ptr %34, align 8, !tbaa !15
  %36 = add i32 %35, 1
  %37 = getelementptr inbounds i8, ptr %1, i64 70
  %38 = load i16, ptr %37, align 2, !tbaa !16
  %39 = sext i16 %38 to i32
  %40 = add i32 %36, %39
  store i32 %40, ptr %34, align 8, !tbaa !15
  %41 = tail call i32 @sqlite3VdbeAddOp2(ptr noundef %13, i32 noundef 85, i32 noundef %5, i32 noundef %36) #2
  %42 = load i16, ptr %37, align 2, !tbaa !16
  %43 = icmp sgt i16 %42, 0
  br i1 %43, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %29
  %44 = icmp eq i32 %33, -1
  %45 = add i32 %35, 2
  br i1 %44, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.lr.ph.split.us
  %.09299.us = phi i32 [ %47, %.lr.ph.split.us ], [ 0, %.lr.ph ]
  %46 = add i32 %45, %.09299.us
  tail call void @sqlite3ExprCodeGetColumnOfTable(ptr noundef %13, ptr noundef nonnull %1, i32 noundef %3, i32 noundef %.09299.us, i32 noundef %46) #2
  %47 = add nuw nsw i32 %.09299.us, 1
  %48 = load i16, ptr %37, align 2, !tbaa !16
  %49 = sext i16 %48 to i32
  %50 = icmp slt i32 %47, %49
  br i1 %50, label %.lr.ph.split.us, label %._crit_edge, !llvm.loop !17

.lr.ph.split:                                     ; preds = %.lr.ph, %58
  %51 = phi i16 [ %59, %58 ], [ %42, %.lr.ph ]
  %.09299 = phi i32 [ %60, %58 ], [ 0, %.lr.ph ]
  %52 = icmp ult i32 %.09299, 32
  br i1 %52, label %53, label %58

53:                                               ; preds = %.lr.ph.split
  %54 = shl nuw i32 1, %.09299
  %55 = and i32 %54, %33
  %.not97 = icmp eq i32 %55, 0
  br i1 %.not97, label %58, label %56

56:                                               ; preds = %53
  %57 = add i32 %45, %.09299
  tail call void @sqlite3ExprCodeGetColumnOfTable(ptr noundef %13, ptr noundef nonnull %1, i32 noundef %3, i32 noundef %.09299, i32 noundef %57) #2
  %.pre = load i16, ptr %37, align 2, !tbaa !16
  br label %58

58:                                               ; preds = %.lr.ph.split, %53, %56
  %59 = phi i16 [ %51, %.lr.ph.split ], [ %51, %53 ], [ %.pre, %56 ]
  %60 = add nuw nsw i32 %.09299, 1
  %61 = sext i16 %59 to i32
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %.lr.ph.split, label %._crit_edge, !llvm.loop !17

._crit_edge:                                      ; preds = %58, %.lr.ph.split.us, %29
  %63 = tail call i32 @sqlite3VdbeCurrentAddr(ptr noundef %13) #2
  tail call void @sqlite3CodeRowTrigger(ptr noundef %0, ptr noundef %2, i32 noundef 109, ptr noundef null, i32 noundef 1, ptr noundef nonnull %1, i32 noundef %36, i32 noundef %30, i32 noundef %14) #2
  %64 = tail call i32 @sqlite3VdbeCurrentAddr(ptr noundef %13) #2
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %66, label %70

66:                                               ; preds = %._crit_edge
  %67 = zext nneg i8 %19 to i32
  %68 = sext i16 %6 to i32
  %69 = tail call i32 @sqlite3VdbeAddOp4Int(ptr noundef %13, i32 noundef %67, i32 noundef %3, i32 noundef %14, i32 noundef %5, i32 noundef %68) #2
  br label %70

70:                                               ; preds = %66, %._crit_edge
  %.091 = phi i32 [ -1, %66 ], [ %10, %._crit_edge ]
  tail call void @sqlite3FkCheck(ptr noundef %0, ptr noundef nonnull %1, i32 noundef %36, i32 noundef 0, ptr noundef null, i32 noundef 0) #2
  br label %71

71:                                               ; preds = %25, %70
  %.093 = phi i32 [ %36, %70 ], [ 0, %25 ]
  %.1 = phi i32 [ %.091, %70 ], [ %10, %25 ]
  %72 = getelementptr inbounds i8, ptr %1, i64 24
  %73 = load ptr, ptr %72, align 8, !tbaa !19
  %74 = icmp eq ptr %73, null
  br i1 %74, label %75, label %90

75:                                               ; preds = %71
  tail call void @sqlite3GenerateRowIndexDelete(ptr noundef %0, ptr noundef nonnull %1, i32 noundef %3, i32 noundef %4, ptr noundef null, i32 noundef %.1)
  %.not = icmp ne i8 %7, 0
  %76 = zext i1 %.not to i32
  %77 = tail call i32 @sqlite3VdbeAddOp2(ptr noundef %13, i32 noundef 118, i32 noundef %3, i32 noundef %76) #2
  %78 = getelementptr inbounds i8, ptr %0, i64 30
  %79 = load i8, ptr %78, align 2, !tbaa !20
  %80 = icmp eq i8 %79, 0
  br i1 %80, label %81, label %82

81:                                               ; preds = %75
  tail call void @sqlite3VdbeAppendP4(ptr noundef %13, ptr noundef nonnull %1, i32 noundef -15) #2
  br label %82

82:                                               ; preds = %81, %75
  br i1 %20, label %84, label %83

83:                                               ; preds = %82
  tail call void @sqlite3VdbeChangeP5(ptr noundef %13, i16 noundef zeroext 4) #2
  br label %84

84:                                               ; preds = %83, %82
  %85 = icmp slt i32 %.1, 0
  %.not96 = icmp eq i32 %.1, %3
  %or.cond98 = or i1 %85, %.not96
  br i1 %or.cond98, label %88, label %86

86:                                               ; preds = %84
  %87 = tail call i32 @sqlite3VdbeAddOp1(ptr noundef %13, i32 noundef 118, i32 noundef %.1) #2
  br label %88

88:                                               ; preds = %86, %84
  %89 = icmp eq i8 %9, 2
  %spec.select = select i1 %89, i16 2, i16 0
  tail call void @sqlite3VdbeChangeP5(ptr noundef %13, i16 noundef zeroext %spec.select) #2
  br label %90

90:                                               ; preds = %88, %71
  tail call void @sqlite3FkActions(ptr noundef %0, ptr noundef nonnull %1, ptr noundef null, i32 noundef %.093, ptr noundef null, i32 noundef 0) #2
  %91 = zext i8 %8 to i32
  tail call void @sqlite3CodeRowTrigger(ptr noundef %0, ptr noundef %2, i32 noundef 109, ptr noundef null, i32 noundef 2, ptr noundef nonnull %1, i32 noundef %.093, i32 noundef %91, i32 noundef %14) #2
  tail call void @sqlite3VdbeResolveLabel(ptr noundef %13, i32 noundef %14) #2
  ret void
}

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

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

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

declare i32 @sqlite3VdbeCurrentAddr(ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @sqlite3GenerateRowIndexDelete(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

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

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 16}
!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 = !{!14, !10, i64 64}
!14 = !{!"Table", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !12, i64 68, !12, i64 70, !12, i64 72, !12, i64 74, !8, i64 76, !10, i64 80, !10, i64 84, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120}
!15 = !{!6, !10, i64 56}
!16 = !{!14, !12, i64 70}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!14, !7, i64 24}
!20 = !{!6, !8, i64 30}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass