1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin10 -frame-pointer=all -relocation-model=pic
4 %0 = type { [62 x ptr] } ; type %0
5 %1 = type { ptr } ; type %1
6 %2 = type { double } ; type %2
7 %struct..5sPragmaType = type { ptr, i32 }
8 %struct.AggInfo = type { i8, i8, i32, ptr, i32, ptr, i32, i32, i32, ptr, i32, i32 }
9 %struct.AggInfo_col = type { ptr, i32, i32, i32, i32, ptr }
10 %struct.AggInfo_func = type { ptr, ptr, i32, i32 }
11 %struct.AuxData = type { ptr, ptr }
12 %struct.Bitvec = type { i32, i32, i32, %0 }
13 %struct.BtCursor = type { ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, i32, %struct.CellInfo, i8, i8, ptr, i64, i32, i8, ptr }
14 %struct.BtLock = type { ptr, i32, i8, ptr }
15 %struct.BtShared = type { ptr, ptr, ptr, ptr, i8, i8, i8, i8, i8, i8, i8, i8, i32, i16, i16, i32, i32, i32, i32, i8, i32, ptr, ptr, ptr, %struct.BusyHandler, i32, ptr, ptr, ptr }
16 %struct.Btree = type { ptr, ptr, i8, i8, i8, i32, ptr, ptr }
17 %struct.BtreeMutexArray = type { i32, [11 x ptr] }
18 %struct.BusyHandler = type { ptr, ptr, i32 }
19 %struct.CellInfo = type { ptr, i64, i32, i32, i16, i16, i16, i16 }
20 %struct.CollSeq = type { ptr, i8, i8, ptr, ptr, ptr }
21 %struct.Column = type { ptr, ptr, ptr, ptr, i8, i8, i8, i8 }
22 %struct.Context = type { i64, i32, %struct.Fifo }
23 %struct.CountCtx = type { i64 }
24 %struct.Cursor = type { ptr, i32, i64, i64, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i64, ptr, i32, ptr, i64, ptr, ptr, i32, i64, ptr, ptr, i32, i32, ptr, ptr, ptr }
25 %struct.Db = type { ptr, ptr, i8, i8, ptr, ptr, ptr }
26 %struct.DbPage = type { ptr, i32, ptr, ptr, %struct.PagerLruLink, ptr, i8, i8, i8, i8, i8, i16, ptr, ptr, ptr }
27 %struct.Expr = type { i8, i8, i16, ptr, ptr, ptr, ptr, %struct..5sPragmaType, %struct..5sPragmaType, i32, i32, ptr, i32, i32, ptr, ptr, i32 }
28 %struct.ExprList = type { i32, i32, i32, ptr }
29 %struct.ExprList_item = type { ptr, ptr, i8, i8, i8 }
30 %struct.FKey = type { ptr, ptr, ptr, ptr, i32, ptr, i8, i8, i8, i8 }
31 %struct.Fifo = type { i32, ptr, ptr }
32 %struct.FifoPage = type { i32, i32, i32, ptr, [1 x i64] }
33 %struct.FuncDef = type { i16, i8, i8, i8, ptr, ptr, ptr, ptr, ptr, [1 x i8] }
34 %struct.Hash = type { i8, i8, i32, i32, ptr, ptr }
35 %struct.HashElem = type { ptr, ptr, ptr, ptr, i32 }
36 %struct.IdList = type { ptr, i32, i32 }
37 %struct.Index = type { ptr, i32, ptr, ptr, ptr, i32, i8, i8, ptr, ptr, ptr, ptr, ptr }
38 %struct.KeyInfo = type { ptr, i8, i8, i8, i32, ptr, [1 x ptr] }
39 %struct.Mem = type { %struct.CountCtx, double, ptr, ptr, i32, i16, i8, i8, ptr }
40 %struct.MemPage = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i16, i16, i16, i16, i16, [5 x %struct._OvflCell], ptr, ptr, ptr, i32, ptr }
41 %struct.Module = type { ptr, ptr, ptr, ptr }
42 %struct.Op = type { i8, i8, i8, i8, i32, i32, i32, %1 }
43 %struct.Pager = type { ptr, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.PagerLruList, ptr, ptr, ptr, i64, i64, i64, i64, i64, i32, ptr, ptr, i32, ptr, ptr, [16 x i8] }
44 %struct.PagerLruLink = type { ptr, ptr }
45 %struct.PagerLruList = type { ptr, ptr, ptr }
46 %struct.Schema = type { i32, %struct.Hash, %struct.Hash, %struct.Hash, %struct.Hash, ptr, i8, i8, i16, i32, ptr }
47 %struct.Select = type { ptr, i8, i8, i8, i8, i8, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, [3 x i32] }
48 %struct.SrcList = type { i16, i16, [1 x %struct.SrcList_item] }
49 %struct.SrcList_item = type { ptr, ptr, ptr, ptr, ptr, i8, i8, i32, ptr, ptr, i64 }
50 %struct.Table = type { ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, ptr, ptr, ptr, i32, i8, i8, i8, i8, i8, i8, i8, ptr, ptr, i32, ptr, ptr }
51 %struct.Trigger = type { ptr, ptr, i8, i8, ptr, ptr, %struct..5sPragmaType, ptr, ptr, ptr, ptr }
52 %struct.TriggerStep = type { i32, i32, ptr, ptr, %struct..5sPragmaType, ptr, ptr, ptr, ptr, ptr }
53 %struct.Vdbe = type { ptr, ptr, ptr, i32, i32, ptr, i32, i32, ptr, ptr, ptr, i32, ptr, i32, ptr, ptr, i32, i32, i32, ptr, i32, i32, %struct.Fifo, i32, i32, ptr, i32, i32, i32, i32, i32, [25 x i32], i32, i32, ptr, ptr, ptr, i8, i8, i8, i8, i8, i8, i32, i64, i32, %struct.BtreeMutexArray, i32, ptr, i32 }
54 %struct.VdbeFunc = type { ptr, i32, [1 x %struct.AuxData] }
55 %struct._OvflCell = type { ptr, i16 }
56 %struct._ht = type { i32, ptr }
57 %struct.sColMap = type { i32, ptr }
58 %struct.sqlite3 = type { ptr, i32, ptr, i32, i32, i32, i32, i8, i8, i8, i8, i32, ptr, i64, i64, i32, i32, i32, ptr, %struct.sqlite3InitInfo, i32, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %2, ptr, ptr, ptr, ptr, i32, %struct.Hash, ptr, ptr, i32, %struct.Hash, %struct.Hash, %struct.BusyHandler, i32, [2 x %struct.Db], i8 }
59 %struct.sqlite3InitInfo = type { i32, i32, i8 }
60 %struct.sqlite3_context = type { ptr, ptr, %struct.Mem, ptr, i32, ptr }
61 %struct.sqlite3_file = type { ptr }
62 %struct.sqlite3_index_constraint = type { i32, i8, i8, i32 }
63 %struct.sqlite3_index_constraint_usage = type { i32, i8 }
64 %struct.sqlite3_index_info = type { i32, ptr, i32, ptr, ptr, i32, ptr, i32, i32, double }
65 %struct.sqlite3_io_methods = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
66 %struct.sqlite3_module = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
67 %struct.sqlite3_mutex = type opaque
68 %struct.sqlite3_vfs = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
69 %struct.sqlite3_vtab = type { ptr, i32, ptr }
70 %struct.sqlite3_vtab_cursor = type { ptr }
72 define fastcc void @dropCell(ptr nocapture %pPage, i32 %idx, i32 %sz) nounwind ssp {
74 %0 = load ptr, ptr null, align 8 ; <ptr> [#uses=4]
75 %1 = or i32 0, 0 ; <i32> [#uses=1]
76 %2 = icmp slt i32 %sz, 4 ; <i1> [#uses=1]
77 %size_addr.0.i = select i1 %2, i32 4, i32 %sz ; <i32> [#uses=1]
80 bb3.i: ; preds = %bb3.i, %entry
81 %3 = icmp eq i32 0, 0 ; <i1> [#uses=1]
82 %or.cond.i = or i1 %3, false ; <i1> [#uses=1]
83 br i1 %or.cond.i, label %bb5.i, label %bb3.i
85 bb5.i: ; preds = %bb3.i
86 %4 = getelementptr i8, ptr %0, i64 0 ; <ptr> [#uses=1]
87 store i8 0, ptr %4, align 1
88 %5 = getelementptr i8, ptr %0, i64 0 ; <ptr> [#uses=1]
89 store i8 0, ptr %5, align 1
90 %6 = add i32 %1, 2 ; <i32> [#uses=1]
91 %7 = zext i32 %6 to i64 ; <i64> [#uses=2]
92 %8 = getelementptr i8, ptr %0, i64 %7 ; <ptr> [#uses=1]
93 %9 = lshr i32 %size_addr.0.i, 8 ; <i32> [#uses=1]
94 %10 = trunc i32 %9 to i8 ; <i8> [#uses=1]
95 store i8 %10, ptr %8, align 1
96 %.sum31.i = add i64 %7, 1 ; <i64> [#uses=1]
97 %11 = getelementptr i8, ptr %0, i64 %.sum31.i ; <ptr> [#uses=1]
98 store i8 0, ptr %11, align 1
99 br label %bb11.outer.i
101 bb11.outer.i: ; preds = %bb11.outer.i, %bb5.i
102 %12 = icmp eq i32 0, 0 ; <i1> [#uses=1]
103 br i1 %12, label %bb12.i, label %bb11.outer.i
105 bb12.i: ; preds = %bb11.outer.i
106 %i.08 = add i32 %idx, 1 ; <i32> [#uses=1]
107 %13 = icmp sgt i32 0, %i.08 ; <i1> [#uses=1]
108 br i1 %13, label %bb, label %bb2
110 bb: ; preds = %bb12.i
113 bb2: ; preds = %bb, %bb12.i
114 %14 = getelementptr %struct.MemPage, ptr %pPage, i64 0, i32 1 ; <ptr> [#uses=1]
115 store i8 1, ptr %14, align 1