MCPcopy
hub / github.com/sql-js/sql.js / _reverseFunc

Function _reverseFunc

js/sql-debug.js:8244–8401  ·  view source on GitHub ↗
($0,$1,$2)

Source from the content-addressed store, hash-verified

8242 return;
8243}
8244function _reverseFunc($0,$1,$2) {
8245 $0 = $0|0;
8246 $1 = $1|0;
8247 $2 = $2|0;
8248 var $$0$i = 0, $$018$i = 0, $$035$ph = 0, $$036 = 0, $$036$ph = 0, $$039 = 0, $$1$i = 0, $$119$i = 0, $$137 = 0, $$138 = 0, $$pre = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0;
8249 var $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0;
8250 var $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0;
8251 var $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $or$cond$i = 0, $or$cond22$i = 0, label = 0, sp = 0;
8252 sp = STACKTOP;
8253 $3 = ($1|0)==(1);
8254 if (!($3)) {
8255 ___assert_fail((16899|0),(16157|0),1323,(16907|0));
8256 // unreachable;
8257 }
8258 $4 = HEAP32[$2>>2]|0;
8259 $5 = (_sqlite3_value_type($4)|0);
8260 $6 = ($5|0)==(5);
8261 if ($6) {
8262 _sqlite3_result_null($0);
8263 return;
8264 }
8265 $7 = HEAP32[$2>>2]|0;
8266 $8 = (_sqlite3_value_text($7)|0);
8267 $9 = (_strlen($8)|0);
8268 $10 = (($9) + 1)|0;
8269 $11 = (_sqlite3_malloc($10)|0);
8270 $12 = ($11|0)==(0|0);
8271 if ($12) {
8272 _sqlite3_result_error_nomem($0);
8273 return;
8274 }
8275 $13 = (($11) + ($9)|0);
8276 $14 = ((($13)) + -1|0);
8277 HEAP8[$13>>0] = 0;
8278 $$035$ph = $14;$$036$ph = $8;
8279 L12: while(1) {
8280 $$pre = HEAP8[$$036$ph>>0]|0;
8281 $$036 = $$036$ph;$17 = $$pre;
8282 while(1) {
8283 $15 = ((($$036)) + 1|0);
8284 $16 = $17&255;
8285 $18 = (16403 + ($16)|0);
8286 $19 = HEAP8[$18>>0]|0;
8287 $20 = $19&255;
8288 switch ($19<<24>>24) {
8289 case 4: {
8290 $$137 = $$036;
8291 break;
8292 }
8293 case 3: {
8294 $21 = $16 << 6;
8295 $22 = ((($$036)) + 2|0);
8296 $23 = HEAP8[$15>>0]|0;
8297 $24 = $23&255;
8298 $25 = (($24) + ($21))|0;
8299 $$0$i = $22;$$018$i = $25;
8300 label = 11;
8301 break;

Callers

nothing calls this directly

Calls 9

_sqlite3_value_typeFunction · 0.85
_sqlite3_result_nullFunction · 0.85
_sqlite3_value_textFunction · 0.85
_strlenFunction · 0.85
_sqlite3_mallocFunction · 0.85
_sqlite3_result_textFunction · 0.85
_sqlite3_freeFunction · 0.85
___assert_failFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…